Hi Phani,
something like this looks promising:
#
library(forecast)
library(Mcomp)
MAPE.for.Holt <- function (x,series,bignum=10e6) {
foo <-
try(ets(series$x,model="AAN",damped=FALSE,alpha=x[1],beta=x[2],restrict=FALSE),silent=TRUE)
if ( class(f
Hey,
Thanks for the tip Stephan. But you could tell me how to pass the series to
the function calling ets?
Initially I planned to do it this way:
wrapper<-function(x)
{
alpha<-x[1]
beta<-x[2]
ph<-x[3]
series<-x[4]
foofit<-ets(series,model="AZZ",alpha=alpha,beta=beta,phi=phi,additive.only=T,opt.cri
Hi Phani,
to get the best Holt's model, I would simply wrap a suitable function
calling ets() within optim() and optimize for alpha and beta - the
values given by ets() without constraints would probably be good
starting values, but you had better start the optimization with a
variety of star
3 matches
Mail list logo