LAMPSPUC / StateSpaceModels.jl

StateSpaceModels.jl is a Julia package for time-series analysis using state-space models.
https://lampspuc.github.io/StateSpaceModels.jl/latest/
MIT License
271 stars 25 forks source link

Enhancement Request - Add ability to specify innovations for simulation #318

Open dompazz opened 1 year ago

dompazz commented 1 year ago

It would be useful to be able to specify the simulated innovations. Often I'm combining ARIMA models for some variables with different models for others and using a copula framework to simulated the system.

Currently, to simulate 1 step ahead, 1000 times:

ar1 = SARIMA(y,order=(1,0,0),include_mean=true)
StateSpaceModels.fit!(ar1)
ar_sim = simulate_scenarios(ar1,1,1000)[1,1,:]

Would be helpful to allow something like: ar_sim = simulate_scenarios(ar1,1,1000; innovations=randn(1000)) generically: ar_sim = simulate_scenarios(ar1,n,m; innovations=r) where r is (n,m)

guilhermebodin commented 1 year ago

Hi, @dompazz, this is somehing that makes more sense in models that don't have uncertainties in the state update equations, we could implement a specialized version of the simulate_scenarios function only for ARIMA models, would you like to make a contribution to the package in that sense?

dompazz commented 1 year ago

Makes sense. Unfortunately, I likely won't have time to write it myself, but if I find I have a weekend, I'll give it a go.