dat2mvt | R Documentation |
Fit multivariate skew-T distribution to a numeric dataset
dat2mvt(d, nRanGen = 50000)
d |
Input data. Must be numeric, and will likely fail if there are fewer than three unique values in any column. In general, the function is designed for data with plausibly skew-T distributions. |
nRanGen |
Confidence intervals are estimated using random variates of the multivariate skew-T distribution. This argument defines how many random samples to generate in the estimation. This function treats a dataset as being multivariate skew-T distributed (see Because distributional quantiles (CI) are estimated using randomly-generated
values from the multivariate distribution, increasing the number of values
will make the estimates more stable. Conversely, smaller values of Multivariate distribution estimation will become very slow with increasing numbers of variables, and with inappropriate variables (e.g., binary). If the function is taking very long to run, it is recommended to start with only a handful of variables, and add more slowly. Relies on the |
dat <- data.frame(x = rexp(200) , y= exp(rnorm(200)) , z = log(rnorm(200 , 5)))
got_mvt <- dat2mvt(dat)
got_mvt ; apply(dat, 2, quantile , c(.025 , .5 , .975))
# to generate new data using this fit multivariate skew-T distribution:
simulated_dat <- sn::rmst(50,dp =attr(got_mvt,'mvt_dp'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.