# NOT RUN {
##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))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab