| rcpp_rmvnorm | R Documentation |
These functions allow for the sampling of and evaluation of the log-density of a multivariate normal vector.
rcpp_log_dmvnorm(S,mu,x, istoep)
rcpp_rmvnorm(n,S,mu)
rcpp_rmvnorm_Toep(n,S,mu)
rcpp_rmvnorm_stable(n,S,mu)
S |
Covariance matrix of associated multivariate normal. |
n |
Number of (independent) samples to generate. |
mu |
Mean vector. |
x |
Vector of observations to evaluate the log-density of. |
istoep |
set this to |
Giri Gopalan gopalan88@gmail.com
#See demo/FastGPdemo.R, which includes timing comparisons
set.seed(123)
N <- 5
sigma <- 1 #variance parameter in the covariance function
phi <- 5 #decay parameter for the squared-exponential kernel
x_seq <- seq(N)
Sig <- as.matrix(sigma*exp(-as.matrix(dist(x_seq))^2/phi)) + .001*diag(N) #test covariance function
mu <- rep(0, N)
rcpp_log_dmvnorm(Sig,mu,rep(.1,N), istoep = TRUE)
rcpp_rmvnorm(n=1,Sig,mu)
rcpp_rmvnorm_Toep(n=1,Sig,mu)
rcpp_rmvnorm_stable(n=1,Sig,mu)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.