I want to fit multivariate GH distribution on my data, and then generate simulations for that distribution. Using the instructions given in ghyp package, I wrote following lines of code in R.

> data(smi.stocks)
> fitted <- fit.ghypmv(data = smi.stocks, silent=TRUE)
> rghyp(n = 100, fitted)
Error in ghypCheckPars(param) : 
  (list) object cannot be coerced to type 'double'

However, it gives me the error as shown above.

Any thoughts on why is it happening?

  • $\begingroup$ check structure of your data $\endgroup$ – Neeraj Nov 28 '15 at 10:34
  • $\begingroup$ @Neeraj The data I'm using is the one provided by ghyp package. It's a matrix of daily returns from January 2000 to January 2007 of five swiss blue chips and the Swiss Market Index (SMI). $\endgroup$ – HasnainMamdani Nov 28 '15 at 16:10
  • 1
    $\begingroup$ this fits at most to stackoverflow as it is purely a coding question. $\endgroup$ – Richard Nov 28 '15 at 16:37
  • 2
    $\begingroup$ I'm voting to close this question as off-topic because see comment. $\endgroup$ – Richard Nov 28 '15 at 16:37
  • $\begingroup$ I can not install the package at the moment as there is a time out (?) for this package and its dependencies (installing other packages works ..) did you check the properties of fitted? if smi.stocks is multivariate, can you calibrate it with one call? I doubt that. So check all data and objects using print() or head(). $\endgroup$ – Richard Nov 28 '15 at 17:13

I typed your code (after a fresh installation of all (!) packages necessary) and it just worked ...

  • $\begingroup$ I reinstalled packages using commands like install.packages("ghyp") and re-ran my code, but got the same error. (I'm using R 3.2.2 GUI 1.66 Mavericks build (6996)) $\endgroup$ – HasnainMamdani Nov 29 '15 at 15:52
  • 1
    $\begingroup$ I am using R version 3.1.3 (2015-03-09), Smooth Sidewalk - you better go to stackoverflow - maybe they know about compatability issues. $\endgroup$ – Richard Nov 30 '15 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.