Description Usage Arguments Value Author(s) See Also Examples
View source: R/c_cov_matrices.R
Function that creates a block covariance matrix with unequally sized blocks. Used to construct the Sigma_nu matrix.
1 2 3 4 
pars 
Vector of parameters, as suggested by

dist 
Distance matrix. 
type 
Name of the covariance function to use, see

nugget 
A value of the nugget or a vector of length

random.effect 
A constant variance to add to the covariance matrix,
can be interpereted as either and partial sill with infinite
range or as a random effect with variance given by 
symmetry 

blocks1, blocks2 
Vectors with the size(s) of each of the
diagonal blocks, usually 
ind1, ind2 
Vectors indicating the location of each element in the
covariance matrix, used to index the 
ind2.to.1 
Vectors, that for each index along the second dimension,

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. 
Block covariance matrix of size
length(ind1)
bylength(ind2)
.
Johan Lindstrom
Other block matrix functions: blockMult
,
calc.FXtF2
, calc.FX
,
calc.mu.B
, calc.tFXF
,
calc.tFX
, makeCholBlock
,
makeSigmaB
Other covariance functions: crossDist
,
evalCovFuns
, makeSigmaB
,
namesCovFuns
, parsCovFuns
,
updateCovf
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  ##First create some random locations
x < rnorm(5)
y < rnorm(5)
##compute distance matrix
D < crossDist( cbind(x,y) )
#a vector of locations
I < c(1,2,3,1,4,4,3,2,1,1)
T < c(1,1,1,2,2,3,3,3,3,4)
##create a block diagonal matrix consisting of four parts with
##exponential covariance.
sigma.nu < makeSigmaNu(c(.4,2), D, "exp", nugget=0.1,
blocks1 = c(3,2,4,1), ind1 = I)
##and cross covariance
sigma.nu.c < makeSigmaNu(c(.4,2), D, "exp", nugget=0.1,
blocks1 = c(3,2,4,1), ind1 = I,
blocks2 = c(0,0,3,1), ind2 = I[7:10])
##compare the crosscovariance with the relevant part of sigma.nu
range(sigma.nu.csigma.nu[,7:10])
##an alternative showing the use of loc.ind2.to.1
sigma.nu.c < makeSigmaNu(c(.4,2), D[,4:3], "exp", nugget=0.1,
blocks1 = c(3,2,4,1), ind1 = I,
blocks2 = c(0,0,2,0), ind2 = 1:2,
ind2.to.1=4:3)
##compare the crosscovariance with the relevant part of sigma.nu
range(sigma.nu.csigma.nu[,6:7])

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.