Description Usage Arguments Value Examples
Correlation Matrix for Gaussian Process based on Power-Exponential Correlation function (c) Copyright William J. Welch 2000-2006.
1 | cor.matrix(x, cor.par)
|
x |
matrix/vector of explanatory variables |
cor.par |
matrix of correlation parameters |
returns the correlation matrix based on power-exponential correlation structure
1 2 3 4 5 6 7 8 9 10 11 12 13 | n <- 5
x1 <- seq(-5,10,length.out = n)
x2 <- seq(0,15,length.out = n)
data1 <- expand.grid(x1,x2)
x <- data1
# create hyperparameter matrix of thetas and alphas, alphas set to 0 indicated guassian correlation
d2 <- c(0.01,0.2,0,0)
cor.par <- data.frame(matrix(data = d2,nrow = dim(x)[2],ncol = 2))
names(cor.par) <- c("Theta.y","Alpha.y")
R <- cor.matrix(data1,cor.par) # obtain covariance matrix
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.