createSTmodel {SpatioTemporal} | R Documentation |
Creates a STmodel
object that can be for estimation and prediction.
For details see the sub-functions linked under the relevant Arguments.
createSTmodel(STdata, LUR = NULL, ST = NULL, cov.beta = list(covf = "exp", nugget = FALSE), cov.nu = list(covf = "exp", nugget = TRUE, random.effect = FALSE), locations = list(coords = c("x", "y"), long.lat = NULL, coords.beta = NULL, coords.nu = NULL, others = NULL), strip = FALSE, scale = FALSE, scale.covars = NULL)
STdata |
|
LUR |
Specification of covariates for the beta-fields,
see |
ST |
Specification of spatio-temporal covariates,
see |
cov.beta, cov.nu |
Specification of the covariance functions,
see |
locations |
Specification of the sites (both monitored and un-monitored),
see |
strip |
Should unobserved locations be dropped? |
scale |
Scale the covariates? If |
scale.covars |
list with elements |
The object holds observations, trends, geographic, and spatio-temporal covariates, as well as a number of precomputed fields that speed up log-likelihood evaluations. To improve performance the locations are also reorder so that observed locations come before unobserved.
A STmodel
object, see mesa.model
for an example.
Johan Lindstrom
Other STmodel methods: MCMC.STmodel
,
c.STmodel
, estimate.STmodel
,
estimateCV.STmodel
,
plot.STdata
, predict.STmodel
,
print.STmodel
,
print.summary.STmodel
,
qqnorm.predCVSTmodel
,
scatterPlot.predCVSTmodel
,
simulate.STmodel
,
summary.STmodel
Other STmodel functions: createCV
,
createDataMatrix
,
dropObservations
,
estimateBetaFields
,
loglikeSTdim
, loglikeST
,
predictNaive
, processLUR
,
processLocation
, updateCovf
,
updateTrend.STdata
Other STdata functions: c.STmodel
,
createDataMatrix
,
createSTdata
, detrendSTdata
,
estimateBetaFields
,
removeSTcovarMean
,
updateTrend.STdata
##load the data data(mesa.data.raw) ##and create STdata-object mesa.data <- createSTdata(mesa.data.raw$obs, mesa.data.raw$X, n.basis=2, SpatioTemporal=mesa.data.raw["lax.conc.1500"]) ##define land-use covariates LUR <- list(~log10.m.to.a1+s2000.pop.div.10000+km.to.coast, ~km.to.coast, ~km.to.coast) ##and covariance model cov.beta <- list(covf="exp", nugget=FALSE) cov.nu <- list(covf="exp", nugget=TRUE, random.effect=FALSE) ##which locations to use locations <- list(coords=c("x","y"), long.lat=c("long","lat"), others="type") ##create object mesa.model <- createSTmodel(mesa.data, LUR=LUR, ST="lax.conc.1500", cov.beta=cov.beta, cov.nu=cov.nu, locations=locations) print(mesa.model) ##This is the same as data(mesa.model) ##lets try some alternatives: model.none <- createSTmodel(mesa.data, LUR=NULL, ST=NULL) print(model.none) ##Specify LUR:s using numbers names(mesa.data$covars) model.diff <- createSTmodel(mesa.data, LUR=list(c(7,10,11,12),11:12,11:12), ST=1) print(model.diff) ##Same covariates for all temporal trends, calling by name ##but with different covariance models for each trend, and nugget that depends ##on monitor type model.same <- createSTmodel(mesa.data, LUR=c("log10.m.to.a1", "log10.m.to.road", "km.to.coast","s2000.pop.div.10000"), ST="lax.conc.1500", cov.nu=list(nugget="type"), cov.beta=list(covf=c("exp","exp2","iid"), nugget=c(FALSE, FALSE, TRUE)) ) print(model.same)