R INLA spatial prediction VS universal kriging with geoR

44 views
Skip to first unread message

wenlo...@gmail.com

unread,
Apr 4, 2021, 11:42:43 PM4/4/21
to R-inla discussion group
Hi,
I did a comparison between R-inla prediction and kriging function in geoR package, found that the R-inla prediction tends to be  not as good as the geoR kriging results in terms of rmse and r2, even with massive mesh locs. And I wonder if I miss something when coding up the inla spatial prediction as below. Any help will be appreciated!

#inla setting snapshot 
 mesh <- inla.mesh.2d(loc,
                     max.edge = c(1, 2),
                     offset = c(0.5, 1.5),
                      cutoff =0.5 )
 A <- inla.spde.make.A(mesh, loc) 
 ...
 result_uni <- inla(form_uni, rep('gaussian', 1),
                       data = inla.stack.data(stack_uni), 
                       control.family = list(hyper.eps),
                       control.predictor = list(A = inla.stack.A(stack_uni), compute=TRUE),
                       control.inla = list(int.strategy = 'eb'),
                       control.compute=list(cpo=TRUE, dic=TRUE,config = TRUE))
...
#pred_mean at mesh locs
  pred_mean <- result_uni$summary.random[[s1]]$mean + result_uni$summary.fixed$mean[1]

#pred_sd at mesh locs
  pred_sd <- result_uni$summary.random[[s1]]$sd
  
#get the prediction at obs locs
  tmp_m <- drop(A %*% pred_mean)
  tmp_sd <- drop(A %*% pred_mean)


Reply all
Reply to author
Forward
0 new messages