Skip to content

filter free plotting attempt - #302

Open
thorek1 wants to merge 7 commits into
mainfrom
filter-free-plotting
Open

filter free plotting attempt#302
thorek1 wants to merge 7 commits into
mainfrom
filter-free-plotting

Conversation

@thorek1

@thorek1 thorek1 commented Jun 8, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 8, 2026 21:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a “filter-free plotting” pathway to plot_model_estimates / plot_model_estimates! by allowing callers to provide a pre-specified (latent) shock path and optionally visualize an observation uncertainty band (±σ) around the data.

Changes:

  • Adds filter_free_data_with_model plus supporting helpers in src/get_functions.jl to forward-simulate model paths from a provided shock matrix (and align optional measurement-error standard deviations to the informative sample).
  • Extends plot_model_estimates / plot_model_estimates! (StatsPlots extension) to accept filter_free_shocks, measurement_error_std, and initial_state, including plotting a transparent ribbon for [+σ,-σ] on observed series.
  • Adds a new TEST_SET branch for filter_free_plotting in test/runtests.jl.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
test/runtests.jl Adds a new TEST_SET=filter_free_plotting include path.
src/get_functions.jl Introduces filter-free forward simulation utilities and a data alignment/materialization helper for plotting.
ext/StatsPlotsExt.jl Wires new filter-free plotting inputs into plot_model_estimates/plot_model_estimates! and adds observation ribbon plotting.

Comment thread test/runtests.jl Outdated
Comment on lines +52 to +53
elseif test_set == "filter_free_plotting"
include("test_filter_free_plotting.jl")
Comment thread src/get_functions.jl
algorithm::Symbol = :second_order,
warmup_iterations::Int = DEFAULT_WARMUP_ITERATIONS,
opts::CalculationOptions = merge_calculation_options()) where T <: Real
@assert algorithm ∈ [:first_order, :second_order, :pruned_second_order, :third_order, :pruned_third_order] "`plot_model_estimates` with positional shocks only supports perturbation algorithms (`:first_order`, `:second_order`, `:pruned_second_order`, `:third_order`, `:pruned_third_order`)."
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Benchmark Results

main bb8ca7d... main / bb8ca7d...
FS2000/NSSS 6.33 ± 0.075 μs 6.39 ± 0.073 μs 0.991 ± 0.016
FS2000/covariance 19.5 ± 1 μs 19.6 ± 1.3 μs 0.995 ± 0.083
FS2000/irf 0.0654 ± 0.018 ms 0.066 ± 0.018 ms 0.992 ± 0.39
FS2000/jacobian 1.37 ± 0.063 μs 1.36 ± 0.046 μs 1.01 ± 0.058
FS2000/lyapunov/bartels_stewart 0.103 ± 0.011 ms 0.102 ± 0.011 ms 1.02 ± 0.16
FS2000/lyapunov/bicgstab 26 ± 0.82 μs 25.3 ± 0.84 μs 1.03 ± 0.047
FS2000/lyapunov/doubling 0.0362 ± 0.00092 ms 0.0354 ± 0.00094 ms 1.02 ± 0.038
FS2000/lyapunov/gmres 17 ± 0.21 μs 16.6 ± 0.17 μs 1.02 ± 0.017
FS2000/qme/doubling 0.0962 ± 0.00098 ms 0.096 ± 0.00098 ms 1 ± 0.014
FS2000/qme/schur 0.0451 ± 0.001 ms 0.0451 ± 0.0012 ms 1 ± 0.036
NAWM_EAUS_2008/NSSS 1.1 ± 0.034 ms 1.03 ± 0.022 ms 1.07 ± 0.04
NAWM_EAUS_2008/covariance 3.39 ± 0.5 ms 3.36 ± 0.52 ms 1.01 ± 0.22
NAWM_EAUS_2008/irf 7.39 ± 0.67 ms 7.31 ± 0.68 ms 1.01 ± 0.13
NAWM_EAUS_2008/jacobian 0.0433 ± 0.0044 ms 0.044 ± 0.0049 ms 0.984 ± 0.15
NAWM_EAUS_2008/lyapunov/bartels_stewart 18 ± 1.4 ms 18.1 ± 1.4 ms 0.991 ± 0.11
NAWM_EAUS_2008/lyapunov/bicgstab 0.215 ± 0.00012 s 0.196 ± 8.7e-05 s 1.1 ± 0.00077
NAWM_EAUS_2008/lyapunov/doubling 20.1 ± 0.032 ms 20.2 ± 0.047 ms 0.995 ± 0.0028
NAWM_EAUS_2008/lyapunov/gmres 0.114 ± 0.0015 s 0.114 ± 0.0011 s 0.998 ± 0.016
NAWM_EAUS_2008/qme/doubling 29.4 ± 0.19 ms 29.5 ± 0.2 ms 0.996 ± 0.0092
NAWM_EAUS_2008/qme/schur 17.9 ± 0.098 ms 17.9 ± 0.099 ms 1 ± 0.0078
Smets_Wouters_2007/NSSS 0.207 ± 0.00068 ms 0.0934 ± 0.00041 ms 2.22 ± 0.012
Smets_Wouters_2007/covariance 0.369 ± 0.0075 ms 0.244 ± 0.0052 ms 1.51 ± 0.045
Smets_Wouters_2007/irf 0.585 ± 0.023 ms 0.458 ± 0.022 ms 1.28 ± 0.08
Smets_Wouters_2007/jacobian 11 ± 30 μs 11.3 ± 30 μs 0.976 ± 3.7
Smets_Wouters_2007/lyapunov/bartels_stewart 1.21 ± 0.012 ms 1.25 ± 0.012 ms 0.97 ± 0.013
Smets_Wouters_2007/lyapunov/bicgstab 6.06 ± 0.0085 ms 6.34 ± 0.01 ms 0.956 ± 0.002
Smets_Wouters_2007/lyapunov/doubling 1.02 ± 0.0029 ms 1.03 ± 0.0034 ms 0.999 ± 0.0044
Smets_Wouters_2007/lyapunov/gmres 5.01 ± 0.013 ms 4.99 ± 0.0092 ms 1.01 ± 0.0031
Smets_Wouters_2007/qme/doubling 1.75 ± 0.0073 ms 1.77 ± 0.0089 ms 0.985 ± 0.0064
Smets_Wouters_2007/qme/schur 1.07 ± 0.0081 ms 0.939 ± 0.0072 ms 1.14 ± 0.012
time_to_load 11.9 ± 0.31 s 11.7 ± 0.078 s 1.02 ± 0.028
main bb8ca7d... main / bb8ca7d...
FS2000/NSSS 22 allocs: 0.878 kB 22 allocs: 0.878 kB 1
FS2000/covariance 0.134 k allocs: 17.3 kB 0.134 k allocs: 17.3 kB 1
FS2000/irf 1.07 k allocs: 0.0944 MB 1.07 k allocs: 0.0944 MB 1
FS2000/jacobian 0.046 k allocs: 1.62 kB 0.046 k allocs: 1.62 kB 1
FS2000/lyapunov/bartels_stewart 0.069 k allocs: 0.059 MB 0.069 k allocs: 0.059 MB 1
FS2000/lyapunov/bicgstab 0.038 k allocs: 3.51 kB 0.038 k allocs: 3.51 kB 1
FS2000/lyapunov/doubling 30 allocs: 3.26 kB 30 allocs: 3.26 kB 1
FS2000/lyapunov/gmres 0.034 k allocs: 3.45 kB 0.034 k allocs: 3.45 kB 1
FS2000/qme/doubling 6 allocs: 1.7 kB 6 allocs: 1.7 kB 1
FS2000/qme/schur 9 allocs: 1.95 kB 9 allocs: 1.95 kB 1
NAWM_EAUS_2008/NSSS 0.326 k allocs: 0.669 MB 0.587 k allocs: 0.606 MB 1.1
NAWM_EAUS_2008/covariance 0.87 k allocs: 2.73 MB 1.13 k allocs: 2.66 MB 1.02
NAWM_EAUS_2008/irf 9.92 k allocs: 9.68 MB 10.2 k allocs: 9.62 MB 1.01
NAWM_EAUS_2008/jacobian 0.076 k allocs: 0.714 MB 0.076 k allocs: 0.714 MB 1
NAWM_EAUS_2008/lyapunov/bartels_stewart 0.191 k allocs: 3.9 MB 0.191 k allocs: 3.9 MB 1
NAWM_EAUS_2008/lyapunov/bicgstab 0.276 k allocs: 0.408 MB 0.252 k allocs: 0.408 MB 1
NAWM_EAUS_2008/lyapunov/doubling 0.034 k allocs: 0.404 MB 0.034 k allocs: 0.404 MB 1
NAWM_EAUS_2008/lyapunov/gmres 0.123 k allocs: 0.406 MB 0.123 k allocs: 0.406 MB 1
NAWM_EAUS_2008/qme/doubling 8 allocs: 0.362 MB 8 allocs: 0.362 MB 1
NAWM_EAUS_2008/qme/schur 12 allocs: 0.365 MB 12 allocs: 0.365 MB 1
Smets_Wouters_2007/NSSS 0.122 k allocs: 3.64 kB 0.191 k allocs: 4.61 kB 0.788
Smets_Wouters_2007/covariance 0.338 k allocs: 0.189 MB 0.407 k allocs: 0.19 MB 0.995
Smets_Wouters_2007/irf 3.41 k allocs: 0.919 MB 3.48 k allocs: 0.92 MB 0.999
Smets_Wouters_2007/jacobian 0.059 k allocs: 0.0636 MB 0.059 k allocs: 0.0636 MB 1
Smets_Wouters_2007/lyapunov/bartels_stewart 0.094 k allocs: 0.36 MB 0.094 k allocs: 0.36 MB 1
Smets_Wouters_2007/lyapunov/bicgstab 0.158 k allocs: 0.036 MB 0.164 k allocs: 0.0361 MB 0.997
Smets_Wouters_2007/lyapunov/doubling 0.034 k allocs: 0.034 MB 0.034 k allocs: 0.034 MB 1
Smets_Wouters_2007/lyapunov/gmres 0.098 k allocs: 0.0351 MB 0.098 k allocs: 0.0351 MB 1
Smets_Wouters_2007/qme/doubling 8 allocs: 0.0317 MB 8 allocs: 0.0317 MB 1
Smets_Wouters_2007/qme/schur 11 allocs: 0.0325 MB 11 allocs: 0.0325 MB 1
time_to_load 0.143 k allocs: 10.6 kB 0.143 k allocs: 10.6 kB 1

Benchmark Plots

A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.
Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

@codecov-commenter

codecov-commenter commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.57827% with 114 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.39%. Comparing base (4bc8749) to head (bb8ca7d).
⚠️ Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
src/get_functions.jl 44.73% 105 Missing ⚠️
ext/StatsPlotsExt.jl 92.68% 9 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #302       +/-   ##
===========================================
+ Coverage   52.91%   87.39%   +34.47%     
===========================================
  Files          35       35               
  Lines       29720    30738     +1018     
===========================================
+ Hits        15727    26863    +11136     
+ Misses      13993     3875    -10118     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

3 participants