Matern: error in qr.coef

79 views
Skip to first unread message

Michael Smith

unread,
May 20, 2021, 2:34:54 AM5/20/21
to R-inla discussion group
Hi everyone,

On a PC with R 4.1.0 (latest testing version of INLA) this gives me the error message "Error in qr.coef(a, b) : 'qr' and 'y' must have the same number of rows'

Mesh3 <- inla.mesh.2d(grid2, boundary = boundary, max.edge = c(25000, 250000), cutoff = 3000)
matern <- inla.spde2.pcmatern(Mesh3,
                                prior.sigma = c(3000, 0.01),
                                prior.range = c(10, 0.01))

....the mesh summary reads:
Manifold:       R2
CRS/LegacyPROJ4:         N/A
CRS/WKT:  (only shown with verbose = TRUE)
Vertices:          9461
Triangles:        18881
Boundary segm.:    39 (1 group: 0)
Interior segm.:    2374 (2 groups: 1 2)
xlim:    217567.6 2315702
ylim:    8407971 10124431
zlim:    0 0

....I've tried on another PC running R4.0.3 with no error message.

Is this an issue I should raise on GitHub do you think?

Best wishes,
Michael

Helpdesk

unread,
May 20, 2021, 2:53:56 AM5/20/21
to Michael Smith, R-inla discussion group

Thank you. R-4.1 is just out and we have not tested it yet. if you can
open an issue on github, for this it would great. please attach files so
we can reproduce it

thx!
H


On Wed, 2021-05-19 at 23:34 -0700, 'Michael Smith' via R-inla discussion
> --
> You received this message because you are subscribed to the Google
> Groups "R-inla discussion group" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to r-inla-discussion...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/r-inla-discussion-group/a3b29f27-cdbc-48d6-b33f-a550fa4308c1n%40googlegroups.com
> .

--
Håvard Rue
he...@r-inla.org

Finn Lindgren

unread,
May 20, 2021, 5:03:57 AM5/20/21
to Helpdesk, Michael Smith, R-inla discussion group
I just installed R 4.1.0 and the latest INLA now, and it's at least not a universal problem, as the test problem below works.
Without a working example there's no way to tell, but it's likely your particular problem is numerically unstable in some way, and that the details of how qr behaves in that situation may have changed.
If you can post a working example (perhaps with the aid of the "reprex" package?) on github that would be helpful, as Håvard said.

> library(INLA)
Loading required package: Matrix
Loading required package: foreach
Loading required package: parallel
Loading required package: sp
This is INLA_21.05.02 built 2021-05-03 11:13:08 UTC.
 - See www.r-inla.org/contact-us for how to get help.
 - To enable PARDISO sparse library; see inla.pardiso()
> Mesh3 <- inla.mesh.2d(matrix(rnorm(100),50,2), max.edge = c(25000, 250000)/100000, cutoff = 3000/100000)
> matern <- inla.spde2.pcmatern(Mesh3,
+                               prior.sigma = c(3000, 0.01),
+                               prior.range = c(10, 0.01))
> summary(Mesh3)


Manifold: R2
CRS/LegacyPROJ4: N/A
CRS/WKT: (only shown with verbose = TRUE)
Vertices: 1131
Triangles: 2225
Boundary segm.: 35 (1 group: 0)
Interior segm.: 104 (1 group: 0)
xlim: -4.208298 3.087573
ylim: -3.386323 3.819659
zlim: 0 0
--
Finn Lindgren
email: finn.l...@gmail.com
Reply all
Reply to author
Forward
0 new messages