i posted a similar, but more confusion question already. I have a weekly timeseries so far, which looks like this (pls ignore the red line):

enter image description here

My original data is (e.g.):

index  y
1    9657
2    3693
3    18063

I decided to run linear regression for this timeseries. Where I am using the previous Index as features (e.g.):

index y    y1    y2
1    9657  nan   nan
2   3693   9657  nan
3   18063  3693  9657

My idea is to only forecast the next period (one step ahead), so I always know y1,y2. My first question: 1. Is it allowed to use linear regression for this approche, cause I am using not indepented variables?

After I runned linear regression I was quite unsatisfied with the results, and as you can see from the figure it is not really a stationar timeseries, so i log my full data, basically all y values: y=log(y) and on top I changed every y (also including the y) to y= y-yprev, which should make the data even more smooth (so y = y-y1,y1=y1-y2, y2 remove). Then I used the first 70 entries to train and the last 30 to test (My full prediction line(also on the training set) looks like this: enter image description here

This looks quite ok now, I would try to use it. But

2. How can i convert the y_pred back to the original data size?

3. Does it makes sense at all?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.