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

Model components don't add up #56

Open
tronsgaard opened this issue May 17, 2021 · 1 comment
Open

Model components don't add up #56

tronsgaard opened this issue May 17, 2021 · 1 comment
Assignees
Labels
documentation Issue related to the documentation

Comments

@tronsgaard
Copy link
Contributor

Thanks for this great piece of software! I have noticed something that I would like to bring up here. When I do this:

model, components = results.rv.evaluate(inst, return_components=True)

the components don't always add up to the model, which I naïvely would expect.

After some digging, I understand what happens: The function selects a random set of samples, then it evaluates the model and the components for each sample, and finally it computes the median of all the samples at each time point. The median is computed separately for the full model and the individual components, meaning that e.g. the output for the "trend" component will not necessarily correspond to the trend component included in the full model. In other words, the median is not a linear operator.

Of couse, this behavior is not necessarily wrong, but it could lead to unexpected results when subtracting e.g. the trend component from the full model (it did for me). My first suggestion is to explain this to the user in the docstring. My second suggestion is to do some sort of "argmedian" on the full model, such that the component values at each time would correspond to the same model, but that probably comes with its own problems.

This is related to issue #40, suggesting an option to return the actual model samples, which would allow the user to handle this the way he/she prefers. That might be the best solution!

@nespinoza
Copy link
Owner

Hi @tronsgaard,

Thanks a ton for this feedback. I do think returning the samples for the user to take care of this is the best solution --- will take this out there, but will leave this open as your docstring suggestion is definitely needed in here!

Thanks again for using juliet and doing these suggestions!

Néstor

@nespinoza nespinoza added the documentation Issue related to the documentation label May 25, 2021
@nespinoza nespinoza self-assigned this May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issue related to the documentation
Projects
None yet
Development

No branches or pull requests

2 participants