Rational quadratic covariance function
1 |
1 2 3 4 5 6 7 | locations = matrix(rnorm(10), ncol=2)
beta = rnorm(3) # Logarithms of variance, length scale & alpha
K = cov.RQ(locations, beta=beta)
stopifnot(all(Matrix::diag(K)==exp(beta[1]))) # Diagonal is exp(beta[1])
stopifnot(all(svd(K)$d>0)) # K is positive definite
stopifnot(all(K[upper.tri(K)]<K[1,1])) # Largest element is on diagonal
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.