[R-sig-Geo] geoRglm: sim.predict problems

Jason Lessels jason.lessels at sydney.edu.au
Fri Nov 26 00:35:13 CET 2010


Hi Simon,
I have been attempting a similar thing as you, but using the glsm.krige 
function, without success. From what i can work out the the 
output.glm.control() settings are sent to the .cond.sim function from 
geoR, which is doing something different to what you are after (I 
believe). I have had a brief look at the binom.krige.bayes function, and 
it appears the median of the values is performed within the sub function 
.pred.quan.aux function on the first line

temp.med <- apply(temp.pred$mean, 1, median)

I assume that it would be possible for you to adjust this function to 
get it to do what you want, but i am unsure about that, as i have been 
using the glsm.krige function.

If you try to re-run your code with a smaller prediction grid (50 
points), the output.glm.control function will most likely work for you, 
however i have waited over a day for 8000 points with no luck.

Jason


On 25/11/10 00:04, O'Hanlon, Simon J wrote:
> Dear List,
> I have been using geoRglm to perform spatial prediction in the binomial-logit spatial model.
>
> I have been able to produce maps of some predicted volumetric quantity (prevalence) over a wide geographic area (2385km * 1375km in 131,175 5km cells) , using covariates in the fixed part of the model. Using the function binom.krige.bayes produces output which includes an estimate of the predictive median for each cell in the map. This is specified when setting 'inference=TRUE' in the control function called 'output.glm.control' which is called by binom.krige.bayes.
>
> However the median is only one map of the posterior distribution of the estimated quantity. I want to look at some of the other maps, including the mean map of the predicted. In order to do this I need to get the posterior prediction of the prevalence for each map cell for each iteration of the simulation. Then for each cell I can calculate the mean etc. In order to do this there is a TRUE/FALSE switch called 'sim.predict' in the control function 'output.glm.control'. When set to false you simply return the predictive median. When set to TRUE you should return the values of the predictied quantity for each iteration of the model. When I set this to true RGui crashes with no warning or error messages (even when verbose mode is turned on). R is not using it vector or stack heaps, and I am only using 8GB out of 16GB of system ram. Also the table which should be dimensioned to hold the predictions is well inside the limits placed by R (i.e. a table with less than 2^31-1 elements!
>   ). I am running 150,000 iterations of a model , predicting over 131,175 map cells, and I have thinning set to 100 (to minimise autocorrelation between simulations), so I should be recording 1500 simulation results (150,000 / 100).
>
> Has this problem happened to anybody else and does anybody know of another way to record the predictive posterior draws of the simulations?
>
> Much obliged and sorry if I have not used appropriate jargon in places - I am relatively new to this.
>
> Cheers,
>
> Simon
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>    



More information about the R-sig-Geo mailing list