[R] simulating data from a multivariate dist
Joris Meys
jorismeys at gmail.com
Thu Jun 17 17:47:07 CEST 2010
Dirty hack, but it's working.
library(MASS)
mu <- aic.mv$best.model at expected.value
sigma <- aic.mv$best.model at variance
mvrnorm(100,mu,sigma)
If you'd like to follow the rules, look for the functions to extract
the expected value and the variance of the best model out of the
stepAIC.ghyp object. I didn't find them, but then again, I'm a lazy
bastard and didn't look for them either.
Cheers
Joris
On Thu, Jun 17, 2010 at 2:49 PM, suman dhara <suman.dhara89 at gmail.com> wrote:
> Sir,
> I am working on fitting distribution on multivariate financial data and then
> simulate observations from that fitted distribution. I use stepAIC.ghyp()
> function of 'ghyp' library which select the best fitted distribution from
> generalized hyperbolic distribution class on the given dataset.
>
> data(indices)
>
> # Multivariate case:
> aic.mv <- stepAIC.ghyp(indices, dist = c("ghyp", "hyp", "t", "gauss"),
> symmetric = NULL, control = list(maxit = 500),
> silent = TRUE, nit = 500)
>
> summary(aic.mv$best.model)
>
> It fits asymmetic student-t dist. to the data 'indices'. Now, I want to
> simulate data from this best fitted distribution. I use
> simulate(aic.mv$best.model).
> But, it is not working. Can you give me the funtion/code to simulate data
> from this best fitted distribution.
>
>
>
> Thanks & Regards,
> Suman Dhara
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Joris Meys
Statistical consultant
Ghent University
Faculty of Bioscience Engineering
Department of Applied mathematics, biometrics and process control
tel : +32 9 264 59 87
Joris.Meys at Ugent.be
-------------------------------
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php
More information about the R-help
mailing list