holtwinters

Date on the x-axis in Holt-Winters graph R

◇◆丶佛笑我妖孽 提交于 2020-01-16 05:20:09
问题 I am trying to plot the date as the x-axis in a Holt-Winters graph in R. I have searched for this topic on this site and many others with no luck. I am aware of using xaxt="n" and then axis() for most plots. The following code works for a normal plot: plot(date,sold, xaxt="n", main="Quantity Widgets Sold") axis(1,date,format(date,"%d %b", cex.axis=0.7)) so I know the axis function is working properly. However, this approach does not work with the Holt-Winters plot. This is the code I have now

How to identify the best frequency in a time series?

社会主义新天地 提交于 2020-01-13 04:29:47
问题 I have a database metrics grouped by day, and I need to forecast the data for the next 3 months. These data have seasonality, (I believe that the seasonality is by days of the week). I want to use the Holt Winters method using R, I need to create a time series object, which asks for frequency, (That I think is 7). But how can I know if I'm sure? Have a function to identify the best frequency? I'm using: FID_TS <- ts(FID_DataSet$Value, frequency=7) FID_TS_Observed <- HoltWinters(FID_TS) If I

R: applying Holt Winters by group of columns to forecast time series

陌路散爱 提交于 2019-12-10 04:31:57
问题 I have a time series data with a frequency = 7 as follows: combo_1_daily_mini <- read.table(header=TRUE, text=" region_1 region_2 region_3 date incidents USA CA San Francisco 1/1/15 37 USA CA San Francisco 1/2/15 30 USA CA San Francisco 1/3/15 31 USA CA San Francisco 1/4/15 33 USA CA San Francisco 1/5/15 28 USA CA San Francisco 1/6/15 33 USA CA San Francisco 1/7/15 39 USA PA Pittsburg 1/1/15 38 USA PA Pittsburg 1/2/15 35 USA PA Pittsburg 1/3/15 37 USA PA Pittsburg 1/4/15 33 USA PA Pittsburg 1

How to identify the best frequency in a time series?

99封情书 提交于 2019-12-04 17:04:56
I have a database metrics grouped by day, and I need to forecast the data for the next 3 months. These data have seasonality, (I believe that the seasonality is by days of the week). I want to use the Holt Winters method using R, I need to create a time series object, which asks for frequency, (That I think is 7). But how can I know if I'm sure? Have a function to identify the best frequency? I'm using: FID_TS <- ts(FID_DataSet$Value, frequency=7) FID_TS_Observed <- HoltWinters(FID_TS) If I decompose this data with decompose(FID_TS) , I have: And this is my first forecast FID_TS_Observed :

Holt-Winters time series forecasting with statsmodels

半腔热情 提交于 2019-12-04 11:05:46
问题 I tried forecasting with holt-winters model as shown below but I keep getting a prediction that is not consistent with what I expect. I also showed a visualization of the plot Train = Airline[:130] Test = Airline[129:] from statsmodels.tsa.holtwinters import Holt y_hat_avg = Test.copy() fit1 = Holt(np.asarray(Train['Passengers'])).fit() y_hat_avg['Holt_Winter'] = fit1.predict(start=1,end=15) plt.figure(figsize=(16,8)) plt.plot(Train.index, Train['Passengers'], label='Train') plt.plot(Test

Holt-Winters time series forecasting with statsmodels

帅比萌擦擦* 提交于 2019-12-03 07:03:05
I tried forecasting with holt-winters model as shown below but I keep getting a prediction that is not consistent with what I expect. I also showed a visualization of the plot Train = Airline[:130] Test = Airline[129:] from statsmodels.tsa.holtwinters import Holt y_hat_avg = Test.copy() fit1 = Holt(np.asarray(Train['Passengers'])).fit() y_hat_avg['Holt_Winter'] = fit1.predict(start=1,end=15) plt.figure(figsize=(16,8)) plt.plot(Train.index, Train['Passengers'], label='Train') plt.plot(Test.index,Test['Passengers'], label='Test') plt.plot(y_hat_avg.index,y_hat_avg['Holt_Winter'], label='Holt