[R] GeoR model.control - defining covariates at prediction locations

Paulo Justiniano Ribeiro Jr paulojus at c3sl.ufpr.br
Mon Aug 18 14:29:57 CEST 2008


Trends in ge are handled by the "trend"argument.
In particular, for the so called "external trend" we use varioables which
can be at the geodata object or another object.

For instance a model fitting call could be somethoing like:
ML <- likfit..., trend= ~covar1+ covar2, ...)

where covar1 and covar2 have the same dimension as the data and can be
vector or columuns withing the covariate elelent of a geodata obvject.

For kriging you need the values of such covariates at prediction locations
lts say the vectors predcovar1 and predcovar2

Then you use model.control(..., trend.l= ~ predcovar1+predcovar2)

Three are osme more examples at geoR page, Tutorials section, and please
send the commands such that we can be more specific

best
P.J.



Date: Mon, 18 Aug 2008 02:59:50 -0700 (PDT)
From: imicola <N.A.Batchelor at sms.ed.ac.uk>
Subject: [R] GeoR model.control - defining covariates at prediction
        locations
To: r-help at r-project.org
Message-ID: <19028273.post at talk.nabble.com>
Content-Type: text/plain; charset=us-ascii


Hi,

Im using geoR and I'm trying to do some predictions, based on an external
trend.

I'm having some problems specifying my model.control, specifically how do
I
define my model, and also the source of the covariate data at the
prediction
locations?

I am assuming that the covariate data at the prediction locations should
be
imported to a geodata object along with the prediction location
coordinates
- this is what I have done, but I can't get the prediction to work.

So my question is:  How should the prediction location and covariate data
at
prediction locations be stored?  And also how do I specify model.control
so
that it recognises where my covariate data is?

Below is the error message that I am getting:

krige.bayes: model with mean defined by covariates provided by the user
Warning messages:
1: locations provided as a list with more than 2 components. Only the 2
first will be used as coordinates in: .check.locations(locations)
2: data length [507] is not a sub-multiple or multiple of the number of
rows
[254] in matrix
Error in trend.spatial(trend = model$trend.l, geodata = list(coords =
locations)) :

trend elements not found

Thanks,



More information about the R-help mailing list