Description Usage Arguments Value Author(s) See Also Examples
Extracts parameters for the log-likelihood from a parameter vector and separates regression parameters and log-covariance parameters.
1 | loglikeSTgetPars(x, STmodel)
|
x |
A vector containing regression (optionally) and
log-covariance parameters. The ordering of
has to be exactly that indicated by
|
STmodel |
STmodel |
list containing:
gamma |
Regression coefficients for the spatio-temporal covariate(s). |
alpha |
A list of regression coefficients for geographic covariates. |
cov.beta |
A list containg a lists of pars and vector of nuggets.
See |
cov.nu |
A list of covariance parameters for the nu-field, as
|
Covariance parameters are also back-transformed from log-scale.
Johan Lindstrom
Other likelihood utility functions: calc.mu.B
,
loglikeSTdim
, loglikeSTnames
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 | ##load the data
data(mesa.model)
##Compute dimensions for the data structure
dim <- loglikeSTdim(mesa.model)
##Let's create random parameter vectors ...
x <- runif( dim$nparam.cov )
names(x) <- loglikeSTnames(mesa.model, FALSE)
x.all <- runif( dim$nparam )
names(x.all) <- loglikeSTnames(mesa.model, TRUE)
##... and pick them apart
str( loglikeSTgetPars(x, mesa.model) )
str( loglikeSTgetPars(x.all, mesa.model) )
##Try a somewhat more interesting covariance structure
mesa.model.alt <- updateCovf(mesa.model,
cov.beta=list(covf=c("exp","exp2","matern"),
nugget=c(TRUE,FALSE,TRUE)),
cov.nu=list(covf="exp", nugget="type",
random.effect=TRUE))
##Compute dimensions for the data structure
dim <- loglikeSTdim(mesa.model.alt)
##Let's create random parameter vectors ...
x <- runif( dim$nparam.cov )
names(x) <- loglikeSTnames(mesa.model.alt, FALSE)
x.all <- runif( dim$nparam )
names(x.all) <- loglikeSTnames(mesa.model.alt, TRUE)
##... and pick them apart
str( loglikeSTgetPars(x, mesa.model.alt) )
str( loglikeSTgetPars(x.all, mesa.model.alt) )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.