match_t: Moment Matching for the t Distribution

View source: R/moment_matching.R

match_tR Documentation

Moment Matching for the t Distribution

Description

Generates scenarios from the Student-t distribution that exactly matches the first two moments.

Usage

match_t(mu, sigma, nu, n, stochastic = FALSE)

Arguments

mu

A double with the location parameter.

sigma

A variance-covariance matrix the dispersion parameter.

nu

An integer with the degrees of freedom.

n

An integer with the number of scenarios to be generated.

stochastic

A logical flag indicating whether (or not) the stochastic representation should be used. The default if TRUE.

Value

A tibble in the wide format.

See Also

match_normal

Examples

x     <- diff(log(EuStockMarkets))
mu    <- colMeans(x)
sigma <- cov(x)
nu    <- 5
match_t(mu, sigma, nu, 10)

cor(x)
cor(match_t(mu, sigma, nu, 100000))

mu
colMeans(match_t(mu, sigma, nu, 100000, TRUE))

Reckziegel/CMA documentation built on July 13, 2022, 10:31 p.m.