View source: R/moment_matching.R
match_normal | R Documentation |
Generates scenarios from the normal distribution that exactly matches the first two moments.
match_normal(mu, sigma, n)
mu |
A |
sigma |
A variance-covariance |
n |
An |
#TODO
match_t
x <- diff(log(EuStockMarkets)) mu <- colMeans(x) sigma <- cov(x) match_normal(mu, sigma, 10) # correlation structure is similar cor(x) cor(match_normal(mu, sigma, 10000)) # as the location parameters mu colMeans(match_normal(mu, sigma, 10000))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.