quadForm | R Documentation |
Evaluate quadratic form
quadForm(ecl, A, alpha = -1/2)
ecl |
estimate of covariance/correlation matrix from |
A |
matrix |
alpha |
default = -1/2. Exponent of eigen-values |
Evaluate quadratic form A^T \Sigma^{2\alpha} A
scalar value
library(Rfast)
n <- 800 # number of samples
p <- 200 # number of features
# create correlation matrix
Sigma <- autocorr.mat(p, .9)
# draw data from correlation matrix Sigma
Y <- rmvnorm(n, rep(0, p), sigma = Sigma * 5.1, seed = 1)
# eclairs decomposition
ecl <- eclairs(Y)
# return scalar
quadForm(ecl, Y[1, ])
# return matrix
quadForm(ecl, Y[1:2, ])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.