Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One step forecasting #28

Open
smejiame opened this issue Jul 28, 2020 · 2 comments
Open

One step forecasting #28

smejiame opened this issue Jul 28, 2020 · 2 comments

Comments

@smejiame
Copy link

Hello Petronio,

I am testing the fuzzy time series model to forecast one period ahead of a time series with order 12. I am starting with a basic model: using a 20-grid partitioner, mf = triangle, chen model.

My code is:
ts = datos['y'].dropna().to_numpy()
fs = Grid.GridPartitioner(data = ts, npart = 20)
model = chen.ConventionalFTS(partitioner = fs)
model.fit(ts, order = 15)
forecast = model.predict(ts)

I'm getting a forecast array which length = len(ts), I have checked other posts, and I realized that the result is the one-step ahead forecast for each period, i.e. forecast[0] is the prediction that compares with ts[1] , forecast[1] is the prediction that compares with ts[2]...

My question here is: how I am getting a result in the first 12 values, since my model's order is 12?

These are the first 12 values that I am getting:

[0.3270031616601807,
0.3270031616601807,
0.3270031616601807,
0.3270031616601807,
0.09897023952868034,
0.3270031616601807,
0.3270031616601807,
0.09897023952868034,
-0.28108463069048684,
-0.2810846306904869,
0.09897023952868034,
0.3270031616601807,
...]

Thanks for the help

@petroniocandido
Copy link
Collaborator

Hi @smejiame !

Sorry for the long delay. Well... Order 12? Are you sure that this is really needed? The training process will be very long and the final model will be huge! In the greater majority of cases, 3 lags are enough to detect more complex patterns. Pay attention to the 'lags' parameter, where you can inform which the lag indexes [if they are different from the last 3 lags, for example]

BUT if you really want a 12th order model, so you input data must have at least 12 items [one for each order of the model]. Do you check if your input is correct?

Best regards

@smejiame
Copy link
Author

smejiame commented Aug 4, 2020

Actually, the order 12 is because the seasonality, so you are right in the sense that it is better toinform the lag indexes (1, 6, and 12 in my case).
The size of my input data is above 3.000 observations, so the question is not about the length since it is enough, the question is: why I am getting a prediction in the first 12 observations? for example, observation #5, should use observation 4, observation -1 and observation -7, so, If I compare it with an ARIMA: in an ARIMA, I will get predictions for observation #13, and so on, not for the first 12 predictions, but in this case, I am getting predictions for the first observations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants