Description Usage Arguments Details Value Author(s) See Also Examples
Function that creates a block covariance matrix with equal sized blocks. Used to construct the Sigma_B matrix.
1 2 |
pars |
List of parameters for each block; if not a list a single
block matrix is assumed. Should match parameters suggested by
|
dist |
Distance matrix. |
type |
Name(s) of covariance functions, see
|
nugget |
Vector of nugget(s) to add to the diagonal of each matrix. |
symmetry |
|
ind2.to.1 |
Vectors, that for each index along the second dimension
gives a first dimension index, used only if |
sparse |
If |
diff |
Vector with two components indicating with respect to which
parameter(s) that first and/or second derivatives should be
computed. E.g. |
Any parameters given as scalars will be rep
-ed to match
length(pars)
.
Block covariance matrix of size dim(dist)*n.blocks
.
Johan Lindstrom
Other block matrix functions: blockMult
,
calc.FXtF2
, calc.FX
,
calc.mu.B
, calc.tFXF
,
calc.tFX
, makeCholBlock
,
makeSigmaNu
Other covariance functions: crossDist
,
evalCovFuns
, makeSigmaNu
,
namesCovFuns
, parsCovFuns
,
updateCovf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ##First create some random locations
x <- rnorm(5)
y <- rnorm(5)
##compute distance matrix
D <- crossDist( cbind(x,y) )
##create a block diagonal matrix exponential covariance matrix
##with different range, sill, and nugget
pars <- list(c(.3,2), c(2,1), c(1,3))
nugget <- c(.5,0,1)
Sigma1 <- makeSigmaB(pars, D, type="exp", nugget=nugget)
##or using different covariance functions for each block
Sigma2 <- makeSigmaB(pars, D, type=c("exp","exp2","cubic"),
nugget=nugget)
##make a cross-covariance matrix
Dcross <- D[1:3,c(1,1,2,2)]
Sigma.cross <- makeSigmaB(pars, Dcross, type="exp", nugget=nugget,
ind2.to.1=c(1,1,2,2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.