Learn R Programming

SpatioTemporal (version 1.1.2)

updateCovf: Update Covariance Functions in STmodel Objects

Description

Updates/sets the covariance functions for STmodel objects. Used by createSTmodel.

Usage

updateCovf(STmodel, cov.beta = STmodel$cov.beta,
    cov.nu = STmodel$cov.nu)

Arguments

STmodel
STmodel object with observations, covariates, trends, etc; see mesa.model.
cov.beta,cov.nu
Covariance specification for the beta- and nu-fields should contain fields covf, nugget, and random.effect (for the nu field); see details for description of these fields. For cov.beta the field

Value

  • updated version of STmodel with new covariance specifications.

Details

The covariance function is specified using lists for cov.beta and cov.nu. The lists should contain the following elements: [object Object],[object Object],[object Object]

See Also

Other covariance functions: crossDist, evalCovFuns, makeSigmaB, makeSigmaNu, namesCovFuns, parsCovFuns

Other STmodel functions: createCV, createDataMatrix, createSTmodel, dropObservations, loglikeST, loglikeSTdim, loglikeSTnaive, predictNaive, processLocation, processLUR, processST

Examples

Run this code
##load the data
data(mesa.model)

##covariance specification:
cov.beta <- list(covf="exp", nugget=FALSE)
cov.nu <- list(covf="exp", nugget=TRUE, random.effect=FALSE)

##Simple covariance structure
updateCovf(mesa.model, cov.beta, cov.nu)

##different behaviour for different beta:s
cov.beta <- list(covf=c("exp","exp2","matern"), nugget=c(TRUE,FALSE,FALSE))
updateCovf(mesa.model, cov.beta, cov.nu)

##Spatially varying nugget
cov.nu <- list(covf="exp", nugget="type", random.effect=FALSE)
print(tmp <- updateCovf(mesa.model, cov.beta, cov.nu))
##lets study the regression matrix for the nugget
str(tmp$cov.nu$nugget.matrix)
head(tmp$cov.nu$nugget.matrix)

Run the code above in your browser using DataLab