Description Usage Arguments Details Value Author(s) See Also Examples
Creates a STmodel
object that can be for estimation and prediction.
For details see the sub-functions linked under the relevant Arguments.
1 2 3 4 5 | 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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | ##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)
|
Loading required package: Matrix
STmodel-object with:
No. locations: 25 (observed: 25)
No. time points: 280 (observed: 280)
No. obs: 4577
Trend with 2 basis function(s):
[1] "V1" "V2"
with dates:
1999-01-13 to 2009-09-23
Models for the beta-fields are:
$const
~log10.m.to.a1 + s2000.pop.div.10000 + km.to.coast
$V1
~km.to.coast
$V2
~km.to.coast
1 spatio-temporal covariate(s):
[1] "lax.conc.1500"
Covariance model for the beta-field(s):
Covariance type(s): exp, exp, exp
Nugget: No, No, No
Covariance model for the nu-field(s):
Covariance type: exp
Nugget: ~1
Random effect: No
All sites:
AQS FIXED
20 5
Observed:
AQS FIXED
20 5
For AQS:
Number of obs: 4178
Dates: 1999-01-13 to 2009-09-23
For FIXED:
Number of obs: 399
Dates: 2005-12-07 to 2009-07-01
STmodel-object with:
No. locations: 25 (observed: 25)
No. time points: 280 (observed: 280)
No. obs: 4577
Trend with 2 basis function(s):
[1] "V1" "V2"
with dates:
1999-01-13 to 2009-09-23
Models for the beta-fields are:
$const
~1
$V1
~1
$V2
~1
No spatio-temporal covariates.
Covariance model for the beta-field(s):
Covariance type(s): exp, exp, exp
Nugget: No, No, No
Covariance model for the nu-field(s):
Covariance type: exp
Nugget: ~1
Random effect: No
[1] "ID" "x" "y"
[4] "long" "lat" "type"
[7] "log10.m.to.a1" "log10.m.to.a2" "log10.m.to.a3"
[10] "log10.m.to.road" "km.to.coast" "s2000.pop.div.10000"
STmodel-object with:
No. locations: 25 (observed: 25)
No. time points: 280 (observed: 280)
No. obs: 4577
Trend with 2 basis function(s):
[1] "V1" "V2"
with dates:
1999-01-13 to 2009-09-23
Models for the beta-fields are:
$const
~log10.m.to.a1 + log10.m.to.road + km.to.coast + s2000.pop.div.10000
$V1
~km.to.coast + s2000.pop.div.10000
$V2
~km.to.coast + s2000.pop.div.10000
1 spatio-temporal covariate(s):
[1] "lax.conc.1500"
Covariance model for the beta-field(s):
Covariance type(s): exp, exp, exp
Nugget: No, No, No
Covariance model for the nu-field(s):
Covariance type: exp
Nugget: ~1
Random effect: No
STmodel-object with:
No. locations: 25 (observed: 25)
No. time points: 280 (observed: 280)
No. obs: 4577
Trend with 2 basis function(s):
[1] "V1" "V2"
with dates:
1999-01-13 to 2009-09-23
Models for the beta-fields are:
$const
~log10.m.to.a1 + log10.m.to.road + km.to.coast + s2000.pop.div.10000
$V1
~log10.m.to.a1 + log10.m.to.road + km.to.coast + s2000.pop.div.10000
$V2
~log10.m.to.a1 + log10.m.to.road + km.to.coast + s2000.pop.div.10000
1 spatio-temporal covariate(s):
[1] "lax.conc.1500"
Covariance model for the beta-field(s):
Covariance type(s): exp, exp2, iid
Nugget: No, No, Yes
Covariance model for the nu-field(s):
Covariance type: exp
Nugget: ~type
Random effect: No
All sites:
AQS FIXED
20 5
Observed:
AQS FIXED
20 5
For AQS:
Number of obs: 4178
Dates: 1999-01-13 to 2009-09-23
For FIXED:
Number of obs: 399
Dates: 2005-12-07 to 2009-07-01
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.