forecasting

Package install error: compilation failed

。_饼干妹妹 提交于 2019-12-05 07:22:22
I recently updated R to 3.1.0. I tried to move my packages over to 3.1 inside the R.Framework (I'm running OSX Mavericks) and somehow made a mess of it, so did a complete uninstall of everything before a clean install. When reinstalling packages I had no issues until I hit the forecast package which yields the following error: package ‘forecast’ is available as a source package but not as a binary Warning in install.packages : package ‘forecast’ is not available (for R version 3.1.0) I actually had R 3.1.0 and both forecast and hts working together prior to the reinstall so I suspect the

Forecasting Values are coming same in R

二次信任 提交于 2019-12-05 07:22:03
问题 I have one sample data Sno period year_quarter country city sales_revenue 1 1/1/2009 2009-Q1 Argentina Buenos Aires 3008 2 1/4/2009 2009-Q2 Argentina Buenos Aires 3244 3 1/7/2009 2009-Q3 Argentina Buenos Aires 8000 4 1/10/2009 2009-Q4 Argentina Buenos Aires 8719 5 1/1/2010 2010-Q1 Argentina Buenos Aires 3008 6 1/4/2010 2010-Q2 Argentina Buenos Aires 3244 7 1/7/2010 2010-Q3 Argentina Buenos Aires 78 8 1/10/2010 2010-Q4 Argentina Buenos Aires 7379 9 1/1/2011 2011-Q1 Argentina Buenos Aires 3735

Issues with simulating a seasonal ARIMA model

删除回忆录丶 提交于 2019-12-05 06:44:20
I am trying to generate simulations from a seasonal arima model using the forecast package in R via the following command: simulate(model_temp) where model_temp is the result of applying the arima() function to my observed time series, and with which, incidentally, I specified the model to be an ARIMA(2,1,2)(0,1,2)[12] model. However, when I attempt this, I get the following error: Error in diffinv.vector(x, lag, differences, xi) : NA/NaN/Inf in foreign function call (arg 1) Can anybody please explain why this is the case (and how to avoid this problem)? I should further add, that I know that

statsmodels forecasting using ARMA model

∥☆過路亽.° 提交于 2019-12-04 18:09:22
问题 I want to forecast timeseries data. I read in previous posts that module statsmodels has the required tool for using ARMA method for forecasting which is exactly the one I have been looking for. In spite of that I am having trouble in forecasting the data. Can someone explain the various parameters used in the model and/or provide a sample example? 回答1: The question is very general, for background information Rob Hyndman's link or any text book for time series analysis will be useful. Skipper

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 :

error in stl .series is not periodic

梦想与她 提交于 2019-12-04 16:11:07
I am pretty sure I am missing something which is very simple but still not able to figure out why this error is showing up . The data I have is of every month end data from 2013 Apr to 2014 Mar. Now I want to understand the trend over the 12 months period . xx <- structure(c(41.52, 41.52, 41.52, 41.68, 41.68, 41.68, 41.84, 41.84, 41.84, 42.05, 42.05, 42.05), .Tsp = c(2013.25, 2014.16666666667, 12), class = "ts"); is my time series data . Now when I use stl(xx,s.window ="periodic") I get error : Error in stl(xx, s.window = "periodic") : series is not periodic or has less than two periods i am

Time series prediction of daily data of a month using ARIMA

梦想与她 提交于 2019-12-04 14:54:00
问题 I am working with 30 days (monthly) per cycle and thus have approximately 2 cycles in my historical dataset. R script is, library(forecast) value <- c(117.2 , 224.2 , 258.0 , 292.1 , 400.1 , 509.9 , 626.8 , 722.9 , 826.1 , 883.6,916.6, 1032.1, 1151.2, 1273.4 ,1391.8, 1499.2, 1532.5 ,1565.9 ,1690.9, 1813.6,1961.4 ,2102.8 ,2208.2, 2256.8, 2290.8 ,2413.7, 2569.4 ,2730.3, 2882.9 ,2977.5, 117.2 , 224.2 , 258.0 , 292.1 , 400.1 , 509.9 , 626.8 , 722.9 , 826.1 , 883.6,916.6, 1032.1, 1151.2, 1273.4

JFreechart(Java) - How to draw lines that is partially dashed lines and partially solid lines?

送分小仙女□ 提交于 2019-12-04 11:19:56
I'm going to plot a line chart that will change from solid line to dashed line to to indicate real data and forecasting data. I'm not sure if i need to extend some of the classes like XYLineAndShapeRenderer or something else, or maybe there is some convenient way to achieve this? Here is a demostration graph i plotted using Excel. I am talking about the gray lines in the graph. That is what i want. I don't know if there is a renderer that allow me to indicate which range dashed or solid There are two ways I can think of for doing this. Neither of them are elegant, but that may be the reality

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

What's the gaps for the forecast error metrics: MAPE and WMAPE?

我的梦境 提交于 2019-12-04 10:40:46
I know that MAPE and WMAPE as a forecast error metrics, they have some benefits. But what's the gaps? Someone says: For MAPE: "Combinations with very small or zero volumes can cause large skew in results" And for WMAPE: "Combinations with large weights can skew the results in their favor" I can't understand, can anyone explain the two statements for the weakness of the two metrics? Thanks. For MAPE, Mean absolute percentage error [1], suppose we denote the actual value with A , and predicted value with P . You have a series of data at time 1 thru n, then MAPE = 100/n * ( Sum of |(A(t) - P(t))