[R] Help with Krige.conv using linear models
Jennifer Lenz
Jennifer.Lenz at tufts.edu
Wed Dec 21 21:50:03 CET 2005
A majority of my data makes a kriged map perfectly using an exponential
model for the semivariogram to fit my data and then going through the
commands variofit() to define the model and then krige.conv() to use the
model to predict values in a grid. But…one set of my data appears to be
linearly correlated for the first 5000 meters and not correlated beyond
that. I have been having problems using krige.conv() to get a decent
kriged map using the linear model. The code I am using from my data is
as follows:
>modeltest=variofit(variotest, weights=’cressie’, cov.model=’linear’,
ini.cov.pars=c(80,1))
The output parameters are tausq = 9.855, sigmasq = 0.0087, phi=1.0
>krig=krige.conv(data, krige=krige.control(type.krig=’ok’,
obj.model=modeltest), locations=pred.grid)
At this point, krig$predict values have little to no variability (1.897
+/- 0.004), where I would expect values between 0 – 15.
By running the same data, except using an exponential model such as:
>modeltest=variofit(variotest, weights=’cressie’, cov.model=’exponential’)
This model appears to fit the data (only the first 5 km) about the same
as the linear model except now the output parameters are tausq=10.02,
sigmasq=318909, and phi = 3714567. And calling krige.conv() again, the
predicted values are in the range that I would expect, and the kriged
map looks fine.
I’m not sure if this has something to do with how the kriging is using
the model beyond the 5 km. It seems like I need to be able to set the
function to only apply the linear weighting to the linearly correlated
portion (data less than 5km away), and the rest to 0, but I’m not sure
how to do that (or maybe I’m completely going down the wrong track).
I’m using Windows XP pro OS with R 2.1.1. Please help the neophyte
statistician. To figure this out is the only Christmas gift that I
need. Thanks.
More information about the R-help
mailing list