gmwm
gmwm copied to clipboard
Guessing issue with White Noise
Issue:
@HaotianXu discovered a bug on the WN() guessing feature:
Using:
N = 80 # dyadic length of time series
J = floor(log(N,2))
H = 1000 # number of simulations
dist.gmwm = rep(NA,H)
dist.gmwm.robust = rep(NA,H)
dist.gmwm.guess = rep(NA,H)
dist.gmwm.robust.guess = rep(NA,H)
for(k in 1:H){
x.star = rnorm(N,0,1)
classic = gmwm(WN(), x.star, robust=FALSE)
robust = gmwm(WN(), x.star, robust=TRUE)
dist.gmwm[k] = classic$obj.fun
dist.gmwm.robust[k] = robust$obj.fun # the empirical distribution of robust test statistic under the null
dist.gmwm.guess[k] = classic$init.guess
dist.gmwm.robust.guess[k] = robust$init.guess # the empirical distribution of robust test statistic under the null
}
hist(dist.gmwm, nclass=100)
hist(dist.gmwm.robust, nclass=100)
sum(dist.gmwm.robust>0.6)/H
The guesses look like:
Solution:
Temporarily use exact values e.g. WN(sigma2 = 1).... This gives a distribution that looks like:
Main issue: Figure out a better guessing algorithm?