SMAC-Group / gmwm

Generalized Method of Wavelet Moments (GMWM) is an estimation technique for the parameters of time series models. It uses the wavelet variance in a moment matching approach that makes it particularly suitable for the estimation of certain state-space models.
Other
28 stars 14 forks source link

MA1() needs initial values #222

Open stefangachter opened 3 years ago

stefangachter commented 3 years ago

The moving average model needs initial values. Otherwise, following error occurs: error: Mat::operator(): index out of bounds However, for auto_imu initial values seem not to be considered. The above error occurs in any case.

DavideACucci commented 3 years ago

To help us understand what happens, can you try to do a permutation of the stochastic processes when you define the model? e.g., change model = WN() + MA1() to model = MA(1) + WN().

Does the issue persist?

stefangachter commented 3 years ago

Following example:

> n = 10^4
> model = MA1(theta = .98, sigma2 = .02) + WN(sigma2 = 1)
> Xt = gen_gts(n = n, model = model)
> rank_models(MA1()+WN(), data = Xt, nested = TRUE, model.type = "ts")
Processing model 1 out of 3
**error: Mat::operator(): index out of bounds**
 rank_models(MA1() + WN(), data = Xt, nested = TRUE, model.type = "ts") でエラー: 
  Mat::operator(): index out of bounds
> rank_models(MA1(theta = .98, sigma2 = .02)+WN(sigma2 = 1), data = Xt, nested = TRUE, model.type = "ts")
Processing model 1 out of 3
**error: Mat::operator(): index out of bounds**
 rank_models(MA1(theta = 0.98, sigma2 = 0.02) + WN(sigma2 = 1),  でエラー: 
  Mat::operator(): index out of bounds
> rank_models(WN()+MA1(), data = Xt, nested = TRUE, model.type = "ts")
Processing model 1 out of 3
**error: Col::rows(): indices out of bounds or incorrectly used**
 rank_models(WN() + MA1(), data = Xt, nested = TRUE, model.type = "ts") でエラー: 
  Col::rows(): indices out of bounds or incorrectly used
> rank_models(AR1()+WN(), data = Xt, nested = TRUE, model.type = "ts")
Processing model 1 out of 3
Bootstrapping the covariance matrix... Please stand by.
Processing model 2 out of 3
Processing model 3 out of 3
The model ranking is given as: 
          Obj Fun Optimism Criterion GoF P-Value
1. AR1     0.0284   0.3796    0.4079      0.9078
2. AR1 WN  0.4010   0.3365    0.7376      0.1054
3. WN      0.4006   0.4102    0.8108      0.1857
> 

shows that error occurs independent of permutation or initial values available or not.