forecasting

Forecasting future occurrences with Random Forest

北城以北 提交于 2020-01-25 04:14:06
问题 I'm currently exploring the use of Random Forests to predict future values of occurrences (my ARIMA model gave me really bad forecasting so I'm trying to evaluate other options). I'm fully aware that the bad results might be due to the fact that I don't have a lot of data and the quality isn't the greatest. My initial data consisted simply of the number of occurrences per date. I then added separate columns representing the day, month, year, day of the week (which was later one-hot encoded)

Forecasting for DCC Copula GARCH model in R

巧了我就是萌 提交于 2020-01-16 07:32:15
问题 I'm trying to forecast the Copula Garch Model. I have tried to use the dccforecast function with the cGARCHfit but it turns out to be error saying that there is no applicable method for 'dccforecast' applied to an object of class cGARCHfit. So how do actually we forecast the dcc copula garch model? I have the following reproducible code. library(zoo) library(rugarch) library(rmgarch) data("EuStockMarkets") EuStockLevel <- as.zoo(EuStockMarkets)[,c("DAX","CAC","FTSE")] EuStockRet <- diff(log

R Arima works but Python statsmodels SARIMAX throws invertibility error

混江龙づ霸主 提交于 2020-01-14 09:02:46
问题 I am comparing SARIMAX fitting results between R (3.3.1) forecast package (7.3) and Python's (3.5.2) statsmodels (0.8). The R-code is: library(forecast) data("AirPassengers") Arima(AirPassengers, order=c(2,1,1), seasonal=list(order=c(0,1,0), period=12))$aic [1] 1017.848 The Python code is: from statsmodels.tsa.statespace import sarimax import pandas as pd AirlinePassengers = pd.Series([112,118,132,129,121,135,148,148,136,119,104,118,115,126, 141,135,125,149,170,170,158,133,114,140,145,150,178

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

Same values for ARIMA forecasts in R

痴心易碎 提交于 2020-01-06 07:59:11
问题 I am trying to do forecasting of stock prices in R using ARIMA. I am using the auto.arima function to fit my model. Every time I'm trying to do that I get the same value for the forecasted values. I tried using different stocks but the same thing happens in every case. Here I tried forecasting apple prices: arimapple <- ts(appletrain, start = timedata[1]) fitappletrain <- auto.arima(arimapple) fitappletrain forecastapple <- forecast(fitappletrain, h=57) forecastapple and the output that I get

in R Forecasted values

旧巷老猫 提交于 2020-01-05 07:37:08
问题 I have few questions regarding the forecast time series model in R. The forecast values which i got for this is:: Want to take these values: 40,60,67,80,87 as the percentage values. So, How to consider Y-axis of the plot in percenatge YrTimeSeries <- c(40,60,67,80,87); tsValue<-ts(YrTimeSeries,frequency=1,start=2006) library(forecast) (forecast(tsValue,h=5)) Point Forecast Lo 80 Hi 80 Lo 95 Hi 95 2011 86.9993 72.19680 101.8018 64.36083 109.6378 2012 86.9993 66.06645 107.9321 54.98528 119.0133

Role of frequency parameter in ts

前提是你 提交于 2020-01-04 02:35:31
问题 How does the ts() function use its frequency parameter? What is the effect of assigning wrong values as frequency ? I am trying to use 1.5 years of website usage data to build a time series model so that I can forecast the usage for coming periods. I am using data at daily level. What should be the frequency here - 7 or 365 or 365.25? 回答1: The frequency is "the" period at which seasonal cycles repeat. I use "the" in scare quotes since, of course, there are often multiple cycles in time series

How to get top down forecasts using `hts::combinef()`?

﹥>﹥吖頭↗ 提交于 2020-01-03 05:45:06
问题 I am trying to compare forecast reconciliation methods from the hts package on previously existing forecasts. The forecast.gts function is not available to me since there is no computationally tractable way to create a user defined function that returns the values in a forecast object. Because of this, I am using the combinef() function in the package to redistribute the forecasts. I have been able to work of the proper weights to get the wls and nseries methods, and the ols version is the

Training an LSTM neural network to forecast time series in pybrain, python

…衆ロ難τιáo~ 提交于 2020-01-02 23:15:35
问题 I have a neural network created using PyBrain and designed to forecast time series. I am using the sequential dataset function, and trying to use a sliding window of 5 previous values to predict the 6th. One of my problems is that I can't figure out how to create the required dataset by appending the 5 previous values to the inputs and the 6th as an output. I am also unsure of how exactly to forecast values in the series once the network is trained. Posting my code below: from pybrain

error in stl, series has less than two periods (erroneous?)

不打扰是莪最后的温柔 提交于 2020-01-02 09:39:35
问题 I have two years of monthly data but stl() seems to need a minimum of two years and one month . Here are two simple examples: Example 1 - returns Error in stl(x, "periodic") : series is not periodic or has less than two periods dat_24 <- cumsum(rnorm(24)) x_24 <- ts(dat_24, frequency = 12) stl(x_24, "periodic") Example 2 - returns forecast as expected dat_25 <- cumsum(rnorm(25)) x_25 <- ts(dat_25, frequency = 12) stl(x_25, "periodic") Shouldn't I be able to get a forecast with only 24 numbers