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

Fix seasonality extension. #15

Merged
merged 1 commit into from Sep 2, 2019
Merged

Conversation

tjphilpot
Copy link
Contributor

This can append too many months to the seasonalities. In the case of 'Monthly' data, config['output_size'] is 18, config['seasonality'] is 12. If seasonalities_stacked.shape[1] is 72, start_seasonality_ext is 60, so line 89 appends 12 seasonalities, rather than 6 (as in the C++ dynet code).

 //if prediction horizon is larger than seasonality, so we need to repeat some of the seasonality factors
                if (OUTPUT_SIZE_I > SEASONALITY) {
                    unsigned long startSeasonalityIndx = season_exVect.size() - SEASONALITY;
                    for (int i = 0; i < (OUTPUT_SIZE_I - SEASONALITY); i++)
                        season_exVect.push_back(season_exVect[startSeasonalityIndx + i]);
                }

This becomes a problem on line 126 where we select the last config['output_size'], which will select the wrong output_size elements. In the case above, the seasonalities will be shifted by 6 months (18 - 12 = 6).

This can append too many months to the seasonalities. In the case of 'Monthly' data, `config['output_size']` is 18, `config['seasonality']` is 12. If `seasonalities_stacked.shape[1]` is 72, `start_seasonality_ext` is 60, so line 89 appends 12 seasonalities, rather than 6 (as in the C++ dynet code).

```C++
 //if prediction horizon is larger than seasonality, so we need to repeat some of the seasonality factors
                if (OUTPUT_SIZE_I > SEASONALITY) {
                    unsigned long startSeasonalityIndx = season_exVect.size() - SEASONALITY;
                    for (int i = 0; i < (OUTPUT_SIZE_I - SEASONALITY); i++)
                        season_exVect.push_back(season_exVect[startSeasonalityIndx + i]);
                }
```

This becomes a problem on line 126 where we select the last `config['output_size']`, which will select the wrong `output_size` elements. In the case above, the seasonalities will be shifted by 6 months (18 - 12 = 6).
@damitkwr damitkwr merged commit 918d192 into damitkwr:master Sep 2, 2019
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

Successfully merging this pull request may close these issues.

None yet

2 participants