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

Estimation stability #135

Open robertomolinari opened 8 years ago

robertomolinari commented 8 years ago

Apparently the GMWM (gmwm.imu()) slighlty changes estimates for the same dataset when changing R sessions. I guess it's due to the guessing algorithm but it would be good to find a seed for the same dataset in some way (maybe use round(mean_(x)_10^6)).

coatless commented 8 years ago

A seed is already set (1337) each time gmwm runs.

Can you give me an example to test this on?

coatless commented 8 years ago

Was the order of components changed (e.g. 2_AR1() + WN() vs. WN() + 2_AR()?) If so, then that is #116

robertomolinari commented 8 years ago

That’s what I thought ! But I made some simulations yesterday and saved them which were centred around the estimated values from the navchip x-gyro but today some of them weren’t centred around those values. Here is the code.

data(navchip) mod = gmwm.imu(2*AR1() + QN() + WN() + RW() + DR(), navchip[,1], G = 100000) theta = mod$estimate

I used the theta as a true parameter vector for the simulations.

coatless commented 8 years ago

Okay so, this is what I am running:

library("gmwm")
library("imudata")

data(navchip)
mod = gmwm.imu(2*AR1() + QN() + WN() + RW() + DR(), navchip[,1], G = 100000)
theta = mod$estimate
theta

Session 1:

Estimates
AR1 9.998112e-01
SIGMA2 3.052557e-12
AR1 9.968367e-01
SIGMA2 2.851506e-11
QN 1.683605e-06
WN 5.259098e-07
RW 8.965226e-13
DR 4.055885e-09

Session 2:

Estimates
AR1 9.998112e-01
SIGMA2 3.052557e-12
AR1 9.968367e-01
SIGMA2 2.851506e-11
QN 1.683605e-06
WN 5.259098e-07
RW 8.965226e-13
DR 4.055885e-09

I cannot get a difference between sessions.

Is the gmwm on the machine v2.0?

e.g. can you see:

Loading required package: ggplot2
Version: 2.0.0 (CURRENT) built on 2016-02-09
Check for updates and report bugs at https://github.com/SMAC-Group/gmwm
To see the user guides use browseVignettes("gmwm").
coatless commented 8 years ago

The main difference I can think of running one without G = 100000.

robertomolinari commented 8 years ago

No worries mate, I get the same results. There must have been somethings that I missed out in the simulations (although I can’t think what it is!).

Thanks again!

robertomolinari commented 8 years ago

On my personal mac (as opposed to my office windows computer yesterday) , I get the following results for theta

      Estimates

AR1 9.998828e-01 SIGMA2 2.360300e-12 AR1 9.973796e-01 SIGMA2 2.683056e-11 QN 1.683395e-06 WN 5.267967e-07 RW 7.055343e-13 DR 4.132465e-09

There must be a difference between versions then (although I downloaded the package from CRAN last week).

robertomolinari commented 8 years ago

This is what I have on my RStudio console

R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" Copyright (C) 2015 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin13.4.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

library(gmwm) Loading required package: ggplot2 Version: 2.0.0 (CURRENT) built on 2016-02-09 Check for updates and report bugs at https://github.com/SMAC-Group/gmwm To see the user guides use browseVignettes("gmwm”).

coatless commented 8 years ago

Seems to be a cross-platform issue between Windows and OS X.

coatless commented 8 years ago

Done on OS X 10.11 w/ R 3.2.2

Estimates
AR1 9.998272e-01
SIGMA2 2.784271e-12
AR1 9.969223e-01
SIGMA2 2.872704e-11
QN 1.684623e-06
WN 5.246664e-07
RW 8.592465e-13
DR 4.083377e-09