forecasting

Random but predictable number generator? [C++]

不打扰是莪最后的温柔 提交于 2019-12-12 12:29:25
问题 Well I don't really know how to search for the thing I'm looking for. Google gives tons of results, but none which match my criteria. So I'm asking it here: Is there any known piece of code that can create a number, that is predictable, looks random, and is based on a 'seed' (in my case it's the unix timestamp) and between a specified range? I want to be able to create weather forecast in a script for a game I'm coding (but I need the C++ code which I can port, I don't think many people here

Python Statsmodels: Using SARIMAX with exogenous regressors to get predicted mean and confidence intervals

强颜欢笑 提交于 2019-12-12 10:34:30
问题 I'm using statsmodels.tsa.SARIMAX() to train a model with exogenous variables. Is there an equivalent of get_prediction() when a model is trained with exogenous variables so that the object returned contains the predicted mean and confidence interval rather than just an array of predicted mean results? The predict() and forecast() methods take exogenous variables, but only return the predicted mean value. SARIMA_model = sm.tsa.SARIMAX(endog=y_train.astype('float64'), exog=ExogenousFeature

R Forecasting with as.POSIXlt/ct

你离开我真会死。 提交于 2019-12-12 09:54:39
问题 Good day I read on one of the posts here that "the function forecast::plot.forecast is not designed to be used with axis.Date or axis.POSIXct (which are not used in the package forecast)." This can be seen here:custom axis labels plotting a forecast in R Nevertheless, they managed to use the forecast package and some code to get the correct axis labels. However, this example is for quarterly data. Also, this example here using 'as.POSIXlt' is for weekly data: Forecasting time series data I've

Gaussian Process scikit-learn - Exception

我只是一个虾纸丫 提交于 2019-12-12 07:59:39
问题 I want to use Gaussian Processes to solve a regression task. My data is as follow : each X vector has a length of 37, and each Y vector has a length of 8. I'm using the sklearn package in Python but trying to use gaussian processes leads to an Exception : from sklearn import gaussian_process print "x :", x__ print "y :", y__ gp = gaussian_process.GaussianProcess(theta0=1e-2, thetaL=1e-4, thetaU=1e-1) gp.fit(x__, y__) x : [[ 136. 137. 137. 132. 130. 130. 132. 133. 134. 135. 135. 134. 134. 1139

Weather prediction algorithm variety

泄露秘密 提交于 2019-12-12 07:31:05
问题 Currently there's a big 'storm' over the predictions by the MetOffice in the UK. They predicted a mild, wet winter, while we have the coldest temperature on record in Northern Ireland and solid snow on the ground, normally rare in December. It's something I'd love to have a play with, not that I'm claiming I can beat them, but was wondering what algorithms are out there currently that people are working with? What datasets do they base it on? Possibilities presumably include neural networks

Having a lot of issues with time series objects in R

久未见 提交于 2019-12-12 03:26:11
问题 I am having an extraordinarily difficult time dealing with -any- time series objects of some budget data. The original data is 14,460 rows of payments on ~1800 contracts, where each row has a DD/MM/YYYY and Amount feature. There are 5296 days between 1/1/2000 and 12/31/2014, but only 3133 of these days actually had payments. The days are therefore irregularly spaced, with more than one contract payment showing up on some days, and zero payments on others. The main issue I'm having is the

How to export multivariate forecast results from R to excel

白昼怎懂夜的黑 提交于 2019-12-12 03:06:27
问题 I'm terribly new with R, so I apologize if there's a way to do this using a slight variation of an existing code/package. I've created yearly forecasts of a variable (student enrollment) for 129 countries using the predict command, and then i have them binded. I've done this because I'm forecasting using a multivariate regression. Here's what I'm doing (if this helps) `fm1=lm(log(y+1)~Var.Ind) XNew=data.frame(Var.Ind) (rse<-summary(fit)$sigma(fm1)* df.residual(fm1))/2 rse<-summary(fm1)$sigma

MASE Extraction Hierarchical Data ('hts' and 'forecast' packages R)

半城伤御伤魂 提交于 2019-12-12 01:57:56
问题 I would like to extract the MASE (Hyndman et al., 2006) from the accuracy function ('forecast' package) in R. I have 17 time series with the following hierarchical structure: nodes <- list(2, c(7,7)) hierarchical <- hts(matrix_tseries, nodes, bnames = colnames_bottom, characters = c(1,1)) , where 'matrix_tseries' is a matrix that stores the 17 series. I have then calculated the forecasts for each series and would like to extract the assessment metrics for the desired horizon: fcast <-

Moving window forecasting with Python

走远了吗. 提交于 2019-12-12 01:27:09
问题 I am looking to create some code that will out-of-sample forecast the HAR-RV model. The model itself is formulated as the following, and the betas are estimated through HAC-OLS or Newey-West. Where weekly and monthly are 5 and 22 daily averages of the daily RV, but if you're interested read more about it here. So I have all the data and parameters ready in pandas dataframes. I now wish to forecast on moving windows so that I can obtain a time series that will show me how the entire period

How to forecast time series, including a seasonality factor in R

谁说胖子不能爱 提交于 2019-12-11 17:46:45
问题 I have the following sample data: library(data.table) dt <- data.table('time' = c(1:10), 'units'= c(89496264,81820040,80960072,109164545,96226255,96270421,95694992,117509717,105134778,0)) I would like to make a forecast for the units at time = 10 . I can see that at time = 4*k , where k = 1,2,... there is a big increase of units, and I would like to include that as a seasonality factor. How could I do that in R ? I have looked into the auto.arima but it seems that is it not the way to go.