fit_mvss {mvpd} | R Documentation |
Fit a Multivariate Subgaussian Distribution
Description
Estimates the parameters (namely, alpha, shape matrix Q, and location vector) of the multivariate subgaussian distribution for an input matrix X.
Usage
fit_mvss(x)
Arguments
x |
a matrix for which the parameters for a |
Details
Using the protocols outlined in Nolan (2013), this function uses libstable4u
's univariate
fit functions for each component.
Value
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 applyingnearPD()
) -
mult_Q_posdef
- the nearest positive definite multivariate shape matrix estimate,nearPD(mult_Q_raw)
References
Nolan JP (2013), Multivariate elliptically contoured stable distributions: theory and estimation. Comput Stat (2013) 28:2067–2089 DOI 10.1007/s00180-013-0396-7
See Also
Rfast::mvnorm.mle
, alphastable::mfitstab.elliptical
Examples
## 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)