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

Weights from the OMEGA-matrix #185

Open philippcla opened 8 years ago

philippcla commented 8 years ago

Hello,

The OMEGA-matrix gives me the weights on the different scales, that is ok. Normally, all the scales are considered with a specific weight.

Is there some way to modify the values of the matrix for a specific scale? Let's say: I do not want the GMWM to take the first scale into account (for whatever reasons: esthetic, physical principles not conisdered, other unknown noises...). the original is:

my_gmwm = gmwm(my_personal_model, my_data)

This would become (if I had 6 scales, which I will change the weight to zero for the first and the last scale, the others are untouched):

my_gmwm = gmwm(my_personal_model, my_data, weights = [0 1 1 1 1 0])

Thanks

coatless commented 8 years ago

This would be a bit problematic currently as the system to initially calculate the gmwm is closed off.

The best that can be done in terms of specifying your own omega matrix is to initially calculate using gmwm() procedure, modify the gmwm object via V (matrix before inversion) found in the parameter list, and then use update.gmwm() to perform the estimation.

The caveat here is that V must be a diagonal matrix (if not, the program will make it diagonal before the inverse).

So, something along the lines of:

# Generate some data
set.seed(1336)
n = 200
exact.model = AR1(phi=.99, sigma2 = 0.01) + WN(sigma2=1)
data = gen.gts(exact.model)

# Create an initial model that is not accurate
throwaway = gmwm(AR1(), data = data)

# Create a diagonal matrix of dimensions 9 x 9 (1 on diagonal)
# Need 9 scales due to J = floor(log2(n))
throwaway$orgV = diag(9)

# The orgV matrix MUST be diagonal! If it is not diagonal, the program will make it diagonal (major)

# Models can contain specific parameters e.g.
updated.model = update(throwaway, exact.model)
philippcla commented 8 years ago

Ok, just to be clear: I do not want to change the scales or the weights, I just want to turn ON or turn OFF a scale. For the rest I completely agree: the gmwm should stay completely closed off.

coatless commented 8 years ago

Gotcha. There is no way to really turn on and off scales.

I'll think about the best way to approach it and get back to you.