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

compare.gmwm #199

Open philippcla opened 8 years ago

philippcla commented 8 years ago

Hello, I am using this awesome function: compare.gmwm(estimated_model_one, estimated_model_two, estimated_model_three, split = FALSE)

Unfortunately this line of code gives me an error, as I can only provide 2 models at a time. Would it be possible to have an unlimited number of models as input?

Thanks Philipp

Wenchao-Yang commented 8 years ago

The new feature will be in the github very soon. I will let you know when it's ready.

philippcla commented 8 years ago

perfect thx

coatless commented 8 years ago

The output will look slightly different than the present compare.gmwm() version.

coatless commented 8 years ago

@Wenchao-Yang : I need the feature to be PR'd before next week. The package needs to be updated on CRAN with the new developments.

coatless commented 7 years ago

@philippcla:

Check out:

compare_models(estimated_model_one, estimated_model_two, estimated_model_three)

in the latest development build.

philippcla commented 7 years ago

Hello, The option "split = FALSE" does nomore exist in the "compare_models" How do I plot several models on the same plot? It is related to the issue #200, where I wanted to plot several models on one plot withouth the huge legend

thx

coatless commented 7 years ago

We actually merged this feature into compare_models() slightly. The lower diagonal of compare_models() mimics the split = FALSE view of two models. We found that anything more than two models became too noisy and was very problematic to interpret especially if the scales between models differed. Furthermore, the key aspect of the comparison was how the implied WV differed. This difference is captured in the upper triangular section of the matrix. Meanwhile, on the diagonal, we have the classic GMWM model plot.

As a result, I'm hesitant to resurrect the old plot. But, let me know.

library('gmwm')
#> Loading required package: ggplot2
set.seed(8836)
x1 = gen_gts(1000, AR1(phi = .1, sigma2 = 1) + AR1(phi = 0.95, sigma2 = .1))
x2 = gen_gts(2000, AR1(phi = .1, sigma2 = 1) + AR1(phi = 0.95, sigma2 = .1))

GMWM1 = gmwm(AR1(), data = x1)
GMWM2 = gmwm(2*AR1(), data = x2)

compare_models(GMWM1, GMWM2, show.theo.wv = T, transparence = 0.2, 
               facet.label = c('model1', 'model2'))

philippcla commented 7 years ago

Hello I see your point for the "over-plotting" and then there is too much info on the graph, ok. But this should be left to the user to decide if he want's to keep an unreadable plot. Could we not have an extra bool in the function, so that I could choose the upper right or lower left figure to be plotted alone. The lower left plot is nice to show the differences but the CI are a must. So there is less need for the upper right plot. Could we have a bool in the function allowing to plot just the lower left plot? Or is there another way to just have the lower left plot for the moment?

Cheers