forecasting

Make prediction for each group differently

瘦欲@ 提交于 2021-02-05 06:41:09
问题 I have dataset that looks like this: Category Weekly_Date a b <chr> <date> <dbl> <dbl> 1 aa 2018-07-01 36.6 1.4 2 aa 2018-07-02 5.30 0 3 bb 2018-07-01 4.62 1.2 4 bb 2018-07-02 3.71 1.5 5 cc 2018-07-01 3.41 12 ... ... ... ... ... I fitted linear regression for each group separately: fit_linreg <- train %>% group_by(Category) %>% do(model = lm(Target ~ Unit_price + Unit_discount, data = .)) Now I have different models for each category: aa model1 bb model2 cc model3 So, I need to apply each

ARMA.predict for out-of sample forecast does not work with floating points?

让人想犯罪 __ 提交于 2021-02-01 04:59:20
问题 After i developed my little ARMAX-forecasting model for in-sample analysis i´d like to predict some data out of sample. The time series i use for forecasting calculation starts at 2013-01-01 and ends at 2013-12-31! Here is my data I am working with: hr = np.loadtxt("Data_2013_17.txt") index = date_range(start='2013-1-1', end='2013-12-31', freq='D') df = pd.DataFrame(hr, index=index) holidays = ['2013-1-1', '2013-3-29', '2013-4-1', '2013-5-1', '2013-5-9', '2013-5-20', '2013-10-3', '2013-12-25'

rlang, fpp3 R package: Error: `vars` must be a character vector upon calling aggregate_key()

只愿长相守 提交于 2021-01-29 19:17:21
问题 I'm working through the Hyndman fpp3 package based on this markdown document. https://github.com/robjhyndman/ISI_Workshop_2019/blob/master/5_reconciliation/reconciliation.Rmd I just couldn't find out why the following code fail to run library(fpp3) PBS %>% aggregate_key(ATC1/ATC2, Scripts = sum(Scripts)) %>% filter(Month == yearmonth("1991 Jul")) %>% print(n=18) I keep receiving the following error each time I run the above. New names: * `` -> ...1 * `` -> ...2 * `` -> ...3 * `` -> ...4 * ``

How does one redistribute a calculated total across a range of dates in Power BI?

耗尽温柔 提交于 2021-01-29 07:07:19
问题 My firm is trying to forecast what the business landscape will look like after the current resource shortages (mainly labor, in our instance) return to normal. To that end, I have made a report that I want to use to show how our business forecasting needs to change relative to the length of time that we are accumulating backlogged orders that we cannot fill. In the image you can see the original projection forecast one both the line graph and the table. Forecast 2020 = CALCULATE(SUM(Orders[+5

R - predicting simple dyn model with one lag term

可紊 提交于 2021-01-29 04:21:15
问题 I'm trying to predict a simple lagged time series regression with the dyn library in R. This question was a helpful starting point, but I'm getting some weird behaviour that I'm hoping someone can explain. Here's a minimum working example. library(dyn) # Initial data y.orig <- arima.sim(model=list(ar=c(.9)),n=10) x1.orig <- rnorm(10) data <- cbind(y=y.orig, x1=x1.orig) # This model, with a single lag term, predicts from t=2 mod1 <- dyn$lm(y ~ lag(y, -1), data) y.new <- window(y.orig, end=end

Converting zoo object into a weekly time series

牧云@^-^@ 提交于 2021-01-07 02:48:26
问题 I am working on building a time series in R programming language. I m having a zoo object which is follows: I 'd like to convert this into a weekly time series data for analysis and typed in the following code tt2<-as.ts(zz,freq=365.25/7,start=decimal_date(ymd("2018-01-01"))) tt2[is.na(tt2)]<-0 However, I get the following output: Time Series: Start = 17538 End = 18532 Frequency = 0.142857142857143 While I'd like to see the output in line with something like this: Time Series: Start = c(2018

Converting zoo object into a weekly time series

冷暖自知 提交于 2021-01-07 02:46:03
问题 I am working on building a time series in R programming language. I m having a zoo object which is follows: I 'd like to convert this into a weekly time series data for analysis and typed in the following code tt2<-as.ts(zz,freq=365.25/7,start=decimal_date(ymd("2018-01-01"))) tt2[is.na(tt2)]<-0 However, I get the following output: Time Series: Start = 17538 End = 18532 Frequency = 0.142857142857143 While I'd like to see the output in line with something like this: Time Series: Start = c(2018

Generating long-term forecasts including prophet and temporal aggregation (thief)

懵懂的女人 提交于 2020-12-15 04:55:04
问题 I just started to use {fable} and the {tidyverts} family of tools and so far it's going quite well. I'm currently interested in producing long term probabilistic forecasts from daily data (with a monthly or quarterly resolution being fine or preferred). My understanding is, that temporal aggregation could help reduce model uncertainty and also propagate known daily influences (especially holiday effects) to the e.g. quarterly level and improve accuracy that way. For the daily data I plan on

Generating long-term forecasts including prophet and temporal aggregation (thief)

旧时模样 提交于 2020-12-15 04:54:13
问题 I just started to use {fable} and the {tidyverts} family of tools and so far it's going quite well. I'm currently interested in producing long term probabilistic forecasts from daily data (with a monthly or quarterly resolution being fine or preferred). My understanding is, that temporal aggregation could help reduce model uncertainty and also propagate known daily influences (especially holiday effects) to the e.g. quarterly level and improve accuracy that way. For the daily data I plan on

Time Series Forecasting using Support Vector Machine (SVM) in R

余生长醉 提交于 2020-12-01 07:25:25
问题 I've tried searching but couldn't find a specific answer to this question. So far I'm able to realize that Time Series Forecasting is possible using SVM. I've gone through a few papers/articles who've performed the same but didn't mention any code, instead explained the algorithm (which I didn't quite understand). And some have done it using python. My problem here is that: I have a company data(say univariate) of sales from 2010 to 2017. And I need to forecast the sales value for 2018 using