forecasting

Time series prediction using R

不羁岁月 提交于 2019-12-03 03:18:44
I have the following R code library(forecast) value <- c(1.2, 1.7, 1.6, 1.2, 1.6, 1.3, 1.5, 1.9, 5.4, 4.2, 5.5, 6, 5.6, 6.2, 6.8, 7.1, 7.1, 5.8, 0, 5.2, 4.6, 3.6, 3, 3.8, 3.1, 3.4, 2, 3.1, 3.2, 1.6, 0.6, 3.3, 4.9, 6.5, 5.3, 3.5, 5.3, 7.2, 7.4, 7.3, 7.2, 4, 6.1, 4.3, 4, 2.4, 0.4, 2.4) sensor<-ts(value,frequency=24) fit <- auto.arima(sensor) LH.pred<-predict(fit,n.ahead=24) plot(sensor,ylim=c(0,10),xlim=c(0,5),type="o", lwd="1") lines(LH.pred$pred,col="red",type="o",lwd="1") grid() The resulting graph is But I am not satisfied with the prediction. Is there any way to make the prediction look

How to handle Shift in Forecasted value

断了今生、忘了曾经 提交于 2019-12-02 21:04:19
I implemented a forecasting model using LSTM in Keras. The dataset is 15mints seperated and I am forecasting for 12 future steps. The model performs good for the problem. But there is a small problem with the forecast made. It is showing a small shift effect. To get a more clear picture see the below attached figure. How to handle this problem.? How the data must be transformed to handle this kind of issue.? The model I used is given below init_lstm = RandomUniform(minval=-.05, maxval=.05) init_dense_1 = RandomUniform(minval=-.03, maxval=.06) model = Sequential() model.add(LSTM(15, input_shape

How to use tf.contrib.seq2seq.Helper for non-embedding data?

廉价感情. 提交于 2019-12-02 19:42:33
I'm trying to use tf.contrib.seq2seq module to do forecasting on some data (just float32 vectors) but all the examples I found using the seq2seq module from TensorFlow are used for translation and therefore embeddings. I'm struggling to understand exactly what tf.contrib.seq2seq.Helper is doing for the Seq2Seq architecture and how I can use the CustomHelper in my case. This is what I've done for now: import tensorflow as tf from tensorflow.python.layers import core as layers_core input_seq_len = 15 # Sequence length as input input_dim = 1 # Nb of features in input output_seq_len = forecast_len

Explaining the forecasts from an ARIMA model

回眸只為那壹抹淺笑 提交于 2019-12-02 15:59:55
I am trying to explain to myself the forecasting result from applying an ARIMA model to a time-series dataset. The data is from the M1-Competition, the series is MNB65. I am trying to fit the data to an ARIMA(1,0,0) model and get the forecasts. I am using R. Here are some output snippets: > arima(x, order = c(1,0,0)) Series: x ARIMA(1,0,0) with non-zero mean Call: arima(x = x, order = c(1, 0, 0)) Coefficients: ar1 intercept 0.9421 12260.298 s.e. 0.0474 202.717 > predict(arima(x, order = c(1,0,0)), n.ahead=12) $pred Time Series: Start = 53 End = 64 Frequency = 1 [1] 11757.39 11786.50 11813.92

How can I get highcharter to represent a forecast object?

余生颓废 提交于 2019-12-02 13:16:59
问题 This is a follow-on to this question. I am trying to get the pipeline given in that question to accept a forecast object as input: Again, using this data: > dput(t) structure(c(2, 2, 267822980, 325286564, 66697091, 239352431, 94380295, 1, 126621669, 158555699, 32951026, 23, 108000151, 132505189, 29587564, 120381505, 25106680, 117506099, 22868767, 115940080, 22878163, 119286731, 22881061), .Dim = c(23L, 1L), index = structure(c(1490990400, 1490994000, 1490997600, 1491001200, 1491004800,

How can I predict memory usage and time based on historical values

蓝咒 提交于 2019-12-02 06:07:56
A maths problem really I think... I have some historical data for some spreadsheet outputs along with the number of rows and columns. What I'd like to do is use this data to predict the peak memory usage and time taken based on the - known - row and columns. So, if no historical data exists then there will be no predictions. 1 or 2 historical values will be very inaccurate but I hope that given a wide enough variety of historical values, then a reasonably-accurate prediction could be made? I've got a table on a jsfiddle. Any help or ideas would be really appreciated. I don't really know where

How to specify minimum or maximum possible values in a forecast?

断了今生、忘了曾经 提交于 2019-12-02 00:11:54
Is there a way to specify minimum or maximum possible values in a forecast done with ETS/ARIMA models? Such as when forecasting a trend in % that can only go between 0% and 100%. I am using R package forecast (and function forecast ). 李哲源 If your time series y has a natural bound [a, b] , you should take a "logit-alike" transform first: f <- function (x, a, b) log((x - a) / (b - x)) yy <- f(y, a, b) Then the resulting yy is unbounded on (-Inf, Inf) , suitable for Gaussian error assumption. Use yy for time series modelling, and take back-transform later on the prediction / forecast: finv <-

skflow regression predict multiple values

被刻印的时光 ゝ 提交于 2019-12-01 16:53:57
问题 I'm trying to forecast a time series: given 50 previous values, I want to predict the 5 next values. To do so, I'm using the skflow package (based on TensorFlow), and this problem is relatively close to the Boston example provided in the Github repo. My code is as follows : %matplotlib inline import pandas as pd import skflow from sklearn import cross_validation, metrics from sklearn import preprocessing filepath = 'CSV/FILE.csv' ts = pd.Series.from_csv(filepath) nprev = 50 deltasuiv = 5 def

Error when trying to use stl and decompose functions in R

风流意气都作罢 提交于 2019-12-01 15:13:53
I have made a simple time-series, i added a little noise to a sin function and tried to decompose it using the "stl" and "decompose" function in R, while my series definitely has more than 2 period and is periodic, R gives me the following error for both functions: x [1] 1.4537365796 2.7185844368 2.8394728999 3.8926989923 4.3405508086 5.1959080871 [7] 5.6602505790 5.4829985648 5.6357660330 4.6084976233 4.6617322922 4.0286486832 [13] 3.3641752333 1.7408063182 0.8815147612 0.2895139342 -0.5402768515 -1.5612641107 [19] -2.1584502547 -2.9878043526 -3.5545638149 -4.0530074199 -4.0748538612 -4

Error when trying to use stl and decompose functions in R

吃可爱长大的小学妹 提交于 2019-12-01 14:07:02
问题 I have made a simple time-series, i added a little noise to a sin function and tried to decompose it using the "stl" and "decompose" function in R, while my series definitely has more than 2 period and is periodic, R gives me the following error for both functions: x [1] 1.4537365796 2.7185844368 2.8394728999 3.8926989923 4.3405508086 5.1959080871 [7] 5.6602505790 5.4829985648 5.6357660330 4.6084976233 4.6617322922 4.0286486832 [13] 3.3641752333 1.7408063182 0.8815147612 0.2895139342 -0