fit_mvss | R Documentation |
Estimates the parameters (namely, alpha, shape matrix Q, and location vector) of the multivariate subgaussian distribution for an input matrix X.
fit_mvss(x)
x |
a matrix for which the parameters for a |
Using the protocols outlined in Nolan (2013), this function uses libstable4u
's univariate
fit functions for each component.
A list with parameters from the column-wise univariate fits and
the multivariate alpha and shape matrix estimates (the univ_deltas
are the mult_deltas
):
univ_alphas
- the alphas from the column-wise univariate fits
univ_betas
- the betas from the column-wise univariate fits
univ_gammas
- the gammas from the column-wise univariate fits
univ_deltas
- the deltas from the column-wise univariate fits
mult_alpha
- the mean(univ_alphas); equivalently the multivariate alpha estimate
mult_Q_raw
- the multivariate shape matrix estimate (before applying nearPD()
)
mult_Q_posdef
- the nearest positive definite multivariate shape matrix estimate, nearPD(mult_Q_raw)
Nolan JP (2013), Multivariate elliptically contoured stable distributions: theory and estimation. Comput Stat (2013) 28:2067–2089 DOI 10.1007/s00180-013-0396-7
Rfast::mvnorm.mle
, alphastable::mfitstab.elliptical
## create a 4x4 shape matrix symMat
S <- matrix(rnorm(4*4, mean=2, sd=4),4);
symMat <- as.matrix(Matrix::nearPD(0.5 * (S + t(S)))$mat)
symMat
## generate 10,000 r.v.'s from 4-dimensional mvss
X <- mvpd::rmvss(1e4, alpha=1.5, Q=symMat, delta=c(1,2,3,4))
## use fit_mvss to recover the parameters, compare to symMat
fmv <- mvpd::fit_mvss(X)
fmv
symMat
## then use the fitted parameters to calculate a probability:
mvpd::pmvss(lower=rep(0,4),
upper=rep(5,4),
alpha=fmv$mult_alpha,
Q=fmv$mult_Q_posdef,
delta=fmv$univ_deltas,
maxpts.pmvnorm = 25000*10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.