[R] HoltWinters() fitted values

R. Michael Weylandt michael.weylandt at gmail.com
Fri Apr 27 13:51:18 CEST 2012


HoltWinters doesn't give fitted values for the entire time series
since, like most time series models, there's a "recursive" element to
it. I.e., if a very simple model is X_t = 1/2*(X_{t-1} + X_{t-2}) +
epsilon, you need to take X_0, X_1 as is to "start" the series.

If you run example(HoltWinters) you'll note that the red lines have
roughly one period's (I think that's the right term) less points
because those are needed to set up seasonality.

You can change the model to something simpler to get earlier fits, but
to the best of my understanding, you can't get them all the way to the
beginning with HoltWinters smoothing.

Michael

On Thu, Apr 26, 2012 at 5:57 PM, slipkid90515
<jessica.lyn.olsen at gmail.com> wrote:
> Hi everyone,
>
> I'm using the HoltWinters() function to do a time series analysis.  The
> function only returns the back fitted values ($fitted) after the first year
> of data, which is my case, is a little more than half.  However, when I use
> the plot() function, it plots the back fit for almost the entire data set.
>
> Any ideas on how to extract the fitted values going all the way back to the
> start of the data set?
>
> Thanks,
> Jess
>
> --
> View this message in context: http://r.789695.n4.nabble.com/HoltWinters-fitted-values-tp4591103p4591103.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list