简体   繁体   中英

Predict function in forecast.holtwinters function

I am looking at forecast package HoltWinters method code from this link (for code understanding purpose). I couldn't find which "R" source file has this predict function defined in to look at source code. Can some one please help me on how can trace this function to a specific source code file?

 pred <- predict(object,n.ahead=h,prediction.interval=TRUE,level=level[1]/100)

Any help would be appreciated.

It is not exported, but you can find it using the ::: operator:

forecast:::predict.HoltWinters
# function (object, n.ahead = 1, newxreg = NULL, se.fit = TRUE, ...)
#   ....
forecast<- HoltWinters(datatimeseries, beta=FALSE, gamma=FALSE)



>forecast:-

Holt-Winters exponential smoothing without trend and without seasonal component.

Call:
HoltWinters(x = datatimeseries, beta = FALSE, gamma = FALSE)

Smoothing parameters:
 alpha: 0.02412151
 beta : FALSE
 gamma: FALSE

Coefficients:
      [,1]
a 24.67819

Try this, It works for me...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM