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

Data vs fit results #333

Open
stefanocovino opened this issue Feb 10, 2025 · 4 comments
Open

Data vs fit results #333

stefanocovino opened this issue Feb 10, 2025 · 4 comments

Comments

@stefanocovino
Copy link

Dear friends,

I apologize for the trivial question.

In this package, what is the best way to compare input data and fit results? For instance, to obtain the residuals shown in the diagnostic plots.

Thanks a lot,
Stefano

@raphaelsaavedra
Copy link
Member

I haven't looked at this in a while, but I believe if you have a naive model you can either call model.residuals or call get_standard_residuals(model) which will return the standardized residuals (normalized by variance). If you have a non-standard model or just a filter you can get instead get the innovations (i.e. filter residuals) using get_standard_residuals(filter_output). See

get_standard_residuals(fo::FilterOutput) = get_standard_innovations(fo)

@stefanocovino
Copy link
Author

stefanocovino commented Feb 10, 2025 via email

@stefanocovino
Copy link
Author

stefanocovino commented Feb 10, 2025 via email

@raphaelsaavedra
Copy link
Member

I think what you mean by scale of innovations is that get_standard_residuals (which calls get_standard_innovations) standardizes the innovations? If you want the raw innovations you can call get_innovations on the filter output. I suggest taking a look at the code in StateSpaceModels.jl/src/kalman_filter_and_smoother.jl where these operations are used.

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