简体   繁体   English

Forecast.holtwinters函数中的预测函数

[英]Predict function in forecast.holtwinters function

I am looking at forecast package HoltWinters method code from this link (for code understanding purpose). 我正在从此链接查看forecastHoltWinters方法代码(出于理解代码的目的)。 I couldn't find which "R" source file has this predict function defined in to look at source code. 我找不到哪个“ R”源文件已定义此predict函数来查看源代码。 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... 试试这个,对我有用...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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