Skip to content

feat: add em estimator and kf smoother - #135

Merged
gabrielfrasantos merged 1 commit into
mainfrom
feature/add-em-estimator
Apr 4, 2026
Merged

gabrielfrasantos merged 1 commit into
mainfrom
feature/add-em-estimator

Conversation

@gabrielfrasantos

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

✅⚠️MegaLinter analysis: Success with warnings

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 6 0 0 0.06s
✅ CPP clang-format 277 4 0 0 1.26s
✅ CPP cppcheck 277 0 0 10.66s
✅ DOCKERFILE hadolint 1 0 0 0.06s
✅ JSON jsonlint 8 0 0 0.34s
✅ JSON prettier 8 8 0 0 0.68s
⚠️ MARKDOWN markdownlint 60 1 69 0 2.64s
✅ MARKDOWN markdown-table-formatter 60 20 0 0 0.35s
⚠️ SPELL lychee 170 28 0 2.06s
✅ YAML prettier 13 6 0 0 0.77s
✅ YAML yamllint 13 0 0 0.66s

Detailed Issues

⚠️ SPELL / lychee - 28 errors
[ERROR] https://gitlab-ci-token/ | Network error: error sending request for url (https://gitlab-ci-token/) Maybe a certificate error?
[IGNORED] url.https://github.com/.insteadOf | Unsupported: Error creating request client: builder error for url (url.https://github.com/.insteadOf)
[ERROR] file://doc/filters/controllers/Pid.md | Cannot find file
[ERROR] file://doc/filters/solvers/DiscreteAlgebraicRiccatiEquation.md | Cannot find file
[ERROR] file://doc/filters/controllers/Lqr.md | Cannot find file
[ERROR] file://doc/math/Geometry3D.md | Cannot find file
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/2 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/7 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/6 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/18 | Network error: Not Found
[ERROR] file://doc/optimizer/Optimizer.md | Cannot find file
[ERROR] file://doc/losses/Loss.md | Cannot find file
[ERROR] file://estimators/LinearRegression.md | Cannot find file
[ERROR] file://doc/NeuralNetwork.md | Cannot find file
[ERROR] file://estimators/LinearRegression.md | Cannot find file
[ERROR] file://doc/model/Model.md | Cannot find file
[ERROR] file://doc/losses/Loss.md | Cannot find file
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/1 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/15 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/24 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/13 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/3 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/12 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/9 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/26 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/4 | Network error: Not Found
[403] https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$ | Network error: Forbidden
[403] https://developer.arm.com/documentation/dui0473/latest | Network error: Forbidden
[403] https://developer.arm.com/documentation/100166/latest/ | Network error: Forbidden
📝 Summary
---------------------
🔍 Total..........231
✅ Successful.....194
⏳ Timeouts.........0
🔀 Redirected.......0
👻 Excluded.........8
❓ Unknown..........0
🚫 Errors..........28

Errors in CHANGELOG.md
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/9 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/6 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/2 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/3 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/26 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/4 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/15 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/18 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/7 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/13 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/1 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/24 | Network error: Not Found
[404] https://github.com/embedded-pro/embedded-numerical-toolbox/issues/12 | Network error: Not Found

Errors in doc/filters/active/KalmanFilter.md
[ERROR] file://doc/filters/controllers/Lqr.md | Cannot find file
[ERROR] file://doc/filters/controllers/Pid.md | Cannot find file
[ERROR] file://doc/filters/solvers/DiscreteAlgebraicRiccatiEquation.md | Cannot find file

Errors in doc/regularization/Regularization.md
[ERROR] file://doc/losses/Loss.md | Cannot find file
[ERROR] file://estimators/LinearRegression.md | Cannot find file
[ERROR] file://doc/optimizer/Optimizer.md | Cannot find file

Errors in doc/optimization/Optimizer.md
[ERROR] file://estimators/LinearRegression.md | Cannot find file
[ERROR] file://doc/model/Model.md | Cannot find file
[ERROR] file://doc/NeuralNetwork.md | Cannot find file
[ERROR] file://doc/losses/Loss.md | Cannot find file

Errors in .github/workflows/static-analysis.yml
[403] https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$ | Network error: Forbidden

Errors in doc/kinematics/ForwardKinematics.md
[ERROR] file://doc/math/Geometry3D.md | Cannot find file

Errors in .gitlab-ci.yml
[ERROR] https://gitlab-ci-token/ | Network error: error sending request for url (https://gitlab-ci-token/) Maybe a certificate error?

Errors in doc/performance-optimization/README.md
[403] https://developer.arm.com/documentation/100166/latest/ | Network error: Forbidden
[403] https://developer.arm.com/documentation/dui0473/latest | Network error: Forbidden
⚠️ MARKDOWN / markdownlint - 69 errors
.github/agents/executor.agent.md:11:401 error MD013/line-length Line length [Expected: 400; Actual: 459]
.github/agents/executor.agent.md:11 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the executor agent for..."]
.github/agents/orchestrator.agent.md:18 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the orchestrator agent..."]
.github/agents/planner.agent.md:11:401 error MD013/line-length Line length [Expected: 400; Actual: 458]
.github/agents/planner.agent.md:11 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the planner agent for ..."]
.github/agents/reviewer.agent.md:14:401 error MD013/line-length Line length [Expected: 400; Actual: 456]
.github/agents/reviewer.agent.md:14 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the reviewer agent for..."]
.github/prompts/orchestrate.prompt.md:8:401 error MD013/line-length Line length [Expected: 400; Actual: 496]
.github/prompts/orchestrate.prompt.md:8 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "Analyze the following task for..."]
CHANGELOG.md:29 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:45 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Bug Fixes"]
doc/analysis/PowerDensitySpectrum.md:5:401 error MD013/line-length Line length [Expected: 400; Actual: 509]
doc/analysis/PowerDensitySpectrum.md:104:20 error MD056/table-column-count Table column count [Expected: 2; Actual: 6; Too many cells, extra data will be missing]
doc/analysis/PowerDensitySpectrum.md:104:17 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/analysis/PowerDensitySpectrum.md:104:20 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/analysis/PowerDensitySpectrum.md:104:32 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/analysis/PowerDensitySpectrum.md:104:38 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/analysis/PowerDensitySpectrum.md:104:45 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/analysis/PowerDensitySpectrum.md:104:135 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/control_analysis/FrequencyResponse.md:5:401 error MD013/line-length Line length [Expected: 400; Actual: 469]
doc/control_analysis/RootLocus.md:69 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
doc/control_analysis/RootLocus.md:113:13 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
doc/control_analysis/RootLocus.md:113:27 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
doc/control_analysis/RootLocus.md:113:1 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
doc/control_analysis/RootLocus.md:113:13 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
doc/estimators/ExpectationMaximization.md:37:12 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
doc/estimators/ExpectationMaximization.md:37:23 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
doc/estimators/ExpectationMaximization.md:37:37 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
doc/estimators/ExpectationMaximization.md:37:1 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
doc/estimators/ExpectationMaximization.md:37:12 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
doc/estimators/ExpectationMaximization.md:37:23 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
doc/estimators/ExpectationMaximization.md:104:103 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/estimators/README.md:9:68 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/estimators/README.md:9:142 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/estimators/README.md:10:68 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/estimators/README.md:10:142 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/estimators/README.md:11:68 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/estimators/README.md:11:144 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/filters/active/KalmanSmoother.md:5:401 error MD013/line-length Line length [Expected: 400; Actual: 421]
doc/filters/active/KalmanSmoother.md:111:28 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/filters/active/KalmanSmoother.md:111:61 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/filters/active/KalmanSmoother.md:111:110 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/filters/active/KalmanSmoother.md:122:19 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/filters/active/KalmanSmoother.md:122:27 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/filters/active/KalmanSmoother.md:122:67 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/filters/active/KalmanSmoother.md:123:19 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/filters/active/KalmanSmoother.md:123:27 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/filters/active/KalmanSmoother.md:123:67 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/filters/active/KalmanSmoother.md:124:19 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/filters/active/KalmanSmoother.md:124:27 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/filters/active/KalmanSmoother.md:124:67 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/filters/active/KalmanSmoother.md:125:19 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/filters/active/KalmanSmoother.md:125:27 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/filters/active/KalmanSmoother.md:125:67 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/filters/active/UnscentedKalmanFilter.md:11:401 error MD013/line-length Line length [Expected: 400; Actual: 468]
doc/filters/README.md:16:145 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/neural_network/model/Model.md:147:63 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/neural_network/model/Model.md:147:156 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/neural_network/model/Model.md:148:60 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/neural_network/model/Model.md:148:153 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/regularization/Regularization.md:100:32 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/regularization/Regularization.md:100:135 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
doc/windowing/window.md:5:401 error MD013/line-length Line length [Expected: 400; Actual: 415]
README.md:1 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "[![Quality Gate Status](https:..."]
README.md:9:401 error MD013/line-length Line length [Expected: 400; Actual: 442]
README.md:19:142 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
README.md:20:142 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
README.md:23:147 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
README.md:28:140 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@9.4.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,CPP_CPPCHECK,CPP_CLANG_FORMAT,DOCKERFILE_HADOLINT,JSON_JSONLINT,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,SPELL_LYCHEE,YAML_PRETTIER,YAML_YAMLLINT

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

Comment on lines +36 to +40
| Quantity | Notation | Description |
|----------|----------|-------------|
| $\hat{x}_{t\|T}$ | `smoothedMeans[t]` | Smoothed state mean |
| $P_{t\|T}$ | `smoothedCovariances[t]` | Smoothed state covariance |
| $P_{t,t-1\|T}$ | `lagCrossCovariances[t]` | Lag-1 cross-covariance (index 0 undefined) |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[MegaLinter] reported by reviewdog 🐶

Suggested change
| Quantity | Notation | Description |
|----------|----------|-------------|
| $\hat{x}_{t\|T}$ | `smoothedMeans[t]` | Smoothed state mean |
| $P_{t\|T}$ | `smoothedCovariances[t]` | Smoothed state covariance |
| $P_{t,t-1\|T}$ | `lagCrossCovariances[t]` | Lag-1 cross-covariance (index 0 undefined) |
| Quantity | Notation | Description |
|------------------|--------------------------|--------------------------------------------|
| $\hat{x}_{t\|T}$ | `smoothedMeans[t]` | Smoothed state mean |
| $P_{t\|T}$ | `smoothedCovariances[t]` | Smoothed state covariance |
| $P_{t,t-1\|T}$ | `lagCrossCovariances[t]` | Lag-1 cross-covariance (index 0 undefined) |

Comment on lines +102 to +104
| Case | Time per iteration | Space (stack) | Notes |
|-------|-----------------------|------------------------|-------|
| All | $O(T \cdot N^3)$ | $O(T \cdot N^2)$ | Dominated by RTS smoother forward/backward |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[MegaLinter] reported by reviewdog 🐶

Suggested change
| Case | Time per iteration | Space (stack) | Notes |
|-------|-----------------------|------------------------|-------|
| All | $O(T \cdot N^3)$ | $O(T \cdot N^2)$ | Dominated by RTS smoother forward/backward |
| Case | Time per iteration | Space (stack) | Notes |
|------|--------------------|------------------|--------------------------------------------|
| All | $O(T \cdot N^3)$ | $O(T \cdot N^2)$ | Dominated by RTS smoother forward/backward |

Comment thread doc/estimators/README.md
Comment on lines +7 to +11
| Algorithm | Description |
|-------------------------------------------------------------------|-------------------------------------------------------------------------|
| [Linear Regression](LinearRegression.md) | Ordinary least-squares regression using the normal equation |
| [Yule-Walker](YuleWalker.md) | Autoregressive model parameter estimation via the Yule-Walker equations |
| [Expectation-Maximization](ExpectationMaximization.md) | EM algorithm for Kalman filter parameter identification (Shumway-Stoffer) |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[MegaLinter] reported by reviewdog 🐶

Suggested change
| Algorithm | Description |
|-------------------------------------------------------------------|-------------------------------------------------------------------------|
| [Linear Regression](LinearRegression.md) | Ordinary least-squares regression using the normal equation |
| [Yule-Walker](YuleWalker.md) | Autoregressive model parameter estimation via the Yule-Walker equations |
| [Expectation-Maximization](ExpectationMaximization.md) | EM algorithm for Kalman filter parameter identification (Shumway-Stoffer) |
| Algorithm | Description |
|--------------------------------------------------------|---------------------------------------------------------------------------|
| [Linear Regression](LinearRegression.md) | Ordinary least-squares regression using the normal equation |
| [Yule-Walker](YuleWalker.md) | Autoregressive model parameter estimation via the Yule-Walker equations |
| [Expectation-Maximization](ExpectationMaximization.md) | EM algorithm for Kalman filter parameter identification (Shumway-Stoffer) |

Comment on lines +109 to +111
| Case | Time | Space | Notes |
|-------|----------------|--------------------------------|-------------------------------|
| All | $O(T \cdot N^3)$ | $O(T \cdot N^2)$ stack | Dominant cost: $N\times N$ solves at each step |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[MegaLinter] reported by reviewdog 🐶

Suggested change
| Case | Time | Space | Notes |
|-------|----------------|--------------------------------|-------------------------------|
| All | $O(T \cdot N^3)$ | $O(T \cdot N^2)$ stack | Dominant cost: $N\times N$ solves at each step |
| Case | Time | Space | Notes |
|------|------------------|------------------------|------------------------------------------------|
| All | $O(T \cdot N^3)$ | $O(T \cdot N^2)$ stack | Dominant cost: $N\times N$ solves at each step |

Comment on lines +122 to +125
|-----|-----------|-------|--------|------------------|-----------|
| 0 | 1.0 | 2.0 | 0.500 | 0.250 | 0.500 |
| 1 | 0.600 | 1.600 | 0.375 | 0.363 | 0.375 |
| 2 | 0.475 | 1.475 | 0.322 | 0.620 | 0.322 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[MegaLinter] reported by reviewdog 🐶

Suggested change
|-----|-----------|-------|--------|------------------|-----------|
| 0 | 1.0 | 2.0 | 0.500 | 0.250 | 0.500 |
| 1 | 0.600 | 1.600 | 0.375 | 0.363 | 0.375 |
| 2 | 0.475 | 1.475 | 0.322 | 0.620 | 0.322 |
|-----|------------|-------|-------|------------------|------------|
| 0 | 1.0 | 2.0 | 0.500 | 0.250 | 0.500 |
| 1 | 0.600 | 1.600 | 0.375 | 0.363 | 0.375 |
| 2 | 0.475 | 1.475 | 0.322 | 0.620 | 0.322 |

Comment thread doc/filters/README.md

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[MegaLinter] reported by reviewdog 🐶

| Algorithm | Description |
|------------------------------------------------------------|--------------------------------------------------------------------------|
| [Kalman Filter](active/KalmanFilter.md) | Optimal recursive state estimator for linear systems with Gaussian noise |
| [Extended Kalman Filter](active/ExtendedKalmanFilter.md) | Nonlinear state estimator using first-order linearization (Jacobians) |
| [Unscented Kalman Filter](active/UnscentedKalmanFilter.md) | Nonlinear state estimator using sigma points; no Jacobians required |

@sonarqubecloud

sonarqubecloud Bot commented Apr 4, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds offline estimation capabilities by introducing an RTS Kalman smoother (with lag-1 cross-covariance + log-likelihood) and an Expectation-Maximization (EM) estimator that uses the smoother as its E-step, along with tests, build integration, and documentation.

Changes:

  • Added filters::KalmanSmoother (RTS smoother) with log-likelihood computation and lag-1 cross-covariances for EM.
  • Added estimators::ExpectationMaximization for batch identification of linear Gaussian state-space parameters.
  • Integrated new modules into CMake, added unit tests, and documented both algorithms under doc/.

Reviewed changes

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

Show a summary per file
File Description
numerical/filters/active/KalmanSmoother.hpp New RTS smoother implementation (forward KF pass + backward RTS pass + lag cross-cov + log-likelihood).
numerical/filters/active/KalmanSmoother.cpp Coverage-build explicit instantiations for KalmanSmoother.
numerical/filters/active/CMakeLists.txt Wires smoother into the active filters target + coverage sources.
numerical/filters/active/test/TestKalmanSmoother.cpp Adds unit tests for log-likelihood, lag cross-covariances, and covariance reduction properties.
numerical/filters/active/test/CMakeLists.txt Adds the new smoother test to the active filters test target.
numerical/estimators/offline/ExpectationMaximization.hpp New EM estimator implementation that runs the RTS smoother (E-step) and closed-form M-step updates.
numerical/estimators/offline/ExpectationMaximization.cpp Coverage-build explicit instantiations for ExpectationMaximization.
numerical/estimators/offline/CMakeLists.txt Wires EM into offline estimators target and links to numerical.filters.active.
numerical/estimators/offline/test/TestExpectationMaximization.cpp Adds EM behavior tests (likelihood improvement, symmetry/positivity sanity checks, monotonicity tolerance).
numerical/estimators/offline/test/CMakeLists.txt Adds the new EM test to the offline estimators test target.
doc/filters/README.md Adds Kalman Smoother to the filters documentation index.
doc/filters/active/KalmanSmoother.md New algorithm documentation for the RTS smoother (template-compliant sections).
doc/estimators/README.md Adds EM to offline estimators documentation index (and adjusts table formatting).
doc/estimators/ExpectationMaximization.md New algorithm documentation for EM parameter identification (template-compliant sections).

@@ -0,0 +1,110 @@
#include "numerical/filters/active/KalmanFilter.hpp"
#include "numerical/filters/active/KalmanSmoother.hpp"

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

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

This test uses std::array (e.g., observations, filteredVar) but does not include <array>, relying on transitive includes from production headers. Add #include <array> here to make the test self-contained and avoid brittle build breaks when includes change.

Suggested change
#include "numerical/filters/active/KalmanSmoother.hpp"
#include "numerical/filters/active/KalmanSmoother.hpp"
#include <array>

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,147 @@
#include "numerical/estimators/offline/ExpectationMaximization.hpp"

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

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

This test uses std::array for observations but does not include <array>, which makes the file depend on transitive includes. Add #include <array> so the test is self-contained.

Suggested change
#include "numerical/estimators/offline/ExpectationMaximization.hpp"
#include "numerical/estimators/offline/ExpectationMaximization.hpp"
#include <array>

Copilot uses AI. Check for mistakes.
@gabrielfrasantos
gabrielfrasantos merged commit b33bfe6 into main Apr 4, 2026
13 checks passed
@gabrielfrasantos
gabrielfrasantos deleted the feature/add-em-estimator branch April 4, 2026 12:02
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.

feat: add EM Algorithm for KF calibration

2 participants