#
# Generate simulated example
#
x <- tvar2sim()
#
# Work out which wavelet is best for forecasting this series
#
# Note: to speed up I also do:
# library("parallel")
# options(mc.cores=4) # You have a four core machine, eg
# tmp <- which.wavelet.best(x, lapplyfn=mclapply)
#
# Note2: The following command can take a few minutes to run, even on
# a fairly recent (2013) machine. You can speed it up by using
# parallel execution as noted above, or by reducing go.back or
# by reducing n.to.test, and also shortening the time series x to
# more recent values. However, you need to be careful if you shorten
# x too much then you are not basing the best wavelet decision on the
# right time series. Similarly, by reducing go.back you are not
# insuring your answer across runs across many internal forecasts.
#
if (FALSE) tmp <- which.wavelet.best(x)
#
# Print out what the result was:
#
if (FALSE) print(tmp)
# filter.number family mse min.mse
#1 1 DaubExPhase 0.2139173 <- Min MSE
#2 2 DaubExPhase 0.5040532
#3 3 DaubExPhase 0.4064091
#4 4 DaubExPhase 0.3077695
#5 5 DaubExPhase 0.3706422
#6 6 DaubExPhase 0.6617254
#7 7 DaubExPhase 0.5477581
#8 8 DaubExPhase 0.6881407
#9 9 DaubExPhase 0.5514298
#10 10 DaubExPhase 0.5551846
#11 4 DaubLeAsymm 0.3134285
#12 5 DaubLeAsymm 0.3910101
#13 6 DaubLeAsymm 0.7480980
#14 7 DaubLeAsymm 0.5700830
#15 8 DaubLeAsymm 0.5661297
#16 9 DaubLeAsymm 0.5689345
#17 10 DaubLeAsymm 0.5580267
Run the code above in your browser using DataLab