[R] geoR - help for bayesian modelling

Ole F. Christensen olefc at daimi.au.dk
Thu Mar 25 07:33:50 CET 2004


Dear Monica

Guess the reason for the problem you are seeing is that you are 
requiring simulations from the predictive distribution. geoR is doing 
this simulation in a joint step, simulating from the joint predictive 
distriubtion [as far as I know some other geostatistical software 
packages are doing such simulation in a sequential way, where a point 
the grid is added at a time]. For a relatively large grid the covariance 
matrix needed for this joint simulation is large [in your example a 
matrix of size 7500 by 7500].

Possible solutions :

* Do you really want simulations from the multivariate predictive 
distribution ? What do you want to do with them ?
Most summaries you would want of the predictive distribution are 
summaries of the univariate distributions at individual locations.

* Do you really need to predict in a 150 by 250 grid ? If possible, then 
reduce the size of your grid.

The error you are seeing is related to the cholesky factorisation of the 
covariance matrix, which is needed to do the joint simulations. If you 
do not require these simulations, the error will disappear.
As you write, the error is probably due to some locations being very 
close to data locations. As I remember there is an internal handling in 
the package of prediction locations close to data locations, but your 
locations are not sufficiently near to the data locations to be handled 
by this. Maybe you should change the prediction coordinates in question 
such that they actually do coincide with the data locations.

Hope this is helpful

Cheers

Ole

***

Hi,

I am trying to do a bayesian prediction for soil pollution data above 
a certain threshold, using geoR. 

Everything is working fine until i am doing the krig.bayes. I tried to 
do the prediction on a grid 67 by 113 cells and my computer is 
freezing to death. At larger numbers of cells it tells me after a while 
that it reaches the max. memory of 511 Mb. My computer has only 
512 Mb of RAM. What RAM capacity should i look for to do a 150 
x 250 cell grid???

If i want to do the prediction on my initial data locations (well, 
actually the prediction points are shifted 1 m in X and respectively 
Y direction, so the raw data coordinates don't coincide with the 
prediction coordinates) i am getting the following error using the 
command:

zn.bayes <- krige.bayes(zn.gdata, loc = xy, model = 
model.control(cov.model = "exponential", lambda = 0), prior = 
prior.control(phi.prior ="exponential", phi = 89.1894), 
output=output.control(n.predictive=2, mean.var = TRUE, quantile = 
c(0.025,0.25, 0.5, 0.75, 0.975), threshold = c(300)))

Error in cond.sim(env.loc = base.env, env.iter = iter.env, 
loc.coincide = get("loc.coincide",  : 
        chol: matrix not pos def, diag[13]= -1.279220e-018

I will really appreciate any suggestion you may have.

Thank you so much,

Monica


-- 
Ole F. Christensen
Center for Bioinformatik
Aarhus Universitet
Ny Munkegade, Bygning 540
8000 Aarhus C




More information about the R-help mailing list