gregorkastner / stochvol

Partial re-write of the R package stochvol to allow for asymmetry (leverage).
15 stars 8 forks source link

speed issue #23

Closed waynelapierre closed 9 months ago

waynelapierre commented 9 months ago

Thank you so much for this great package. Is there a plan to speed it up a little bit? The benchmark below shows that it is much slower than another package stochvolTMB. I understand that the estimation methods are different, but the difference in speed seems too large. https://cran.r-project.org/web/packages/stochvolTMB/vignettes/stochvolTMB_vignette.html

hdarjus commented 9 months ago

Hi @waynelapierre, thanks for the interest. stochvolTMB is a great package, and as its vignette says, stochastic volatility models are difficult to estimate. Essentially, the user has to sacrifice something. If one uses the stochvolTMB package, the user sacrifices the exact SV model and replaces it with another model through Laplace approximation; parameter estimates may be close to the estimates under the exact model or far away depending on the data. stochvol can estimate the exact SV model but the user has to wait a bit more. There are also significant differences in uncertainty quantification.

waynelapierre commented 9 months ago

Thanks for the clarification. Have you tried using OpenMP to parallelize your C++ codes? Also, you can probably get a faster RNG from the package qrng.