moon-kalman

Production-ready MoonBit state estimation, smoothing, and sensor fusion library

kalman
filter
state-space
sensor-fusion
ekf
ukf
smoothing
moon add Lyllyl789/moon-kalman@0.2.0
Download zip
Author
Version
0.2.0
License
Apache-2.0
Last updated
11 hours ago
Downloads
2
README

#moon-kalman

moon-kalman 是面向 MoonBit 的状态空间、卡尔曼滤波和传感器融合库,参加的是 2026 年 8 月官方 MoonBit 黑客松验收项目。

#能力范围

核心滤波器已经是可运行实现,不是接口存根:

  • Kalman1D:标量预测、控制输入、缺失观测、NIS 门限、批处理和自适应过程噪声。
  • KalmanND:稠密矩阵状态空间模型、Joseph 协方差更新、部分观测、NIS 门限、控制矩阵、检查点和恢复。
  • EKF / UKF:非线性状态转移、雅可比或 sigma 点、缺失观测、门限和诊断统计。
  • 线性代数:矩阵运算、LU/部分选主元求解、逆、Cholesky、QR、最小二乘、特征值和条件数估计。
  • 传感器工程:多传感器融合、异常值降权、数据质量审计、时间同步、校准、健康监控、有限轨迹缓存和运行时遥测。
  • 估计后处理:RTS 全平滑、固定时滞平滑、信号处理、误差/一致性指标、模型选择、估计器集成和确定性回放。

所有可变数组和矩阵的公开访问器都会返回副本;输入维度、非有限数、奇异创新协方差和缺失观测都有明确结果,不通过异常退出掩盖错误。

#最小示例

let filter = @kalman.Kalman1D::new(0.0, 1.0, 0.02, 0.1)
filter.set_gate_threshold(9.210340371976184)
filter.predict_without_control()
let result = filter.update_if_valid(1.0)
println("result=\{result}, state=\{filter.state()}, variance=\{filter.uncertainty()}")

可直接运行仓库中的示例:

moon run examples/sensor_fusion

#验证与基准

当前测试套件包含 120 个测试,覆盖矩阵边界、奇异/退化协方差、空输入、维度错误、非有限输入、门限拒绝、丢包、回放、运行时健康状态、轨迹和传感器运行时。生产 .mbt 源码规模超过 8,000 行,测试代码另行统计并持续扩充。

发布构建基准入口:

moon run --target native --release benchmarks

基准使用确定性输入并打印校验和,完整三次运行记录见 benchmarks/RESULTS.md。基准不是理论峰值,而是在 Windows、AMD Ryzen 7 5800H、MoonBit stable 0.1.20260814 上实测的本地结果。

#CI 与发布

.github/workflows/test.yml 在 Ubuntu、macOS 和 Windows 上安装官方 stable 工具链,执行:

moon version --all moon update moon check --target all --deny-warn moon test --target all --deny-warn moon fmt && git diff --exit-code moon info && git diff --exit-code

另有 native 覆盖率测试和手动触发的 Mooncakes 发布 workflow。发布不把 token 写入仓库,CI 仅从 GitHub Actions secret 读取 MOONCAKES_TOKEN

项目完成情况和逐项验收证据见 AUGUST_HACKATHON_ACCEPTANCE.md

#
AdaptiveNoiseController

pub struct AdaptiveNoiseController {
process_scale : Double
measurement_scale : Double
minimum_scale : Double
maximum_scale : Double
target_nis : Double
learning_rate : Double
}

#
AdaptiveNoiseController::measurement_scale

fn AdaptiveNoiseController::measurement_scale(self : AdaptiveNoiseController) -> Double

#
AdaptiveNoiseController::new

fn AdaptiveNoiseController::new(minimum_scale : Double, maximum_scale : Double, target_nis : Double, learning_rate : Double) -> AdaptiveNoiseController

#
AdaptiveNoiseController::observe

fn AdaptiveNoiseController::observe(self : AdaptiveNoiseController, nis : Double) -> Unit

#
AdaptiveNoiseController::process_scale

fn AdaptiveNoiseController::process_scale(self : AdaptiveNoiseController) -> Double

#
BatchGate

pub struct BatchGate {
policy : ResidualPolicy
inspected : Int
accepted : Int
downweighted : Int
rejected : Int
}

A small batch gate that turns individual residual decisions into one packet-level decision and exposes a stable covariance inflation factor.

#
BatchGate::accepted

fn BatchGate::accepted(self : BatchGate) -> Int

#
BatchGate::downweighted

fn BatchGate::downweighted(self : BatchGate) -> Int

#
BatchGate::inflation

fn BatchGate::inflation(self : BatchGate) -> Double

#
BatchGate::inspect

fn BatchGate::inspect(self : BatchGate, residual : Array[Double]) -> ResidualAction

#
BatchGate::inspected

fn BatchGate::inspected(self : BatchGate) -> Int

#
BatchGate::new

fn BatchGate::new(policy : ResidualPolicy) -> BatchGate

#
BatchGate::rejected

fn BatchGate::rejected(self : BatchGate) -> Int

#
BatchGate::reset

fn BatchGate::reset(self : BatchGate) -> Unit

#
CalibrationTransform

pub struct CalibrationTransform {
offset : Array[Double]
scale : Array[Double]
}

Affine calibration transform applied component-wise to raw readings.

#
CalibrationTransform::apply

fn CalibrationTransform::apply(self : CalibrationTransform, values : Array[Double]) -> Array[Double]

#
CalibrationTransform::dimension

fn CalibrationTransform::dimension(self : CalibrationTransform) -> Int

#
CalibrationTransform::identity

fn CalibrationTransform::identity(dimension : Int) -> CalibrationTransform

#
CalibrationTransform::inverse

fn CalibrationTransform::inverse(self : CalibrationTransform, values : Array[Double]) -> Array[Double]

#
CalibrationTransform::new

fn CalibrationTransform::new(offset : Array[Double], scale : Array[Double]) -> CalibrationTransform

#
CalibrationTransform::offset

fn CalibrationTransform::offset(self : CalibrationTransform) -> Array[Double]

#
CalibrationTransform::scale

fn CalibrationTransform::scale(self : CalibrationTransform) -> Array[Double]

#
ConsistencyReport

pub struct ConsistencyReport {
count : Int
average_nees : Double
average_nis : Double
accepted_rate : Double
covariance_failures : Int
} derive(
Debug
)

#
ConsistencyReport::accepted_rate

fn ConsistencyReport::accepted_rate(self : ConsistencyReport) -> Double

#
ConsistencyReport::average_nees

fn ConsistencyReport::average_nees(self : ConsistencyReport) -> Double

#
ConsistencyReport::average_nis

fn ConsistencyReport::average_nis(self : ConsistencyReport) -> Double

#
ConsistencyReport::count

fn ConsistencyReport::count(self : ConsistencyReport) -> Int

#
ConsistencyReport::covariance_failures

fn ConsistencyReport::covariance_failures(self : ConsistencyReport) -> Int

#
ConstantVelocityTracker2D

pub struct ConstantVelocityTracker2D {
filter : KalmanND
acceleration_variance : Double
position_variance : Double
last_timestamp : Int
initialized_timestamp : Bool
}

A ready-to-use two-dimensional position tracker with state [x, y, vx, vy] and a position measurement [x, y].

#
ConstantVelocityTracker2D::covariance

#
ConstantVelocityTracker2D::filter

#
ConstantVelocityTracker2D::new

fn ConstantVelocityTracker2D::new(initial_position : Array[Double], initial_velocity : Array[Double], initial_variance : Double, acceleration_variance : Double, position_variance : Double) -> ConstantVelocityTracker2D

#
ConstantVelocityTracker2D::predict

fn ConstantVelocityTracker2D::predict(self : ConstantVelocityTracker2D, dt : Double) -> Unit

#
ConstantVelocityTracker2D::reset

#
ConstantVelocityTracker2D::set_gate_threshold

fn ConstantVelocityTracker2D::set_gate_threshold(self : ConstantVelocityTracker2D, threshold : Double) -> Unit

#
ConstantVelocityTracker2D::state

#
ConstantVelocityTracker2D::step

fn ConstantVelocityTracker2D::step(self : ConstantVelocityTracker2D, timestamp : Int, position : Array[Double], covariance : Matrix) -> UpdateResult

#
ConstantVelocityTracker2D::step_position

fn ConstantVelocityTracker2D::step_position(self : ConstantVelocityTracker2D, timestamp : Int, x : Double, y : Double) -> UpdateResult

#
ContractIssue

pub struct ContractIssue {
code : String
severity : ContractSeverity
message : String
} derive(
Debug
)

#
ContractIssue::code

fn ContractIssue::code(self : ContractIssue) -> String

#
ContractIssue::message

fn ContractIssue::message(self : ContractIssue) -> String

#
ContractIssue::new

fn ContractIssue::new(code : String, severity : ContractSeverity, message : String) -> ContractIssue

#
ContractIssue::severity

#
ContractSeverity

pub(all) enum ContractSeverity {
Info
Warning
Error
} derive(Eq,
Debug
)

Severity attached to a machine-readable validation issue.

#
ControlCommand

pub struct ControlCommand {
timestamp : Int
values : Array[Double]
duration : Double
} derive(
Debug
)

#
ControlCommand::duration

fn ControlCommand::duration(self : ControlCommand) -> Double

#
ControlCommand::is_valid

fn ControlCommand::is_valid(self : ControlCommand) -> Bool

#
ControlCommand::new

fn ControlCommand::new(timestamp : Int, values : Array[Double], duration : Double) -> ControlCommand

#
ControlCommand::timestamp

fn ControlCommand::timestamp(self : ControlCommand) -> Int

#
ControlCommand::values

fn ControlCommand::values(self : ControlCommand) -> Array[Double]

#
ControlIntegrator

pub struct ControlIntegrator {
dimension : Int
state : Array[Double]
limits : ControlLimits
response : Double
}

Integrate a first-order control response with a bounded acceleration.

#
ControlIntegrator::dimension

fn ControlIntegrator::dimension(self : ControlIntegrator) -> Int

#
ControlIntegrator::new

fn ControlIntegrator::new(dimension : Int, limits : ControlLimits, response : Double) -> ControlIntegrator

#
ControlIntegrator::reset

fn ControlIntegrator::reset(self : ControlIntegrator) -> Unit

#
ControlIntegrator::response

fn ControlIntegrator::response(self : ControlIntegrator) -> Double

#
ControlIntegrator::state

fn ControlIntegrator::state(self : ControlIntegrator) -> Array[Double]

#
ControlIntegrator::step

fn ControlIntegrator::step(self : ControlIntegrator, command : Array[Double], dt : Double) -> Array[Double]

#
ControlLimits

pub struct ControlLimits {
lower : Array[Double]
upper : Array[Double]
}

Saturation limits for an actuator or control input.

#
ControlLimits::apply

fn ControlLimits::apply(self : ControlLimits, command : Array[Double]) -> Array[Double]

#
ControlLimits::contains

fn ControlLimits::contains(self : ControlLimits, command : Array[Double]) -> Bool

#
ControlLimits::dimension

fn ControlLimits::dimension(self : ControlLimits) -> Int

#
ControlLimits::lower

fn ControlLimits::lower(self : ControlLimits) -> Array[Double]

#
ControlLimits::new

fn ControlLimits::new(lower : Array[Double], upper : Array[Double]) -> ControlLimits

#
ControlLimits::upper

fn ControlLimits::upper(self : ControlLimits) -> Array[Double]

#
ControlSequence

pub struct ControlSequence {
commands : Array[ControlCommand]
capacity : Int
rejected : Int
}

A bounded command sequence for offline control replay.

#
ControlSequence::clear

fn ControlSequence::clear(self : ControlSequence) -> Unit

#
ControlSequence::commands

#
ControlSequence::length

fn ControlSequence::length(self : ControlSequence) -> Int

#
ControlSequence::new

fn ControlSequence::new(capacity : Int) -> ControlSequence

#
ControlSequence::push

fn ControlSequence::push(self : ControlSequence, command : ControlCommand) -> Bool

#
ControlSequence::rejected

fn ControlSequence::rejected(self : ControlSequence) -> Int

#
CovarianceAccumulator

pub struct CovarianceAccumulator {
dimension : Int
count : Int
mean : Array[Double]
scatter : Matrix
}

Accumulate covariance from a stream without storing every sample.

#
CovarianceAccumulator::add

fn CovarianceAccumulator::add(self : CovarianceAccumulator, sample : Array[Double]) -> Bool

#
CovarianceAccumulator::count

#
CovarianceAccumulator::covariance

#
CovarianceAccumulator::mean

#
CovarianceAccumulator::new

fn CovarianceAccumulator::new(dimension : Int) -> CovarianceAccumulator

#
CovarianceAccumulator::reset

#
CovarianceHealth

pub enum CovarianceHealth {
Healthy
NonFinite
NotSquare
NotSymmetric
NotPositiveSemidefinite
IllConditioned
} derive(Eq,
Debug
)

#
CovarianceReport

pub struct CovarianceReport {
health : CovarianceHealth
dimension : Int
symmetry_error : Double
minimum_eigenvalue : Double
maximum_eigenvalue : Double
condition_estimate : Double
finite : Bool
positive_diagonal : Bool
} derive(
Debug
)

#
CovarianceReport::condition_estimate

fn CovarianceReport::condition_estimate(self : CovarianceReport) -> Double

#
CovarianceReport::dimension

fn CovarianceReport::dimension(self : CovarianceReport) -> Int

#
CovarianceReport::finite

fn CovarianceReport::finite(self : CovarianceReport) -> Bool

#
CovarianceReport::health

#
CovarianceReport::is_healthy

fn CovarianceReport::is_healthy(self : CovarianceReport) -> Bool

#
CovarianceReport::maximum_eigenvalue

fn CovarianceReport::maximum_eigenvalue(self : CovarianceReport) -> Double

#
CovarianceReport::minimum_eigenvalue

fn CovarianceReport::minimum_eigenvalue(self : CovarianceReport) -> Double

#
CovarianceReport::positive_diagonal

fn CovarianceReport::positive_diagonal(self : CovarianceReport) -> Bool

#
CovarianceReport::symmetry_error

fn CovarianceReport::symmetry_error(self : CovarianceReport) -> Double

#
DataQualityReport

pub struct DataQualityReport {
total : Int
valid : Int
missing : Int
non_finite : Int
non_monotonic_timestamps : Int
duplicate_timestamps : Int
finite_fraction : Double
} derive(
Debug
)

Data-quality summary for a timestamped sensor stream.

#
DataQualityReport::duplicate_timestamps

fn DataQualityReport::duplicate_timestamps(self : DataQualityReport) -> Int

#
DataQualityReport::finite_fraction

fn DataQualityReport::finite_fraction(self : DataQualityReport) -> Double

#
DataQualityReport::missing

fn DataQualityReport::missing(self : DataQualityReport) -> Int

#
DataQualityReport::non_finite

fn DataQualityReport::non_finite(self : DataQualityReport) -> Int

#
DataQualityReport::non_monotonic_timestamps

fn DataQualityReport::non_monotonic_timestamps(self : DataQualityReport) -> Int

#
DataQualityReport::total

fn DataQualityReport::total(self : DataQualityReport) -> Int

#
DataQualityReport::valid

fn DataQualityReport::valid(self : DataQualityReport) -> Int

#
DeterministicRng

pub struct DeterministicRng {
state : Int
}

Small deterministic pseudo-random generator for repeatable examples and benchmarks. It is not intended for cryptographic use.

#
DeterministicRng::bounded_int

fn DeterministicRng::bounded_int(self : DeterministicRng, bound : Int) -> Int

#
DeterministicRng::new

fn DeterministicRng::new(seed : Int) -> DeterministicRng

#
DeterministicRng::next

fn DeterministicRng::next(self : DeterministicRng) -> Int

#
DeterministicRng::symmetric

fn DeterministicRng::symmetric(self : DeterministicRng, amplitude : Double) -> Double

#
DeterministicRng::unit

fn DeterministicRng::unit(self : DeterministicRng) -> Double

#
DominantEigenpair

pub struct DominantEigenpair {
value : Double
vector : Array[Double]
iterations : Int
converged : Bool
} derive(
Debug
)

One power-iteration estimate of the dominant eigenpair.

#
DominantEigenpair::converged

fn DominantEigenpair::converged(self : DominantEigenpair) -> Bool

#
DominantEigenpair::iterations

fn DominantEigenpair::iterations(self : DominantEigenpair) -> Int

#
DominantEigenpair::value

fn DominantEigenpair::value(self : DominantEigenpair) -> Double

#
DominantEigenpair::vector

fn DominantEigenpair::vector(self : DominantEigenpair) -> Array[Double]

#
EKF

pub struct EKF {
x : Array[Double]
p : Matrix
q : Matrix
r : Matrix
initial_state : Array[Double]
initial_covariance : Matrix
last_innovation : Array[Double]
last_innovation_covariance : Matrix
last_gain : Matrix
last_nis : Double
gate_threshold : Double
predict_count : Int
accepted_count : Int
rejected_count : Int
missing_count : Int
}

Extended Kalman Filter for differentiable non-linear models.

Callers provide the state transition and observation functions together with their Jacobians. All covariance updates use the same numerically stable Joseph form as KalmanND.

#
EKF::accepted_count

fn EKF::accepted_count(self : EKF) -> Int

#
EKF::covariance

fn EKF::covariance(self : EKF) -> Matrix

#
EKF::filter

fn EKF::filter(self : EKF, measurements : Array[Array[Double]], f : (Array[Double]) -> Array[Double], jacobian_f : (Array[Double]) -> Array[Array[Double]], h : (Array[Double]) -> Array[Double], jacobian_h : (Array[Double]) -> Array[Array[Double]]) -> Array[Array[Double]]

Run a sequence of EKF updates against a caller-owned model.

#
EKF::gate_threshold

fn EKF::gate_threshold(self : EKF) -> Double

#
EKF::innovation

fn EKF::innovation(self : EKF) -> Array[Double]

#
EKF::innovation_covariance

fn EKF::innovation_covariance(self : EKF) -> Matrix

#
EKF::kalman_gain

fn EKF::kalman_gain(self : EKF) -> Matrix

#
EKF::measurement_noise

fn EKF::measurement_noise(self : EKF) -> Matrix

#
EKF::missing_count

fn EKF::missing_count(self : EKF) -> Int

#
EKF::new

fn EKF::new(initial_state : Array[Double], initial_covariance : Array[Array[Double]], process_noise : Array[Array[Double]], measurement_noise : Array[Array[Double]]) -> EKF

#
EKF::normalized_innovation_squared

fn EKF::normalized_innovation_squared(self : EKF) -> Double

#
EKF::predict

fn EKF::predict(self : EKF, f : (Array[Double]) -> Array[Double], jacobian_f : (Array[Double]) -> Array[Array[Double]]) -> Unit

#
EKF::predict_count

fn EKF::predict_count(self : EKF) -> Int

#
EKF::predict_with_control

fn EKF::predict_with_control(self : EKF, f : (Array[Double], Array[Double]) -> Array[Double], jacobian_f : (Array[Double], Array[Double]) -> Array[Array[Double]], control : Array[Double]) -> Unit

#
EKF::process_noise

fn EKF::process_noise(self : EKF) -> Matrix

#
EKF::rejected_count

fn EKF::rejected_count(self : EKF) -> Int

#
EKF::reset

fn EKF::reset(self : EKF) -> Unit

#
EKF::set_gate_threshold

fn EKF::set_gate_threshold(self : EKF, threshold : Double) -> Unit

#
EKF::set_measurement_noise

fn EKF::set_measurement_noise(self : EKF, measurement_noise : Matrix) -> Bool

#
EKF::set_process_noise

fn EKF::set_process_noise(self : EKF, process_noise : Matrix) -> Bool

#
EKF::state

fn EKF::state(self : EKF) -> Array[Double]

#
EKF::update

fn EKF::update(self : EKF, z : Array[Double], h : (Array[Double]) -> Array[Double], jacobian_h : (Array[Double]) -> Array[Array[Double]]) -> UpdateResult

#
EKF::update_gated

fn EKF::update_gated(self : EKF, z : Array[Double], h : (Array[Double]) -> Array[Double], jacobian_h : (Array[Double]) -> Array[Array[Double]], threshold : Double) -> UpdateResult

#
EKF::update_missing

fn EKF::update_missing(self : EKF) -> UpdateResult

#
ErrorMetrics

pub(all) struct ErrorMetrics {
count : Int
rmse : Double
mae : Double
max_error : Double
final_error : Double
} derive(
Debug
)

Common quality metrics for state-estimation experiments.

#
ErrorMetrics::count

fn ErrorMetrics::count(self : ErrorMetrics) -> Int

#
ErrorMetrics::final_error

fn ErrorMetrics::final_error(self : ErrorMetrics) -> Double

#
ErrorMetrics::mae

fn ErrorMetrics::mae(self : ErrorMetrics) -> Double

#
ErrorMetrics::max_error

fn ErrorMetrics::max_error(self : ErrorMetrics) -> Double

#
ErrorMetrics::rmse

fn ErrorMetrics::rmse(self : ErrorMetrics) -> Double

#
Estimate1D

pub struct Estimate1D {
value : Double
variance : Double
} derive(
Debug
)

A one-dimensional estimate and its uncertainty.

#
Estimate1D::value

fn Estimate1D::value(self : Estimate1D) -> Double

#
Estimate1D::variance

fn Estimate1D::variance(self : Estimate1D) -> Double

#
EstimatorEnsemble

pub struct EstimatorEnsemble {
dimension : Int
candidates : Array[StateCandidate]
rejected : Int
}

Weighted consensus over a set of independent state estimates.

#
EstimatorEnsemble::add

fn EstimatorEnsemble::add(self : EstimatorEnsemble, candidate : StateCandidate) -> Bool

#
EstimatorEnsemble::best

#
EstimatorEnsemble::candidates

#
EstimatorEnsemble::clear

fn EstimatorEnsemble::clear(self : EstimatorEnsemble) -> Unit

#
EstimatorEnsemble::consensus

fn EstimatorEnsemble::consensus(self : EstimatorEnsemble) -> Array[Double]

#
EstimatorEnsemble::consensus_covariance

fn EstimatorEnsemble::consensus_covariance(self : EstimatorEnsemble) -> Matrix

#
EstimatorEnsemble::dimension

fn EstimatorEnsemble::dimension(self : EstimatorEnsemble) -> Int

#
EstimatorEnsemble::disagreement

fn EstimatorEnsemble::disagreement(self : EstimatorEnsemble) -> Double

#
EstimatorEnsemble::length

fn EstimatorEnsemble::length(self : EstimatorEnsemble) -> Int

#
EstimatorEnsemble::new

fn EstimatorEnsemble::new(dimension : Int) -> EstimatorEnsemble

#
EstimatorEnsemble::rejected

fn EstimatorEnsemble::rejected(self : EstimatorEnsemble) -> Int

#
ExponentialStats

pub struct ExponentialStats {
alpha : Double
count : Int
mean : Double
variance : Double
minimum : Double
maximum : Double
}

Exponentially weighted scalar statistics for non-stationary sensors.

#
ExponentialStats::add

fn ExponentialStats::add(self : ExponentialStats, value : Double) -> Bool

#
ExponentialStats::alpha

fn ExponentialStats::alpha(self : ExponentialStats) -> Double

#
ExponentialStats::count

fn ExponentialStats::count(self : ExponentialStats) -> Int

#
ExponentialStats::maximum

fn ExponentialStats::maximum(self : ExponentialStats) -> Double

#
ExponentialStats::mean

fn ExponentialStats::mean(self : ExponentialStats) -> Double

#
ExponentialStats::minimum

fn ExponentialStats::minimum(self : ExponentialStats) -> Double

#
ExponentialStats::new

fn ExponentialStats::new(alpha : Double) -> ExponentialStats

#
ExponentialStats::reset

fn ExponentialStats::reset(self : ExponentialStats) -> Unit

#
ExponentialStats::standard_deviation

fn ExponentialStats::standard_deviation(self : ExponentialStats) -> Double

#
ExponentialStats::variance

fn ExponentialStats::variance(self : ExponentialStats) -> Double

#
FeatureVector

pub struct FeatureVector {
mean : Double
variance : Double
slope : Double
minimum : Double
maximum : Double
energy : Double
} derive(
Debug
)

#
FeatureVector::energy

fn FeatureVector::energy(self : FeatureVector) -> Double

#
FeatureVector::maximum

fn FeatureVector::maximum(self : FeatureVector) -> Double

#
FeatureVector::mean

fn FeatureVector::mean(self : FeatureVector) -> Double

#
FeatureVector::minimum

fn FeatureVector::minimum(self : FeatureVector) -> Double

#
FeatureVector::slope

fn FeatureVector::slope(self : FeatureVector) -> Double

#
FeatureVector::variance

fn FeatureVector::variance(self : FeatureVector) -> Double

#
FilterCheckpoint

pub struct FilterCheckpoint {
state : Array[Double]
covariance : Matrix
timestamp : Int
} derive(
Debug
)

A serializable-in-memory checkpoint for crash recovery and replay.

#
FilterCheckpoint::covariance

fn FilterCheckpoint::covariance(self : FilterCheckpoint) -> Matrix

#
FilterCheckpoint::new

fn FilterCheckpoint::new(state : Array[Double], covariance : Matrix, timestamp : Int) -> FilterCheckpoint

#
FilterCheckpoint::state

fn FilterCheckpoint::state(self : FilterCheckpoint) -> Array[Double]

#
FilterCheckpoint::timestamp

fn FilterCheckpoint::timestamp(self : FilterCheckpoint) -> Int

#
FilterStatus

pub(all) enum FilterStatus {
WarmingUp
Healthy
Degraded
Faulted
} derive(Eq,
Debug
)

Runtime health classification for an on-device filter.

#
FixedLagSmoother

pub struct FixedLagSmoother {
lag : Int
states : Array[Array[Double]]
covariances : Array[Matrix]
predicted_states : Array[Array[Double]]
predicted_covariances : Array[Matrix]
transitions : Array[Matrix]
}

Fixed-lag history manager. It stores the data needed to smooth a bounded recent window while returning the newest filtered estimate immediately.

#
FixedLagSmoother::lag

fn FixedLagSmoother::lag(self : FixedLagSmoother) -> Int

#
FixedLagSmoother::latest_smoothed_state

fn FixedLagSmoother::latest_smoothed_state(self : FixedLagSmoother) -> Array[Double]

#
FixedLagSmoother::length

fn FixedLagSmoother::length(self : FixedLagSmoother) -> Int

#
FixedLagSmoother::new

fn FixedLagSmoother::new(lag : Int) -> FixedLagSmoother

#
FixedLagSmoother::push

fn FixedLagSmoother::push(self : FixedLagSmoother, filtered_state : Array[Double], filtered_covariance : Matrix, predicted_state : Array[Double], predicted_covariance : Matrix, transition : Matrix) -> Unit

#
FixedLagSmoother::smooth

#
FusionEvent

pub struct FusionEvent {
timestamp : Int
sensor : String
result : UpdateResult
state : Array[Double]
covariance : Matrix
nis : Double
} derive(
Debug
)

#
FusionEvent::covariance

fn FusionEvent::covariance(self : FusionEvent) -> Matrix

#
FusionEvent::nis

fn FusionEvent::nis(self : FusionEvent) -> Double

#
FusionEvent::result

fn FusionEvent::result(self : FusionEvent) -> UpdateResult

#
FusionEvent::sensor

fn FusionEvent::sensor(self : FusionEvent) -> String

#
FusionEvent::state

fn FusionEvent::state(self : FusionEvent) -> Array[Double]

#
FusionEvent::timestamp

fn FusionEvent::timestamp(self : FusionEvent) -> Int

#
FusionMeasurement

pub struct FusionMeasurement {
sensor : String
timestamp : Int
values : Array[Double]
covariance : Matrix
confidence : Double
} derive(
Debug
)

#
FusionMeasurement::confidence

fn FusionMeasurement::confidence(self : FusionMeasurement) -> Double

#
FusionMeasurement::covariance

fn FusionMeasurement::covariance(self : FusionMeasurement) -> Matrix

#
FusionMeasurement::is_valid

fn FusionMeasurement::is_valid(self : FusionMeasurement, dimension : Int) -> Bool

#
FusionMeasurement::new

fn FusionMeasurement::new(sensor : String, timestamp : Int, values : Array[Double], covariance : Matrix, confidence : Double) -> FusionMeasurement

#
FusionMeasurement::sensor

fn FusionMeasurement::sensor(self : FusionMeasurement) -> String

#
FusionMeasurement::timestamp

fn FusionMeasurement::timestamp(self : FusionMeasurement) -> Int

#
FusionMeasurement::values

fn FusionMeasurement::values(self : FusionMeasurement) -> Array[Double]

#
FusionPolicy

pub struct FusionPolicy {
gate_threshold : Double
max_time_gap : Int
covariance_inflation : Double
reject_non_finite : Bool
predict_on_missing : Bool
} derive(
Debug
)

Policy for multi-sensor fusion and outlier handling.

#
FusionPolicy::covariance_inflation

fn FusionPolicy::covariance_inflation(self : FusionPolicy) -> Double

#
FusionPolicy::default

fn FusionPolicy::default() -> FusionPolicy

#
FusionPolicy::gate_threshold

fn FusionPolicy::gate_threshold(self : FusionPolicy) -> Double

#
FusionPolicy::max_time_gap

fn FusionPolicy::max_time_gap(self : FusionPolicy) -> Int

#
FusionPolicy::new

fn FusionPolicy::new(gate_threshold : Double, max_time_gap : Int, covariance_inflation : Double, reject_non_finite : Bool, predict_on_missing : Bool) -> FusionPolicy

#
FusionPolicy::predict_on_missing

fn FusionPolicy::predict_on_missing(self : FusionPolicy) -> Bool

#
FusionPolicy::reject_non_finite

fn FusionPolicy::reject_non_finite(self : FusionPolicy) -> Bool

#
FusionResult

pub struct FusionResult {
strategy : FusionStrategy
timestamp : Int
values : Array[Double]
covariance : Matrix
used : Int
rejected : Int
} derive(
Debug
)

#
FusionResult::covariance

fn FusionResult::covariance(self : FusionResult) -> Matrix

#
FusionResult::rejected

fn FusionResult::rejected(self : FusionResult) -> Int

#
FusionResult::strategy

fn FusionResult::strategy(self : FusionResult) -> FusionStrategy

#
FusionResult::timestamp

fn FusionResult::timestamp(self : FusionResult) -> Int

#
FusionResult::used

fn FusionResult::used(self : FusionResult) -> Int

#
FusionResult::values

fn FusionResult::values(self : FusionResult) -> Array[Double]

#
FusionStatistics

pub struct FusionStatistics {
total_packets : Int
accepted_packets : Int
rejected_packets : Int
missing_packets : Int
last_timestamp : Int
} derive(
Debug
)

#
FusionStatistics::accepted_packets

fn FusionStatistics::accepted_packets(self : FusionStatistics) -> Int

#
FusionStatistics::last_timestamp

fn FusionStatistics::last_timestamp(self : FusionStatistics) -> Int

#
FusionStatistics::missing_packets

fn FusionStatistics::missing_packets(self : FusionStatistics) -> Int

#
FusionStatistics::rejected_packets

fn FusionStatistics::rejected_packets(self : FusionStatistics) -> Int

#
FusionStatistics::total_packets

fn FusionStatistics::total_packets(self : FusionStatistics) -> Int

#
FusionStrategy

pub(all) enum FusionStrategy {
WeightedMean
Median
BestConfidence
TrimmedMean(Int)
} derive(Eq,
Debug
)

How independent measurements are combined before the state update.

#
GateSchedule

pub struct GateSchedule {
base_threshold : Double
minimum_threshold : Double
maximum_threshold : Double
consecutive_rejections : Int
recovery_steps : Int
}

#
GateSchedule::consecutive_rejections

fn GateSchedule::consecutive_rejections(self : GateSchedule) -> Int

#
GateSchedule::new

fn GateSchedule::new(base_threshold : Double, minimum_threshold : Double, maximum_threshold : Double, recovery_steps : Int) -> GateSchedule

#
GateSchedule::observe

fn GateSchedule::observe(self : GateSchedule, result : UpdateResult) -> Double

#
GateSchedule::threshold

fn GateSchedule::threshold(self : GateSchedule) -> Double

#
Histogram

pub struct Histogram {
minimum : Double
maximum : Double
buckets : Array[HistogramBucket]
underflow : Int
overflow : Int
samples : Int
}

#
Histogram::add

fn Histogram::add(self : Histogram, value : Double) -> Bool

#
Histogram::add_many

fn Histogram::add_many(self : Histogram, values : Array[Double]) -> Int

#
Histogram::bucket_count

fn Histogram::bucket_count(self : Histogram) -> Int

#
Histogram::buckets

fn Histogram::buckets(self : Histogram) -> Array[HistogramBucket]

#
Histogram::density

fn Histogram::density(self : Histogram) -> Array[Double]

#
Histogram::in_range

fn Histogram::in_range(self : Histogram) -> Int

#
Histogram::maximum

fn Histogram::maximum(self : Histogram) -> Double

#
Histogram::minimum

fn Histogram::minimum(self : Histogram) -> Double

#
Histogram::new

fn Histogram::new(minimum : Double, maximum : Double, bucket_count : Int) -> Histogram

#
Histogram::overflow

fn Histogram::overflow(self : Histogram) -> Int

#
Histogram::percentile

fn Histogram::percentile(self : Histogram, probability : Double) -> Double

#
Histogram::reset

fn Histogram::reset(self : Histogram) -> Unit

#
Histogram::samples

fn Histogram::samples(self : Histogram) -> Int

#
Histogram::underflow

fn Histogram::underflow(self : Histogram) -> Int

#
HistogramBucket

pub struct HistogramBucket {
lower : Double
upper : Double
count : Int
} derive(
Debug
)

A fixed-width histogram for telemetry and residual distributions.

#
HistogramBucket::count

fn HistogramBucket::count(self : HistogramBucket) -> Int

#
HistogramBucket::lower

fn HistogramBucket::lower(self : HistogramBucket) -> Double

#
HistogramBucket::upper

fn HistogramBucket::upper(self : HistogramBucket) -> Double

#
InnovationDiagnostics

pub struct InnovationDiagnostics {
innovation : Array[Double]
covariance : Matrix
nis : Double
whitened_norm : Double
accepted : Bool
} derive(
Debug
)

#
InnovationDiagnostics::accepted

fn InnovationDiagnostics::accepted(self : InnovationDiagnostics) -> Bool

#
InnovationDiagnostics::covariance

#
InnovationDiagnostics::innovation

fn InnovationDiagnostics::innovation(self : InnovationDiagnostics) -> Array[Double]

#
InnovationDiagnostics::nis

#
InnovationDiagnostics::whitened_norm

fn InnovationDiagnostics::whitened_norm(self : InnovationDiagnostics) -> Double

#
InnovationMonitor

pub struct InnovationMonitor {
dimension : Int
threshold : Double
samples : Int
accepted : Int
rejected : Int
nis_stats : RunningStats
last_nis : Double
}

Online innovation monitor used as a quality gate and alert source.

#
InnovationMonitor::acceptance_rate

fn InnovationMonitor::acceptance_rate(self : InnovationMonitor) -> Double

#
InnovationMonitor::accepted

fn InnovationMonitor::accepted(self : InnovationMonitor) -> Int

#
InnovationMonitor::average_nis

fn InnovationMonitor::average_nis(self : InnovationMonitor) -> Double

#
InnovationMonitor::last_nis

fn InnovationMonitor::last_nis(self : InnovationMonitor) -> Double

#
InnovationMonitor::new

fn InnovationMonitor::new(dimension : Int, threshold : Double) -> InnovationMonitor

#
InnovationMonitor::observe

fn InnovationMonitor::observe(self : InnovationMonitor, innovation : Array[Double], covariance : Matrix) -> Bool

#
InnovationMonitor::rejected

fn InnovationMonitor::rejected(self : InnovationMonitor) -> Int

#
InnovationMonitor::samples

fn InnovationMonitor::samples(self : InnovationMonitor) -> Int

#
Kalman1D

pub struct Kalman1D {
x : Double
p : Double
q : Double
r : Double
initial_state : Double
initial_uncertainty : Double
last_innovation : Double
last_innovation_variance : Double
last_gain : Double
last_nis : Double
gate_threshold : Double
predict_count : Int
accepted_count : Int
rejected_count : Int
missing_count : Int
}

A production-ready scalar Kalman filter for cheap sensor smoothing.

#
Kalman1D::accepted_count

fn Kalman1D::accepted_count(self : Kalman1D) -> Int

#
Kalman1D::adapt_process_noise

fn Kalman1D::adapt_process_noise(self : Kalman1D, lower : Double, upper : Double) -> Unit

Adapt process noise using the latest innovation while bounding changes.

#
Kalman1D::estimate

fn Kalman1D::estimate(self : Kalman1D) -> Estimate1D

#
Kalman1D::filter

fn Kalman1D::filter(self : Kalman1D, measurements : Array[Double], control? : Array[Double]) -> Array[Double]

Smooth a whole scalar measurement series and return the state history.

#
Kalman1D::gate_threshold

fn Kalman1D::gate_threshold(self : Kalman1D) -> Double

#
Kalman1D::innovation

fn Kalman1D::innovation(self : Kalman1D) -> Double

#
Kalman1D::innovation_variance

fn Kalman1D::innovation_variance(self : Kalman1D) -> Double

#
Kalman1D::kalman_gain

fn Kalman1D::kalman_gain(self : Kalman1D) -> Double

#
Kalman1D::measurement_noise

fn Kalman1D::measurement_noise(self : Kalman1D) -> Double

#
Kalman1D::missing_count

fn Kalman1D::missing_count(self : Kalman1D) -> Int

#
Kalman1D::new

fn Kalman1D::new(initial_state : Double, initial_uncertainty : Double, process_noise : Double, measurement_noise : Double) -> Kalman1D

#
Kalman1D::normalized_innovation_squared

fn Kalman1D::normalized_innovation_squared(self : Kalman1D) -> Double

#
Kalman1D::predict

fn Kalman1D::predict(self : Kalman1D, u : Double) -> Unit

#
Kalman1D::predict_count

fn Kalman1D::predict_count(self : Kalman1D) -> Int

#
Kalman1D::predict_without_control

fn Kalman1D::predict_without_control(self : Kalman1D) -> Unit

#
Kalman1D::process_noise

fn Kalman1D::process_noise(self : Kalman1D) -> Double

#
Kalman1D::rejected_count

fn Kalman1D::rejected_count(self : Kalman1D) -> Int

#
Kalman1D::reset

fn Kalman1D::reset(self : Kalman1D) -> Unit

#
Kalman1D::set_gate_threshold

fn Kalman1D::set_gate_threshold(self : Kalman1D, threshold : Double) -> Unit

#
Kalman1D::set_measurement_noise

fn Kalman1D::set_measurement_noise(self : Kalman1D, measurement_noise : Double) -> Unit

#
Kalman1D::set_process_noise

fn Kalman1D::set_process_noise(self : Kalman1D, process_noise : Double) -> Unit

#
Kalman1D::state

fn Kalman1D::state(self : Kalman1D) -> Double

#
Kalman1D::uncertainty

fn Kalman1D::uncertainty(self : Kalman1D) -> Double

#
Kalman1D::update

fn Kalman1D::update(self : Kalman1D, z : Double) -> Unit

#
Kalman1D::update_gated

fn Kalman1D::update_gated(self : Kalman1D, z : Double, threshold : Double) -> UpdateResult

#
Kalman1D::update_if_valid

fn Kalman1D::update_if_valid(self : Kalman1D, z : Double) -> UpdateResult

#
Kalman1D::update_missing

fn Kalman1D::update_missing(self : Kalman1D) -> UpdateResult

#
KalmanDiagnostics

pub enum KalmanDiagnostics {
Token
} derive(Eq,
Debug
)

Namespace object for covariance and observation diagnostics.

#
KalmanDiagnostics::check_covariance

fn KalmanDiagnostics::check_covariance(self : KalmanDiagnostics, covariance : Array[Array[Double]]) -> Bool

Compatibility helper for the original API.

#
KalmanDiagnostics::new

#
KalmanDiagnostics::report

fn KalmanDiagnostics::report(self : KalmanDiagnostics, covariance : Matrix) -> CovarianceReport

Inspect symmetry, finite values, diagonal signs, approximate eigenvalues, and conditioning of a covariance matrix.

#
KalmanND

pub struct KalmanND {
x : Array[Double]
p : Matrix
q : Matrix
r : Matrix
f : Matrix
h : Matrix
initial_state : Array[Double]
initial_covariance : Matrix
last_innovation : Array[Double]
last_innovation_covariance : Matrix
last_gain : Matrix
last_nis : Double
gate_threshold : Double
predict_count : Int
accepted_count : Int
rejected_count : Int
missing_count : Int
}

Linear Kalman filter for dense state and measurement vectors.

The implementation uses the Joseph covariance form. Compared with the short textbook form, Joseph form better preserves symmetry and positive semidefiniteness when a sensor has very small noise.

#
KalmanND::accepted_count

fn KalmanND::accepted_count(self : KalmanND) -> Int

#
KalmanND::checkpoint

fn KalmanND::checkpoint(self : KalmanND, timestamp : Int) -> FilterCheckpoint

#
KalmanND::covariance

fn KalmanND::covariance(self : KalmanND) -> Matrix

#
KalmanND::filter

fn KalmanND::filter(self : KalmanND, measurements : Array[Array[Double]]) -> Array[Array[Double]]

Run a predict/update cycle for each measurement and return state history.

#
KalmanND::from_model

fn KalmanND::from_model(model : LinearModel, initial_state : Array[Double], initial_covariance : Matrix) -> KalmanND

#
KalmanND::gate_threshold

fn KalmanND::gate_threshold(self : KalmanND) -> Double

#
KalmanND::inflate_covariance

fn KalmanND::inflate_covariance(self : KalmanND, factor : Double, maximum : Double) -> Unit

Inflate covariance after a long sensor outage, with a hard cap for safety.

#
KalmanND::innovation

fn KalmanND::innovation(self : KalmanND) -> Array[Double]

#
KalmanND::innovation_covariance

fn KalmanND::innovation_covariance(self : KalmanND) -> Matrix

#
KalmanND::kalman_gain

fn KalmanND::kalman_gain(self : KalmanND) -> Matrix

#
KalmanND::last_update

fn KalmanND::last_update(self : KalmanND) -> UpdateSummary

#
KalmanND::measurement_dimension

fn KalmanND::measurement_dimension(self : KalmanND) -> Int

#
KalmanND::measurement_noise

fn KalmanND::measurement_noise(self : KalmanND) -> Matrix

#
KalmanND::missing_count

fn KalmanND::missing_count(self : KalmanND) -> Int

#
KalmanND::new

fn KalmanND::new(initial_state : Array[Double], initial_covariance : Array[Array[Double]], process_noise : Array[Array[Double]], measurement_noise : Array[Array[Double]], transition_model : Array[Array[Double]], observation_model : Array[Array[Double]]) -> KalmanND

#
KalmanND::normalized_innovation_squared

fn KalmanND::normalized_innovation_squared(self : KalmanND) -> Double

#
KalmanND::observation_model

fn KalmanND::observation_model(self : KalmanND) -> Matrix

#
KalmanND::predict

fn KalmanND::predict(self : KalmanND) -> Unit

#
KalmanND::predict_count

fn KalmanND::predict_count(self : KalmanND) -> Int

#
KalmanND::predict_with_control

fn KalmanND::predict_with_control(self : KalmanND, control : Array[Double]) -> Unit

Predict with an optional control vector. A zero-column control matrix is a valid model, so callers can use an empty vector for the no-control case.

#
KalmanND::predict_with_control_matrix

fn KalmanND::predict_with_control_matrix(self : KalmanND, control_effect : Matrix) -> Unit

Predict with a caller-supplied state-space control effect matrix.

#
KalmanND::process_noise

fn KalmanND::process_noise(self : KalmanND) -> Matrix

#
KalmanND::rejected_count

fn KalmanND::rejected_count(self : KalmanND) -> Int

#
KalmanND::reset

fn KalmanND::reset(self : KalmanND) -> Unit

#
KalmanND::restore

fn KalmanND::restore(self : KalmanND, state : Array[Double], covariance : Matrix) -> Bool

Restore a validated state/covariance pair, useful for checkpoint recovery.

#
KalmanND::restore_checkpoint

fn KalmanND::restore_checkpoint(self : KalmanND, checkpoint : FilterCheckpoint) -> Bool

#
KalmanND::set_gate_threshold

fn KalmanND::set_gate_threshold(self : KalmanND, threshold : Double) -> Unit

#
KalmanND::set_measurement_noise

fn KalmanND::set_measurement_noise(self : KalmanND, measurement_noise : Matrix) -> Bool

#
KalmanND::set_observation_model

fn KalmanND::set_observation_model(self : KalmanND, observation : Matrix) -> Bool

#
KalmanND::set_process_noise

fn KalmanND::set_process_noise(self : KalmanND, process_noise : Matrix) -> Bool

#
KalmanND::set_transition_model

fn KalmanND::set_transition_model(self : KalmanND, transition : Matrix) -> Bool

#
KalmanND::state

fn KalmanND::state(self : KalmanND) -> Array[Double]

#
KalmanND::state_dimension

fn KalmanND::state_dimension(self : KalmanND) -> Int

#
KalmanND::transition_model

fn KalmanND::transition_model(self : KalmanND) -> Matrix

#
KalmanND::update

fn KalmanND::update(self : KalmanND, measurement : Array[Double]) -> UpdateResult

#
KalmanND::update_and_report

fn KalmanND::update_and_report(self : KalmanND, measurement : Array[Double]) -> UpdateSummary

#
KalmanND::update_gated

fn KalmanND::update_gated(self : KalmanND, measurement : Array[Double], threshold : Double) -> UpdateResult

#
KalmanND::update_missing

fn KalmanND::update_missing(self : KalmanND) -> UpdateResult

#
KalmanND::update_partial

fn KalmanND::update_partial(self : KalmanND, measurement : Array[Double], mask : Array[Bool]) -> UpdateResult

Update a subset of measurement channels, preserving the full state model.

#
LinearModel

pub struct LinearModel {
transition : Matrix
process_noise : Matrix
observation : Matrix
measurement_noise : Matrix
control : Matrix
} derive(
Debug
)

A complete linear state-space model for a sensor-fusion pipeline.

#
LinearModel::control

fn LinearModel::control(self : LinearModel) -> Matrix

#
LinearModel::measurement_dimension

fn LinearModel::measurement_dimension(self : LinearModel) -> Int

#
LinearModel::measurement_noise

fn LinearModel::measurement_noise(self : LinearModel) -> Matrix

#
LinearModel::new

fn LinearModel::new(transition : Matrix, process_noise : Matrix, observation : Matrix, measurement_noise : Matrix, control : Matrix) -> LinearModel

#
LinearModel::observation

fn LinearModel::observation(self : LinearModel) -> Matrix

#
LinearModel::process_noise

fn LinearModel::process_noise(self : LinearModel) -> Matrix

#
LinearModel::state_dimension

fn LinearModel::state_dimension(self : LinearModel) -> Int

#
LinearModel::transition

fn LinearModel::transition(self : LinearModel) -> Matrix

#
Matrix

pub struct Matrix {
rows : Int
cols : Int
data : Array[Double]
} derive(
Debug
)

A compact row-major dense matrix used by the filtering algorithms.

Matrix deliberately keeps its storage private. This prevents callers from accidentally changing the shape while still allowing the numerical kernels to update values in place. The type is small enough for embedded and WebAssembly workloads and predictable enough for deterministic tests.

#
Matrix::add

fn Matrix::add(self : Matrix, other : Matrix) -> Matrix

Add two matrices. Invalid shapes produce a zero-sized matrix rather than allowing a partially computed result into a filter.

#
Matrix::add_diagonal

fn Matrix::add_diagonal(self : Matrix, value : Double) -> Matrix

#
Matrix::approx_equal

fn Matrix::approx_equal(self : Matrix, other : Matrix, tolerance : Double) -> Bool

#
Matrix::block_diagonal

fn Matrix::block_diagonal(blocks : Array[Matrix]) -> Matrix

Construct a block diagonal matrix from independent square blocks.

#
Matrix::cholesky

fn Matrix::cholesky(self : Matrix) -> Matrix?

Lower-triangular Cholesky factor. The result is None when the input is not symmetric positive definite.

#
Matrix::clamp_diagonal

fn Matrix::clamp_diagonal(self : Matrix, lower : Double, upper : Double) -> Matrix

#
Matrix::cols

fn Matrix::cols(self : Matrix) -> Int

#
Matrix::column

fn Matrix::column(self : Matrix, index : Int) -> Array[Double]

Return the requested column as a new owned array.

#
Matrix::column_sums

fn Matrix::column_sums(self : Matrix) -> Array[Double]

#
Matrix::condition_estimate

fn Matrix::condition_estimate(self : Matrix) -> Double

#
Matrix::copy

fn Matrix::copy(self : Matrix) -> Matrix

#
Matrix::determinant

fn Matrix::determinant(self : Matrix) -> Double

Determinant computed with partial pivoting. A zero result means that the matrix is singular or not square.

#
Matrix::diagonal

fn Matrix::diagonal(size : Int, value : Double) -> Matrix

Construct a matrix whose diagonal is value and whose other entries are zero.

#
Matrix::diagonal_max

fn Matrix::diagonal_max(self : Matrix) -> Double

#
Matrix::diagonal_min

fn Matrix::diagonal_min(self : Matrix) -> Double

#
Matrix::dominant_eigenpair

fn Matrix::dominant_eigenpair(self : Matrix, iterations : Int) -> DominantEigenpair

#
Matrix::fill

fn Matrix::fill(self : Matrix, value : Double) -> Unit

Fill every entry with the same value.

#
Matrix::finite_or_zero

fn Matrix::finite_or_zero(self : Matrix) -> Matrix

#
Matrix::frobenius_norm

fn Matrix::frobenius_norm(self : Matrix) -> Double

Frobenius norm, useful for residual and convergence checks.

#
Matrix::from_flat

fn Matrix::from_flat(rows : Int, cols : Int, values : Array[Double]) -> Matrix

Construct a matrix from a flat row-major buffer. Short buffers are padded with zeroes and long buffers are safely truncated.

#
Matrix::from_rows

fn Matrix::from_rows(source : Array[Array[Double]]) -> Matrix

Construct a matrix from rows. Ragged rows are accepted and missing cells are filled with zero; use try_from_rows when shape validation is needed.

#
Matrix::get

fn Matrix::get(self : Matrix, row : Int, col : Int) -> Double

Read an entry. This method is intended for validated matrix operations; use try_get when coordinates originate outside the algorithm.

#
Matrix::gram

fn Matrix::gram(self : Matrix) -> Matrix

#
Matrix::hadamard

fn Matrix::hadamard(self : Matrix, other : Matrix) -> Matrix

#
Matrix::horizontal_concat

fn Matrix::horizontal_concat(self : Matrix, other : Matrix) -> Matrix

#
Matrix::identity

fn Matrix::identity(size : Int) -> Matrix

Construct an identity matrix.

#
Matrix::infinity_norm

fn Matrix::infinity_norm(self : Matrix) -> Double

Infinity norm: maximum absolute row sum.

#
Matrix::inverse

fn Matrix::inverse(self : Matrix) -> Matrix?

Invert a matrix with the same pivoting strategy used by solve.

#
Matrix::is_diagonally_dominant

fn Matrix::is_diagonally_dominant(self : Matrix, strict : Bool) -> Bool

#
Matrix::is_empty

fn Matrix::is_empty(self : Matrix) -> Bool

#
Matrix::is_finite

fn Matrix::is_finite(self : Matrix) -> Bool

#
Matrix::is_square

fn Matrix::is_square(self : Matrix) -> Bool

#
Matrix::jacobi_eigenvalues

fn Matrix::jacobi_eigenvalues(self : Matrix, sweeps : Int) -> Array[Double]

Jacobi sweeps for a symmetric matrix. It is intentionally bounded: a diagnostic should always return even for malformed field data.

#
Matrix::kronecker

fn Matrix::kronecker(self : Matrix, other : Matrix) -> Matrix

#
Matrix::least_squares

fn Matrix::least_squares(self : Matrix, rhs : Array[Double]) -> MatrixSolveResult

Least-squares solution using QR decomposition.

#
Matrix::map

fn Matrix::map(self : Matrix, f : (Double) -> Double) -> Matrix

Apply a scalar function to every entry.

#
Matrix::map_indexed

fn Matrix::map_indexed(self : Matrix, f : (Int, Int, Double) -> Double) -> Matrix

Apply a function with row and column coordinates to every entry.

#
Matrix::max_abs

fn Matrix::max_abs(self : Matrix) -> Double

#
Matrix::multiply

fn Matrix::multiply(self : Matrix, other : Matrix) -> Matrix

General dense matrix multiplication.

#
Matrix::multiply_vector

fn Matrix::multiply_vector(self : Matrix, vector : Array[Double]) -> Array[Double]

#
Matrix::one_norm

fn Matrix::one_norm(self : Matrix) -> Double

One norm: maximum absolute column sum.

#
Matrix::outer

fn Matrix::outer(left : Array[Double], right : Array[Double]) -> Matrix

#
Matrix::power

fn Matrix::power(self : Matrix, exponent : Int) -> Matrix

#
Matrix::qr_decompose

fn Matrix::qr_decompose(self : Matrix) -> (Matrix, Matrix)?

QR decomposition by modified Gram-Schmidt. The returned pair is (Q, R) with orthonormal columns in Q and an upper-triangular R.

#
Matrix::rank

fn Matrix::rank(self : Matrix, tolerance : Double) -> Int

Rank estimate based on pivot magnitudes.

#
Matrix::regularized_cholesky

fn Matrix::regularized_cholesky(self : Matrix, initial_jitter : Double, attempts : Int) -> (Matrix, Double)?

Add a small diagonal jitter until Cholesky succeeds or the budget is exhausted. This is useful for covariance matrices assembled from noisy samples.

#
Matrix::regularized_least_squares

fn Matrix::regularized_least_squares(self : Matrix, rhs : Array[Double], regularization : Double) -> MatrixSolveResult

Tikhonov-regularized least squares for rank-deficient design matrices.

#
Matrix::replace_block

fn Matrix::replace_block(self : Matrix, source : Matrix, row : Int, col : Int) -> Matrix

Replace a block in a copy of the matrix. The source must fit completely.

#
Matrix::row

fn Matrix::row(self : Matrix, index : Int) -> Array[Double]

Return the requested row as a new owned array.

#
Matrix::row_sums

fn Matrix::row_sums(self : Matrix) -> Array[Double]

#
Matrix::rows

fn Matrix::rows(self : Matrix) -> Int

#
Matrix::scale

fn Matrix::scale(self : Matrix, factor : Double) -> Matrix

#
Matrix::set

fn Matrix::set(self : Matrix, row : Int, col : Int, value : Double) -> Bool

Set an entry when coordinates are valid. Returns whether the write was performed.

#
Matrix::size

fn Matrix::size(self : Matrix) -> Int

#
Matrix::skew_part

fn Matrix::skew_part(self : Matrix) -> Matrix

#
Matrix::slice

fn Matrix::slice(self : Matrix, row_start : Int, row_end : Int, col_start : Int, col_end : Int) -> Matrix

Extract a submatrix using half-open row and column ranges.

#
Matrix::solve

fn Matrix::solve(self : Matrix, rhs : Array[Double]) -> MatrixSolveResult

Solve A x = b with partial pivoting.

#
Matrix::sub

fn Matrix::sub(self : Matrix, other : Matrix) -> Matrix

#
Matrix::symmetric_part

fn Matrix::symmetric_part(self : Matrix) -> Matrix

#
Matrix::to_rows

fn Matrix::to_rows(self : Matrix) -> Array[Array[Double]]

Convert to independent row arrays for interop and inspection.

#
Matrix::trace

fn Matrix::trace(self : Matrix) -> Double

#
Matrix::transpose

fn Matrix::transpose(self : Matrix) -> Matrix

#
Matrix::try_from_rows

fn Matrix::try_from_rows(source : Array[Array[Double]]) -> Matrix?

Construct a matrix only when all rows have the same width.

#
Matrix::try_get

fn Matrix::try_get(self : Matrix, row : Int, col : Int) -> Double?

Read an entry without risking an out-of-bounds panic.

#
Matrix::valid_index

fn Matrix::valid_index(self : Matrix, row : Int, col : Int) -> Bool

Return whether a pair of coordinates is safe to access.

#
Matrix::vertical_concat

fn Matrix::vertical_concat(self : Matrix, other : Matrix) -> Matrix

#
Matrix::with_diagonal

fn Matrix::with_diagonal(self : Matrix, values : Array[Double]) -> Matrix

#
Matrix::zeros

fn Matrix::zeros(rows : Int, cols : Int) -> Matrix

Construct a zero-filled matrix.

#
MatrixSolveResult

pub(all) enum MatrixSolveResult {
Solved(Array[Double])
Singular
InvalidShape
} derive(Eq,
Debug
)

A result returned by a matrix operation that may be singular.

#
MeasurementSchedule

pub struct MeasurementSchedule {
period : Int
elapsed : Int
}

#
MeasurementSchedule::elapsed

fn MeasurementSchedule::elapsed(self : MeasurementSchedule) -> Int

#
MeasurementSchedule::new

fn MeasurementSchedule::new(period : Int) -> MeasurementSchedule

#
MeasurementSchedule::period

fn MeasurementSchedule::period(self : MeasurementSchedule) -> Int

#
MeasurementSchedule::tick

fn MeasurementSchedule::tick(self : MeasurementSchedule) -> Bool

#
MeasurementWindow

pub struct MeasurementWindow {
measurements : Array[FusionMeasurement]
capacity : Int
dimension : Int
}

Bounded multi-sensor measurement collection.

#
MeasurementWindow::clear

fn MeasurementWindow::clear(self : MeasurementWindow) -> Unit

#
MeasurementWindow::fuse

#
MeasurementWindow::length

fn MeasurementWindow::length(self : MeasurementWindow) -> Int

#
MeasurementWindow::measurements

#
MeasurementWindow::new

fn MeasurementWindow::new(capacity : Int, dimension : Int) -> MeasurementWindow

#
MeasurementWindow::push

fn MeasurementWindow::push(self : MeasurementWindow, measurement : FusionMeasurement) -> Bool

#
MissingObservationAction

pub(all) enum MissingObservationAction {
PredictOnly
InflateAndPredict
HoldLastEstimate
} derive(Eq,
Debug
)

#
MissingObservationPolicy

pub struct MissingObservationPolicy {
max_consecutive : Int
inflate_factor : Double
action : MissingObservationAction
} derive(
Debug
)

#
MissingObservationPolicy::action

#
MissingObservationPolicy::inflate_factor

fn MissingObservationPolicy::inflate_factor(self : MissingObservationPolicy) -> Double

#
MissingObservationPolicy::max_consecutive

fn MissingObservationPolicy::max_consecutive(self : MissingObservationPolicy) -> Int

#
MissingObservationPolicy::new

fn MissingObservationPolicy::new(max_consecutive : Int, inflate_factor : Double, action : MissingObservationAction) -> MissingObservationPolicy

#
ModelRegistry

pub struct ModelRegistry {
dimension : Int
models : Array[LinearModel]
names : Array[String]
}

A reusable collection of linear models for a fixed state dimension.

#
ModelRegistry::add

fn ModelRegistry::add(self : ModelRegistry, name : String, model : LinearModel) -> Bool

#
ModelRegistry::clear

fn ModelRegistry::clear(self : ModelRegistry) -> Unit

#
ModelRegistry::length

fn ModelRegistry::length(self : ModelRegistry) -> Int

#
ModelRegistry::model

fn ModelRegistry::model(self : ModelRegistry, index : Int) -> LinearModel?

#
ModelRegistry::name

fn ModelRegistry::name(self : ModelRegistry, index : Int) -> String

#
ModelRegistry::names

fn ModelRegistry::names(self : ModelRegistry) -> Array[String]

#
ModelRegistry::new

fn ModelRegistry::new(dimension : Int) -> ModelRegistry

#
ModelScore

pub struct ModelScore {
name : String
rmse : Double
mae : Double
complexity : Int
consistency : Double
} derive(
Debug
)

Evidence collected while comparing a candidate model against observations.

#
ModelScore::complexity

fn ModelScore::complexity(self : ModelScore) -> Int

#
ModelScore::consistency

fn ModelScore::consistency(self : ModelScore) -> Double

#
ModelScore::mae

fn ModelScore::mae(self : ModelScore) -> Double

#
ModelScore::name

fn ModelScore::name(self : ModelScore) -> String

#
ModelScore::new

fn ModelScore::new(name : String, rmse : Double, mae : Double, complexity : Int, consistency : Double) -> ModelScore

#
ModelScore::objective

fn ModelScore::objective(self : ModelScore, complexity_penalty : Double) -> Double

#
ModelScore::rmse

fn ModelScore::rmse(self : ModelScore) -> Double

#
ModelSelector

pub struct ModelSelector {
scores : Array[ModelScore]
penalty : Double
}

#
ModelSelector::add

fn ModelSelector::add(self : ModelSelector, score : ModelScore) -> Unit

#
ModelSelector::best

#
ModelSelector::clear

fn ModelSelector::clear(self : ModelSelector) -> Unit

#
ModelSelector::length

fn ModelSelector::length(self : ModelSelector) -> Int

#
ModelSelector::new

fn ModelSelector::new(penalty : Double) -> ModelSelector

#
ModelSelector::penalty

fn ModelSelector::penalty(self : ModelSelector) -> Double

#
ModelSelector::ranking

#
ModelSelector::scores

#
ModelStep

pub struct ModelStep {
timestamp : Int
transition : Matrix
process_noise : Matrix
} derive(
Debug
)

#
ModelStep::new

fn ModelStep::new(timestamp : Int, transition : Matrix, process_noise : Matrix) -> ModelStep

#
ModelStep::process_noise

fn ModelStep::process_noise(self : ModelStep) -> Matrix

#
ModelStep::timestamp

fn ModelStep::timestamp(self : ModelStep) -> Int

#
ModelStep::transition

fn ModelStep::transition(self : ModelStep) -> Matrix

#
NoiseEstimate

pub struct NoiseEstimate {
variance : Double
standard_deviation : Double
samples : Int
confidence : Double
} derive(
Debug
)

Noise estimates inferred from paired truth/measurement samples.

#
NoiseEstimate::confidence

fn NoiseEstimate::confidence(self : NoiseEstimate) -> Double

#
NoiseEstimate::samples

fn NoiseEstimate::samples(self : NoiseEstimate) -> Int

#
NoiseEstimate::standard_deviation

fn NoiseEstimate::standard_deviation(self : NoiseEstimate) -> Double

#
NoiseEstimate::variance

fn NoiseEstimate::variance(self : NoiseEstimate) -> Double

#
NoiseSchedule

pub struct NoiseSchedule {
nominal : Double
minimum : Double
maximum : Double
growth : Double
decay : Double
factor : Double
stressed_steps : Int
}

A slowly adapting process-noise schedule. It reacts to sustained large innovations while decaying toward the nominal factor after recovery.

#
NoiseSchedule::factor

fn NoiseSchedule::factor(self : NoiseSchedule) -> Double

#
NoiseSchedule::new

fn NoiseSchedule::new(nominal : Double, minimum : Double, maximum : Double, growth : Double, decay : Double) -> NoiseSchedule

#
NoiseSchedule::observe

fn NoiseSchedule::observe(self : NoiseSchedule, nis : Double, threshold : Double) -> Double

#
NoiseSchedule::reset

fn NoiseSchedule::reset(self : NoiseSchedule) -> Unit

#
NoiseSchedule::stressed_steps

fn NoiseSchedule::stressed_steps(self : NoiseSchedule) -> Int

#
ObservationBuffer

pub struct ObservationBuffer {
packets : Array[ObservationPacket]
capacity : Int
}

A bounded packet queue. The oldest packet is dropped when capacity is reached, which is safer than allowing a delayed sensor to exhaust memory.

#
ObservationBuffer::capacity

fn ObservationBuffer::capacity(self : ObservationBuffer) -> Int

#
ObservationBuffer::clear

fn ObservationBuffer::clear(self : ObservationBuffer) -> Unit

#
ObservationBuffer::length

fn ObservationBuffer::length(self : ObservationBuffer) -> Int

#
ObservationBuffer::new

fn ObservationBuffer::new(capacity : Int) -> ObservationBuffer

#
ObservationBuffer::newest

#
ObservationBuffer::oldest

#
ObservationBuffer::packets

#
ObservationBuffer::push

fn ObservationBuffer::push(self : ObservationBuffer, packet : ObservationPacket) -> Bool

#
ObservationPacket

pub struct ObservationPacket {
timestamp : Int
sensor : String
values : Array[Double]
covariance : Matrix
} derive(
Debug
)

#
ObservationPacket::covariance

fn ObservationPacket::covariance(self : ObservationPacket) -> Matrix

#
ObservationPacket::is_valid

fn ObservationPacket::is_valid(self : ObservationPacket) -> Bool

#
ObservationPacket::new

fn ObservationPacket::new(timestamp : Int, sensor : String, values : Array[Double], covariance : Matrix) -> ObservationPacket

#
ObservationPacket::sensor

fn ObservationPacket::sensor(self : ObservationPacket) -> String

#
ObservationPacket::timestamp

fn ObservationPacket::timestamp(self : ObservationPacket) -> Int

#
ObservationPacket::values

fn ObservationPacket::values(self : ObservationPacket) -> Array[Double]

#
ObservationPacket::with_inflated_noise

fn ObservationPacket::with_inflated_noise(self : ObservationPacket, factor : Double) -> ObservationPacket

#
OperationalMonitor

pub struct OperationalMonitor {
samples : Int
accepted : Int
failures : Int
covariance_failures : Int
consecutive_failures : Int
worst_nis : Double
score : Double
warmup_samples : Int
failure_limit : Int
nis_limit : Double
}

Rolling health monitor suitable for long-running sensor services.

#
OperationalMonitor::accepted

fn OperationalMonitor::accepted(self : OperationalMonitor) -> Int

#
OperationalMonitor::consecutive_failures

fn OperationalMonitor::consecutive_failures(self : OperationalMonitor) -> Int

#
OperationalMonitor::covariance_failures

fn OperationalMonitor::covariance_failures(self : OperationalMonitor) -> Int

#
OperationalMonitor::failures

fn OperationalMonitor::failures(self : OperationalMonitor) -> Int

#
OperationalMonitor::new

fn OperationalMonitor::new(warmup_samples : Int, failure_limit : Int, nis_limit : Double) -> OperationalMonitor

#
OperationalMonitor::observe

fn OperationalMonitor::observe(self : OperationalMonitor, timestamp : Int, filter : KalmanND, result : UpdateResult) -> OperationalSnapshot

#
OperationalMonitor::reset

fn OperationalMonitor::reset(self : OperationalMonitor) -> Unit

#
OperationalMonitor::samples

fn OperationalMonitor::samples(self : OperationalMonitor) -> Int

#
OperationalMonitor::score

fn OperationalMonitor::score(self : OperationalMonitor) -> Double

#
OperationalMonitor::worst_nis

fn OperationalMonitor::worst_nis(self : OperationalMonitor) -> Double

#
OperationalSnapshot

pub struct OperationalSnapshot {
timestamp : Int
result : UpdateResult
status : FilterStatus
score : Double
nis : Double
state : Array[Double]
covariance : Matrix
} derive(
Debug
)

A point-in-time operational view. It is intentionally independent of a concrete filter type so it can be exported by a telemetry adapter.

#
OperationalSnapshot::covariance

#
OperationalSnapshot::nis

fn OperationalSnapshot::nis(self : OperationalSnapshot) -> Double

#
OperationalSnapshot::result

#
OperationalSnapshot::score

fn OperationalSnapshot::score(self : OperationalSnapshot) -> Double

#
OperationalSnapshot::state

fn OperationalSnapshot::state(self : OperationalSnapshot) -> Array[Double]

#
OperationalSnapshot::status

#
OperationalSnapshot::timestamp

fn OperationalSnapshot::timestamp(self : OperationalSnapshot) -> Int

#
OutlierDetector

pub struct OutlierDetector {
threshold : Double
stats : RunningStats
outlier_count : Int
}

#
OutlierDetector::new

fn OutlierDetector::new(threshold : Double) -> OutlierDetector

#
OutlierDetector::observe

fn OutlierDetector::observe(self : OutlierDetector, value : Double) -> Bool

#
OutlierDetector::outlier_count

fn OutlierDetector::outlier_count(self : OutlierDetector) -> Int

#
OutlierDetector::stats

#
PacketQuality

pub struct PacketQuality {
sensor : String
report : DataQualityReport
accepted : Bool
reason : String
} derive(
Debug
)

#
PacketQuality::accepted

fn PacketQuality::accepted(self : PacketQuality) -> Bool

#
PacketQuality::reason

fn PacketQuality::reason(self : PacketQuality) -> String

#
PacketQuality::report

#
PacketQuality::sensor

fn PacketQuality::sensor(self : PacketQuality) -> String

#
PipelineEvent

pub struct PipelineEvent {
fusion : FusionEvent
lifecycle : TrackLifecycle
sensor_score : Double
rolling_mean : Double
rolling_variance : Double
} derive(
Debug
)

End-to-end stream pipeline: preprocess packets, fuse a state estimate, and maintain lifecycle/health metadata for production telemetry.

#
PipelineEvent::fusion

#
PipelineEvent::lifecycle

fn PipelineEvent::lifecycle(self : PipelineEvent) -> TrackLifecycle

#
PipelineEvent::rolling_mean

fn PipelineEvent::rolling_mean(self : PipelineEvent) -> Double

#
PipelineEvent::rolling_variance

fn PipelineEvent::rolling_variance(self : PipelineEvent) -> Double

#
PipelineEvent::sensor_score

fn PipelineEvent::sensor_score(self : PipelineEvent) -> Double

#
PipelineReport

pub struct PipelineReport {
events : Int
accepted : Int
rejected : Int
missing : Int
final_lifecycle : TrackLifecycle
final_sensor_score : Double
} derive(
Debug
)

#
PipelineReport::accepted

fn PipelineReport::accepted(self : PipelineReport) -> Int

#
PipelineReport::events

fn PipelineReport::events(self : PipelineReport) -> Int

#
PipelineReport::final_lifecycle

fn PipelineReport::final_lifecycle(self : PipelineReport) -> TrackLifecycle

#
PipelineReport::final_sensor_score

fn PipelineReport::final_sensor_score(self : PipelineReport) -> Double

#
PipelineReport::missing

fn PipelineReport::missing(self : PipelineReport) -> Int

#
PipelineReport::rejected

fn PipelineReport::rejected(self : PipelineReport) -> Int

#
Pose2D

pub struct Pose2D {
x : Double
y : Double
heading : Double
} derive(
Debug
)

#
Pose2D::distance

fn Pose2D::distance(self : Pose2D, other : Pose2D) -> Double

#
Pose2D::heading

fn Pose2D::heading(self : Pose2D) -> Double

#
Pose2D::new

fn Pose2D::new(x : Double, y : Double, heading : Double) -> Pose2D

#
Pose2D::rotate

fn Pose2D::rotate(self : Pose2D, amount : Double) -> Pose2D

#
Pose2D::translate

fn Pose2D::translate(self : Pose2D, dx : Double, dy : Double) -> Pose2D

#
Pose2D::x

fn Pose2D::x(self : Pose2D) -> Double

#
Pose2D::y

fn Pose2D::y(self : Pose2D) -> Double

#
RangeMeasurement

pub struct RangeMeasurement {
reference : Array[Double]
value : Double
variance : Double
} derive(
Debug
)

#
RangeMeasurement::jacobian

fn RangeMeasurement::jacobian(self : RangeMeasurement, position : Array[Double]) -> Array[Double]

#
RangeMeasurement::new

fn RangeMeasurement::new(reference : Array[Double], value : Double, variance : Double) -> RangeMeasurement

#
RangeMeasurement::reference

fn RangeMeasurement::reference(self : RangeMeasurement) -> Array[Double]

#
RangeMeasurement::residual

fn RangeMeasurement::residual(self : RangeMeasurement, position : Array[Double]) -> Double

#
RangeMeasurement::value

fn RangeMeasurement::value(self : RangeMeasurement) -> Double

#
RangeMeasurement::variance

fn RangeMeasurement::variance(self : RangeMeasurement) -> Double

#
ReplayEvent

pub(all) enum ReplayEvent {
Predict(Int)
Measure(Int, Array[Double])
Missing(Int)
Restore(FilterCheckpoint)
} derive(
Debug
)

A timestamped action that can be applied to a linear filter. Keeping the action separate from the filter makes offline reproduction and incident investigation deterministic: the same event stream produces the same state stream.

#
ReplayRecord

pub struct ReplayRecord {
timestamp : Int
result : UpdateResult
state : Array[Double]
covariance : Matrix
nis : Double
} derive(
Debug
)

One durable observation of a replay step.

#
ReplayRecord::covariance

fn ReplayRecord::covariance(self : ReplayRecord) -> Matrix

#
ReplayRecord::new

fn ReplayRecord::new(timestamp : Int, result : UpdateResult, state : Array[Double], covariance : Matrix, nis : Double) -> ReplayRecord

#
ReplayRecord::nis

fn ReplayRecord::nis(self : ReplayRecord) -> Double

#
ReplayRecord::result

fn ReplayRecord::result(self : ReplayRecord) -> UpdateResult

#
ReplayRecord::state

fn ReplayRecord::state(self : ReplayRecord) -> Array[Double]

#
ReplayRecord::timestamp

fn ReplayRecord::timestamp(self : ReplayRecord) -> Int

#
ReplayReport

pub struct ReplayReport {
steps : Int
accepted : Int
rejected : Int
missing : Int
invalid : Int
final_timestamp : Int
final_state : Array[Double]
final_covariance : Matrix
} derive(
Debug
)

Counts and records accumulated by a replay session.

#
ReplayReport::accepted

fn ReplayReport::accepted(self : ReplayReport) -> Int

#
ReplayReport::final_covariance

fn ReplayReport::final_covariance(self : ReplayReport) -> Matrix

#
ReplayReport::final_state

fn ReplayReport::final_state(self : ReplayReport) -> Array[Double]

#
ReplayReport::final_timestamp

fn ReplayReport::final_timestamp(self : ReplayReport) -> Int

#
ReplayReport::invalid

fn ReplayReport::invalid(self : ReplayReport) -> Int

#
ReplayReport::missing

fn ReplayReport::missing(self : ReplayReport) -> Int

#
ReplayReport::rejected

fn ReplayReport::rejected(self : ReplayReport) -> Int

#
ReplayReport::steps

fn ReplayReport::steps(self : ReplayReport) -> Int

#
ReplaySession

pub struct ReplaySession {
filter : KalmanND
trace : ReplayTrace
timestamp : Int
steps : Int
accepted : Int
rejected : Int
missing : Int
invalid : Int
}

Stateful replay runner for KalmanND. A runner owns its filter so callers can replay a log without mutating the production filter used elsewhere.

#
ReplaySession::accepted

fn ReplaySession::accepted(self : ReplaySession) -> Int

#
ReplaySession::filter

fn ReplaySession::filter(self : ReplaySession) -> KalmanND

#
ReplaySession::invalid

fn ReplaySession::invalid(self : ReplaySession) -> Int

#
ReplaySession::missing

fn ReplaySession::missing(self : ReplaySession) -> Int

#
ReplaySession::new

fn ReplaySession::new(filter : KalmanND, trace_capacity : Int) -> ReplaySession

#
ReplaySession::rejected

fn ReplaySession::rejected(self : ReplaySession) -> Int

#
ReplaySession::report

#
ReplaySession::reset

fn ReplaySession::reset(self : ReplaySession) -> Unit

#
ReplaySession::run

#
ReplaySession::step

#
ReplaySession::steps

fn ReplaySession::steps(self : ReplaySession) -> Int

#
ReplaySession::timestamp

fn ReplaySession::timestamp(self : ReplaySession) -> Int

#
ReplaySession::trace

#
ReplayTrace

pub struct ReplayTrace {
records : Array[ReplayRecord]
capacity : Int
}

An append-only, bounded replay ledger. The bounded mode is useful for embedded applications where a diagnostic trail must not grow forever.

#
ReplayTrace::capacity

fn ReplayTrace::capacity(self : ReplayTrace) -> Int

#
ReplayTrace::clear

fn ReplayTrace::clear(self : ReplayTrace) -> Unit

#
ReplayTrace::first

fn ReplayTrace::first(self : ReplayTrace) -> ReplayRecord?

#
ReplayTrace::last

fn ReplayTrace::last(self : ReplayTrace) -> ReplayRecord?

#
ReplayTrace::length

fn ReplayTrace::length(self : ReplayTrace) -> Int

#
ReplayTrace::new

fn ReplayTrace::new(capacity : Int) -> ReplayTrace

#
ReplayTrace::records

fn ReplayTrace::records(self : ReplayTrace) -> Array[ReplayRecord]

#
ResidualAction

pub(all) enum ResidualAction {
Accept
Downweight(Double)
Reject
} derive(Eq,
Debug
)

A robust residual policy used before a measurement enters a filter.

#
ResidualPolicy

pub struct ResidualPolicy {
soft_limit : Double
hard_limit : Double
minimum_weight : Double
accepted : Int
downweighted : Int
rejected : Int
}

#
ResidualPolicy::accepted

fn ResidualPolicy::accepted(self : ResidualPolicy) -> Int

#
ResidualPolicy::classify

fn ResidualPolicy::classify(self : ResidualPolicy, residual : Double) -> ResidualAction

#
ResidualPolicy::downweighted

fn ResidualPolicy::downweighted(self : ResidualPolicy) -> Int

#
ResidualPolicy::hard_limit

fn ResidualPolicy::hard_limit(self : ResidualPolicy) -> Double

#
ResidualPolicy::minimum_weight

fn ResidualPolicy::minimum_weight(self : ResidualPolicy) -> Double

#
ResidualPolicy::new

fn ResidualPolicy::new(soft_limit : Double, hard_limit : Double, minimum_weight : Double) -> ResidualPolicy

#
ResidualPolicy::rejected

fn ResidualPolicy::rejected(self : ResidualPolicy) -> Int

#
ResidualPolicy::reset

fn ResidualPolicy::reset(self : ResidualPolicy) -> Unit

#
ResidualPolicy::soft_limit

fn ResidualPolicy::soft_limit(self : ResidualPolicy) -> Double

#
RollingWindow

pub struct RollingWindow {
capacity : Int
values : Array[Double]
}

A bounded feature window for streaming sensor preprocessing.

#
RollingWindow::capacity

fn RollingWindow::capacity(self : RollingWindow) -> Int

#
RollingWindow::length

fn RollingWindow::length(self : RollingWindow) -> Int

#
RollingWindow::maximum

fn RollingWindow::maximum(self : RollingWindow) -> Double

#
RollingWindow::mean

fn RollingWindow::mean(self : RollingWindow) -> Double

#
RollingWindow::minimum

fn RollingWindow::minimum(self : RollingWindow) -> Double

#
RollingWindow::new

fn RollingWindow::new(capacity : Int) -> RollingWindow

#
RollingWindow::push

fn RollingWindow::push(self : RollingWindow, value : Double) -> Unit

#
RollingWindow::values

fn RollingWindow::values(self : RollingWindow) -> Array[Double]

#
RollingWindow::variance

fn RollingWindow::variance(self : RollingWindow) -> Double

#
RunningStats

pub struct RunningStats {
count : Int
mean : Double
second_moment : Double
minimum : Double
maximum : Double
}

Numerically stable streaming mean and variance using Welford's update.

#
RunningStats::add

fn RunningStats::add(self : RunningStats, value : Double) -> Unit

#
RunningStats::count

fn RunningStats::count(self : RunningStats) -> Int

#
RunningStats::maximum

fn RunningStats::maximum(self : RunningStats) -> Double

#
RunningStats::mean

fn RunningStats::mean(self : RunningStats) -> Double

#
RunningStats::minimum

fn RunningStats::minimum(self : RunningStats) -> Double

#
RunningStats::new

#
RunningStats::reset

fn RunningStats::reset(self : RunningStats) -> Unit

#
RunningStats::standard_deviation

fn RunningStats::standard_deviation(self : RunningStats) -> Double

#
RunningStats::variance

fn RunningStats::variance(self : RunningStats) -> Double

#
RunningStats::z_score

fn RunningStats::z_score(self : RunningStats, value : Double) -> Double

#
ScalarCalibration

pub struct ScalarCalibration {
measurement : NoiseEstimate
process : NoiseEstimate
recommended_process_noise : Double
recommended_measurement_noise : Double
} derive(
Debug
)

#
ScalarCalibration::measurement

#
ScalarCalibration::process

#
ScalarCalibration::recommended_measurement_noise

fn ScalarCalibration::recommended_measurement_noise(self : ScalarCalibration) -> Double

#
ScalarCalibration::recommended_process_noise

fn ScalarCalibration::recommended_process_noise(self : ScalarCalibration) -> Double

#
SensorCalibrator

pub struct SensorCalibrator {
dimension : Int
samples : Int
sum : Array[Double]
sum_squared : Matrix
}

Estimate an affine offset from reference-aligned samples.

#
SensorCalibrator::add

fn SensorCalibrator::add(self : SensorCalibrator, raw : Array[Double], reference : Array[Double]) -> Bool

#
SensorCalibrator::dimension

fn SensorCalibrator::dimension(self : SensorCalibrator) -> Int

#
SensorCalibrator::error_covariance

fn SensorCalibrator::error_covariance(self : SensorCalibrator) -> Matrix

#
SensorCalibrator::new

fn SensorCalibrator::new(dimension : Int) -> SensorCalibrator

#
SensorCalibrator::offset

fn SensorCalibrator::offset(self : SensorCalibrator) -> Array[Double]

#
SensorCalibrator::reset

fn SensorCalibrator::reset(self : SensorCalibrator) -> Unit

#
SensorCalibrator::samples

fn SensorCalibrator::samples(self : SensorCalibrator) -> Int

#
SensorCalibrator::transform

#
SensorClock

pub struct SensorClock {
period : Int
last_timestamp : Int?
samples : Int
late : Int
early : Int
jitter : RunningStats
}

Timestamp discipline and jitter statistics for an input channel.

#
SensorClock::early

fn SensorClock::early(self : SensorClock) -> Int

#
SensorClock::jitter_mean

fn SensorClock::jitter_mean(self : SensorClock) -> Double

#
SensorClock::jitter_variance

fn SensorClock::jitter_variance(self : SensorClock) -> Double

#
SensorClock::last_timestamp

fn SensorClock::last_timestamp(self : SensorClock) -> Int?

#
SensorClock::late

fn SensorClock::late(self : SensorClock) -> Int

#
SensorClock::new

fn SensorClock::new(period : Int) -> SensorClock

#
SensorClock::observe

fn SensorClock::observe(self : SensorClock, timestamp : Int) -> Bool

#
SensorClock::period

fn SensorClock::period(self : SensorClock) -> Int

#
SensorClock::reset

fn SensorClock::reset(self : SensorClock) -> Unit

#
SensorClock::samples

fn SensorClock::samples(self : SensorClock) -> Int

#
SensorConfiguration

pub struct SensorConfiguration {
name : String
dimension : Int
period : Int
timeout : Int
covariance : Matrix
enabled : Bool
} derive(
Debug
)

Static configuration for a sensor channel.

#
SensorConfiguration::covariance

#
SensorConfiguration::dimension

fn SensorConfiguration::dimension(self : SensorConfiguration) -> Int

#
SensorConfiguration::enabled

fn SensorConfiguration::enabled(self : SensorConfiguration) -> Bool

#
SensorConfiguration::name

fn SensorConfiguration::name(self : SensorConfiguration) -> String

#
SensorConfiguration::new

fn SensorConfiguration::new(name : String, dimension : Int, period : Int, timeout : Int, covariance : Matrix) -> SensorConfiguration

#
SensorConfiguration::period

fn SensorConfiguration::period(self : SensorConfiguration) -> Int

#
SensorConfiguration::set_enabled

fn SensorConfiguration::set_enabled(self : SensorConfiguration, enabled : Bool) -> Unit

#
SensorConfiguration::timeout

fn SensorConfiguration::timeout(self : SensorConfiguration) -> Int

#
SensorConfiguration::with_covariance

fn SensorConfiguration::with_covariance(self : SensorConfiguration, covariance : Matrix) -> SensorConfiguration

#
SensorFusion

pub struct SensorFusion {
filter : KalmanND
policy : FusionPolicy
statistics : FusionStatistics
consecutive_missing : Int
}

#
SensorFusion::covariance

fn SensorFusion::covariance(self : SensorFusion) -> Matrix

#
SensorFusion::new

fn SensorFusion::new(filter : KalmanND, policy : FusionPolicy) -> SensorFusion

#
SensorFusion::predict

fn SensorFusion::predict(self : SensorFusion) -> Unit

#
SensorFusion::process

fn SensorFusion::process(self : SensorFusion, packet : ObservationPacket) -> FusionEvent

#
SensorFusion::process_missing

fn SensorFusion::process_missing(self : SensorFusion, timestamp : Int, sensor : String) -> FusionEvent

#
SensorFusion::reset

fn SensorFusion::reset(self : SensorFusion) -> Unit

#
SensorFusion::run

#
SensorFusion::set_gate_threshold

fn SensorFusion::set_gate_threshold(self : SensorFusion, threshold : Double) -> Unit

#
SensorFusion::state

fn SensorFusion::state(self : SensorFusion) -> Array[Double]

#
SensorFusion::statistics

fn SensorFusion::statistics(self : SensorFusion) -> FusionStatistics

#
SensorHealth

pub struct SensorHealth {
name : String
score : Double
decay : Double
recovery : Double
minimum_score : Double
accepted : Int
rejected : Int
}

Per-sensor health state. It can be used to down-weight or disable a sensor before its failures destabilize a global track.

#
SensorHealth::accepted

fn SensorHealth::accepted(self : SensorHealth) -> Int

#
SensorHealth::is_usable

fn SensorHealth::is_usable(self : SensorHealth, threshold : Double) -> Bool

#
SensorHealth::name

fn SensorHealth::name(self : SensorHealth) -> String

#
SensorHealth::new

fn SensorHealth::new(name : String, decay : Double, recovery : Double) -> SensorHealth

#
SensorHealth::observe

fn SensorHealth::observe(self : SensorHealth, result : UpdateResult) -> Unit

#
SensorHealth::rejected

fn SensorHealth::rejected(self : SensorHealth) -> Int

#
SensorHealth::score

fn SensorHealth::score(self : SensorHealth) -> Double

#
SensorModelPair

pub struct SensorModelPair {
position : LinearModel
velocity : LinearModel
} derive(
Debug
)

A pair of models for position and velocity sensors sharing one state.

#
SensorModelPair::constant_velocity

fn SensorModelPair::constant_velocity(dimensions : Int, dt : Double, acceleration_variance : Double, position_variance : Double, velocity_variance : Double) -> SensorModelPair

#
SensorModelPair::position

#
SensorModelPair::velocity

#
SensorPacketBuilder

pub struct SensorPacketBuilder {
configuration : SensorConfiguration
calibration : CalibrationTransform
built : Int
rejected : Int
}

Builder for validated packets with a reusable calibration transform.

#
SensorPacketBuilder::build

fn SensorPacketBuilder::build(self : SensorPacketBuilder, timestamp : Int, values : Array[Double]) -> ObservationPacket?

#
SensorPacketBuilder::built

fn SensorPacketBuilder::built(self : SensorPacketBuilder) -> Int

#
SensorPacketBuilder::configuration

#
SensorPacketBuilder::new

#
SensorPacketBuilder::rejected

fn SensorPacketBuilder::rejected(self : SensorPacketBuilder) -> Int

#
SensorPacketBuilder::reset

fn SensorPacketBuilder::reset(self : SensorPacketBuilder) -> Unit

#
SensorPacketBuilder::set_calibration

fn SensorPacketBuilder::set_calibration(self : SensorPacketBuilder, calibration : CalibrationTransform) -> Bool

#
SensorPipeline

pub struct SensorPipeline {
fusion : SensorFusion
tracker : TrackManager
health : Map[String, SensorHealth]
windows : Map[String, RollingWindow]
window_capacity : Int
}

#
SensorPipeline::lifecycle

#
SensorPipeline::new

fn SensorPipeline::new(fusion : SensorFusion, confirmation_hits : Int, deletion_misses : Int, window_capacity : Int) -> SensorPipeline

#
SensorPipeline::process

#
SensorPipeline::process_missing

fn SensorPipeline::process_missing(self : SensorPipeline, timestamp : Int, sensor : String) -> PipelineEvent

#
SensorPipeline::run

#
SensorPipeline::sensor_health

fn SensorPipeline::sensor_health(self : SensorPipeline, sensor : String) -> SensorHealth

#
SensorPipeline::window

fn SensorPipeline::window(self : SensorPipeline, sensor : String) -> RollingWindow

#
SensorSample

pub struct SensorSample {
timestamp : Int
truth : Array[Double]
measurement : Array[Double]
missing : Bool
outlier : Bool
} derive(
Debug
)

#
SensorSample::measurement

fn SensorSample::measurement(self : SensorSample) -> Array[Double]

#
SensorSample::missing

fn SensorSample::missing(self : SensorSample) -> Bool

#
SensorSample::new

fn SensorSample::new(timestamp : Int, truth : Array[Double], measurement : Array[Double], missing : Bool, outlier : Bool) -> SensorSample

#
SensorSample::outlier

fn SensorSample::outlier(self : SensorSample) -> Bool

#
SensorSample::timestamp

fn SensorSample::timestamp(self : SensorSample) -> Int

#
SensorSample::truth

fn SensorSample::truth(self : SensorSample) -> Array[Double]

#
SimulationResult

pub struct SimulationResult {
samples : Array[SensorSample]
truth : Array[Array[Double]]
estimates : Array[Array[Double]]
metrics : ErrorMetrics
} derive(
Debug
)

#
SimulationResult::estimates

fn SimulationResult::estimates(self : SimulationResult) -> Array[Array[Double]]

#
SimulationResult::metrics

#
SimulationResult::samples

#
SimulationResult::truth

fn SimulationResult::truth(self : SimulationResult) -> Array[Array[Double]]

#
SmoothingResult

pub struct SmoothingResult {
states : Array[Array[Double]]
covariances : Array[Matrix]
} derive(
Debug
)

Result of a Rauch-Tung-Striebel backward pass.

#
SmoothingResult::covariances

fn SmoothingResult::covariances(self : SmoothingResult) -> Array[Matrix]

#
SmoothingResult::length

fn SmoothingResult::length(self : SmoothingResult) -> Int

#
SmoothingResult::states

fn SmoothingResult::states(self : SmoothingResult) -> Array[Array[Double]]

#
StateCandidate

pub struct StateCandidate {
name : String
state : Array[Double]
covariance : Matrix
weight : Double
result : UpdateResult
} derive(
Debug
)

A weighted state candidate used to compare independent estimators.

#
StateCandidate::covariance

fn StateCandidate::covariance(self : StateCandidate) -> Matrix

#
StateCandidate::is_usable

fn StateCandidate::is_usable(self : StateCandidate) -> Bool

#
StateCandidate::name

fn StateCandidate::name(self : StateCandidate) -> String

#
StateCandidate::new

fn StateCandidate::new(name : String, state : Array[Double], covariance : Matrix, weight : Double, result : UpdateResult) -> StateCandidate

#
StateCandidate::result

#
StateCandidate::state

fn StateCandidate::state(self : StateCandidate) -> Array[Double]

#
StateCandidate::weight

fn StateCandidate::weight(self : StateCandidate) -> Double

#
Synchronizer

pub struct Synchronizer {
tolerance : Int
last_timestamp : Int?
accepted : Int
rejected : Int
}

#
Synchronizer::accept

fn Synchronizer::accept(self : Synchronizer, timestamp : Int) -> Bool

#
Synchronizer::accepted

fn Synchronizer::accepted(self : Synchronizer) -> Int

#
Synchronizer::last_timestamp

fn Synchronizer::last_timestamp(self : Synchronizer) -> Int?

#
Synchronizer::new

fn Synchronizer::new(tolerance : Int) -> Synchronizer

#
Synchronizer::rejected

fn Synchronizer::rejected(self : Synchronizer) -> Int

#
Synchronizer::reset

fn Synchronizer::reset(self : Synchronizer) -> Unit

#
Synchronizer::tolerance

fn Synchronizer::tolerance(self : Synchronizer) -> Int

#
TelemetrySample

pub struct TelemetrySample {
timestamp : Int
channel : String
value : Double
quality : Double
result : UpdateResult
} derive(
Debug
)

A lightweight scalar telemetry record for dashboards and field logs.

#
TelemetrySample::channel

fn TelemetrySample::channel(self : TelemetrySample) -> String

#
TelemetrySample::is_finite

fn TelemetrySample::is_finite(self : TelemetrySample) -> Bool

#
TelemetrySample::new

fn TelemetrySample::new(timestamp : Int, channel : String, value : Double, quality : Double, result : UpdateResult) -> TelemetrySample

#
TelemetrySample::quality

fn TelemetrySample::quality(self : TelemetrySample) -> Double

#
TelemetrySample::result

#
TelemetrySample::timestamp

fn TelemetrySample::timestamp(self : TelemetrySample) -> Int

#
TelemetrySample::value

fn TelemetrySample::value(self : TelemetrySample) -> Double

#
TelemetrySeries

pub struct TelemetrySeries {
samples : Array[TelemetrySample]
capacity : Int
rejected : Int
}

#
TelemetrySeries::duration

fn TelemetrySeries::duration(self : TelemetrySeries) -> Int

#
TelemetrySeries::length

fn TelemetrySeries::length(self : TelemetrySeries) -> Int

#
TelemetrySeries::mean

fn TelemetrySeries::mean(self : TelemetrySeries) -> Double

#
TelemetrySeries::new

fn TelemetrySeries::new(capacity : Int) -> TelemetrySeries

#
TelemetrySeries::push

fn TelemetrySeries::push(self : TelemetrySeries, sample : TelemetrySample) -> Bool

#
TelemetrySeries::quality

fn TelemetrySeries::quality(self : TelemetrySeries) -> Double

#
TelemetrySeries::rejected

fn TelemetrySeries::rejected(self : TelemetrySeries) -> Int

#
TelemetrySeries::reset

fn TelemetrySeries::reset(self : TelemetrySeries) -> Unit

#
TelemetrySeries::samples

#
TelemetrySeries::variance

fn TelemetrySeries::variance(self : TelemetrySeries) -> Double

#
TelemetrySummary

pub struct TelemetrySummary {
samples : Int
accepted : Int
missing : Int
rejected : Int
mean : Double
variance : Double
quality : Double
status : FilterStatus
} derive(
Debug
)

#
TelemetrySummary::accepted

fn TelemetrySummary::accepted(self : TelemetrySummary) -> Int

#
TelemetrySummary::mean

fn TelemetrySummary::mean(self : TelemetrySummary) -> Double

#
TelemetrySummary::missing

fn TelemetrySummary::missing(self : TelemetrySummary) -> Int

#
TelemetrySummary::quality

fn TelemetrySummary::quality(self : TelemetrySummary) -> Double

#
TelemetrySummary::rejected

fn TelemetrySummary::rejected(self : TelemetrySummary) -> Int

#
TelemetrySummary::samples

fn TelemetrySummary::samples(self : TelemetrySummary) -> Int

#
TelemetrySummary::status

#
TelemetrySummary::variance

fn TelemetrySummary::variance(self : TelemetrySummary) -> Double

#
TrackLifecycle

pub(all) enum TrackLifecycle {
Tentative
Confirmed
Lost
Deleted
} derive(Eq,
Debug
)

Estimate lifecycle used by a tracker manager.

#
TrackManager

pub struct TrackManager {
lifecycle : TrackLifecycle
confirmation_hits : Int
deletion_misses : Int
hits : Int
misses : Int
age : Int
}

#
TrackManager::age

fn TrackManager::age(self : TrackManager) -> Int

#
TrackManager::hits

fn TrackManager::hits(self : TrackManager) -> Int

#
TrackManager::lifecycle

fn TrackManager::lifecycle(self : TrackManager) -> TrackLifecycle

#
TrackManager::misses

fn TrackManager::misses(self : TrackManager) -> Int

#
TrackManager::new

fn TrackManager::new(confirmation_hits : Int, deletion_misses : Int) -> TrackManager

#
TrackManager::observe

fn TrackManager::observe(self : TrackManager, result : UpdateResult) -> TrackLifecycle

#
TrackManager::reset

fn TrackManager::reset(self : TrackManager) -> Unit

#
TrajectoryBuffer

pub struct TrajectoryBuffer {
points : Array[TrajectoryPoint]
capacity : Int
rejected : Int
}

Bounded trajectory history with monotonic timestamp protection.

#
TrajectoryBuffer::capacity

fn TrajectoryBuffer::capacity(self : TrajectoryBuffer) -> Int

#
TrajectoryBuffer::clear

fn TrajectoryBuffer::clear(self : TrajectoryBuffer) -> Unit

#
TrajectoryBuffer::duration

fn TrajectoryBuffer::duration(self : TrajectoryBuffer) -> Int

#
TrajectoryBuffer::first

#
TrajectoryBuffer::last

#
TrajectoryBuffer::length

fn TrajectoryBuffer::length(self : TrajectoryBuffer) -> Int

#
TrajectoryBuffer::new

fn TrajectoryBuffer::new(capacity : Int) -> TrajectoryBuffer

#
TrajectoryBuffer::points

#
TrajectoryBuffer::push

fn TrajectoryBuffer::push(self : TrajectoryBuffer, point : TrajectoryPoint) -> Bool

#
TrajectoryBuffer::rejected

fn TrajectoryBuffer::rejected(self : TrajectoryBuffer) -> Int

#
TrajectoryPoint

pub struct TrajectoryPoint {
timestamp : Int
position : Array[Double]
velocity : Array[Double]
covariance : Matrix
} derive(
Debug
)

A timestamped state used by offline analysis and path-quality metrics.

#
TrajectoryPoint::covariance

fn TrajectoryPoint::covariance(self : TrajectoryPoint) -> Matrix

#
TrajectoryPoint::dimension

fn TrajectoryPoint::dimension(self : TrajectoryPoint) -> Int

#
TrajectoryPoint::is_valid

fn TrajectoryPoint::is_valid(self : TrajectoryPoint) -> Bool

#
TrajectoryPoint::new

fn TrajectoryPoint::new(timestamp : Int, position : Array[Double], velocity : Array[Double], covariance : Matrix) -> TrajectoryPoint

#
TrajectoryPoint::position

fn TrajectoryPoint::position(self : TrajectoryPoint) -> Array[Double]

#
TrajectoryPoint::timestamp

fn TrajectoryPoint::timestamp(self : TrajectoryPoint) -> Int

#
TrajectoryPoint::velocity

fn TrajectoryPoint::velocity(self : TrajectoryPoint) -> Array[Double]

#
UKF

pub struct UKF {
x : Array[Double]
p : Matrix
q : Matrix
r : Matrix
initial_state : Array[Double]
initial_covariance : Matrix
alpha : Double
beta : Double
kappa : Double
predicted_sigma_points : Array[Array[Double]]
last_innovation : Array[Double]
last_innovation_covariance : Matrix
last_gain : Matrix
last_nis : Double
gate_threshold : Double
predict_count : Int
accepted_count : Int
rejected_count : Int
missing_count : Int
}

Unscented Kalman Filter using scaled sigma points.

UKF is useful when a model is smooth but its Jacobian is inconvenient to derive. The implementation falls back to diagonal spread when a noisy covariance is not Cholesky-decomposable, keeping an edge device alive while diagnostics can report the covariance issue separately.

#
UKF::accepted_count

fn UKF::accepted_count(self : UKF) -> Int

#
UKF::covariance

fn UKF::covariance(self : UKF) -> Matrix

#
UKF::filter

fn UKF::filter(self : UKF, measurements : Array[Array[Double]], f : (Array[Double]) -> Array[Double], h : (Array[Double]) -> Array[Double]) -> Array[Array[Double]]

#
UKF::gate_threshold

fn UKF::gate_threshold(self : UKF) -> Double

#
UKF::innovation

fn UKF::innovation(self : UKF) -> Array[Double]

#
UKF::innovation_covariance

fn UKF::innovation_covariance(self : UKF) -> Matrix

#
UKF::kalman_gain

fn UKF::kalman_gain(self : UKF) -> Matrix

#
UKF::missing_count

fn UKF::missing_count(self : UKF) -> Int

#
UKF::new

fn UKF::new(initial_state : Array[Double], initial_covariance : Array[Array[Double]], process_noise : Array[Array[Double]], measurement_noise : Array[Array[Double]]) -> UKF

#
UKF::normalized_innovation_squared

fn UKF::normalized_innovation_squared(self : UKF) -> Double

#
UKF::parameters

fn UKF::parameters(self : UKF) -> (Double, Double, Double)

#
UKF::predict

fn UKF::predict(self : UKF, f : (Array[Double]) -> Array[Double]) -> Unit

#
UKF::predict_count

fn UKF::predict_count(self : UKF) -> Int

#
UKF::predict_with_control

fn UKF::predict_with_control(self : UKF, f : (Array[Double], Array[Double]) -> Array[Double], control : Array[Double]) -> Unit

#
UKF::rejected_count

fn UKF::rejected_count(self : UKF) -> Int

#
UKF::reset

fn UKF::reset(self : UKF) -> Unit

#
UKF::set_gate_threshold

fn UKF::set_gate_threshold(self : UKF, threshold : Double) -> Unit

#
UKF::set_parameters

fn UKF::set_parameters(self : UKF, alpha : Double, beta : Double, kappa : Double) -> Unit

#
UKF::state

fn UKF::state(self : UKF) -> Array[Double]

#
UKF::update

fn UKF::update(self : UKF, z : Array[Double], h : (Array[Double]) -> Array[Double]) -> UpdateResult

#
UKF::update_gated

fn UKF::update_gated(self : UKF, z : Array[Double], h : (Array[Double]) -> Array[Double], threshold : Double) -> UpdateResult

#
UKF::update_missing

fn UKF::update_missing(self : UKF) -> UpdateResult

#
UpdateResult

pub(all) enum UpdateResult {
Accepted
RejectedByGate
InvalidMeasurement
SingularInnovation
MissingMeasurement
} derive(Eq,
Debug
)

Result of a measurement update.

#
UpdateSummary

pub struct UpdateSummary {
result : UpdateResult
innovation : Array[Double]
innovation_covariance : Matrix
normalized_innovation_squared : Double
} derive(
Debug
)

A compact record of the latest update, useful for telemetry and debugging.

#
UpdateSummary::innovation

fn UpdateSummary::innovation(self : UpdateSummary) -> Array[Double]

#
UpdateSummary::innovation_covariance

fn UpdateSummary::innovation_covariance(self : UpdateSummary) -> Matrix

#
UpdateSummary::nis

fn UpdateSummary::nis(self : UpdateSummary) -> Double

#
UpdateSummary::result

#
ValidationReport

pub struct ValidationReport {
name : String
checks : Int
passed : Int
issues : Array[ContractIssue]
}

#
ValidationReport::check

fn ValidationReport::check(self : ValidationReport, code : String, condition : Bool, severity : ContractSeverity, message : String) -> Bool

#
ValidationReport::checks

fn ValidationReport::checks(self : ValidationReport) -> Int

#
ValidationReport::failed

fn ValidationReport::failed(self : ValidationReport) -> Int

#
ValidationReport::is_valid

fn ValidationReport::is_valid(self : ValidationReport) -> Bool

#
ValidationReport::issues

#
ValidationReport::name

fn ValidationReport::name(self : ValidationReport) -> String

#
ValidationReport::new

fn ValidationReport::new(name : String) -> ValidationReport

#
ValidationReport::passed

fn ValidationReport::passed(self : ValidationReport) -> Int

#
ValidationReport::reset

fn ValidationReport::reset(self : ValidationReport) -> Unit

#
ValidationReport::score

fn ValidationReport::score(self : ValidationReport) -> Double

#
VectorAccumulator

pub struct VectorAccumulator {
dimension : Int
count : Int
mean : Array[Double]
scatter : Matrix
}

Online vector statistics using a numerically stable rank-one update.

#
VectorAccumulator::add

fn VectorAccumulator::add(self : VectorAccumulator, sample : Array[Double]) -> Bool

#
VectorAccumulator::count

fn VectorAccumulator::count(self : VectorAccumulator) -> Int

#
VectorAccumulator::covariance

fn VectorAccumulator::covariance(self : VectorAccumulator) -> Matrix

#
VectorAccumulator::dimension

fn VectorAccumulator::dimension(self : VectorAccumulator) -> Int

#
VectorAccumulator::mean

fn VectorAccumulator::mean(self : VectorAccumulator) -> Array[Double]

#
VectorAccumulator::new

fn VectorAccumulator::new(dimension : Int) -> VectorAccumulator

#
VectorAccumulator::reset

fn VectorAccumulator::reset(self : VectorAccumulator) -> Unit

#
VectorAccumulator::standard_deviation

fn VectorAccumulator::standard_deviation(self : VectorAccumulator) -> Array[Double]

#
WeightedAccumulator

pub struct WeightedAccumulator {
dimension : Int
total_weight : Double
weighted_sum : Array[Double]
}

A weighted mean useful for blending calibrated sensor channels.

#
WeightedAccumulator::add

fn WeightedAccumulator::add(self : WeightedAccumulator, value : Array[Double], weight : Double) -> Bool

#
WeightedAccumulator::dimension

fn WeightedAccumulator::dimension(self : WeightedAccumulator) -> Int

#
WeightedAccumulator::mean

fn WeightedAccumulator::mean(self : WeightedAccumulator) -> Array[Double]

#
WeightedAccumulator::new

fn WeightedAccumulator::new(dimension : Int) -> WeightedAccumulator

#
WeightedAccumulator::reset

fn WeightedAccumulator::reset(self : WeightedAccumulator) -> Unit

#
WeightedAccumulator::weight

fn WeightedAccumulator::weight(self : WeightedAccumulator) -> Double

#
acceleration_observation

fn acceleration_observation(dimensions : Int, component : Int) -> Matrix

Observe position, velocity, or both from a constant-acceleration state.

#
angle_difference

fn angle_difference(target : Double, source : Double) -> Double

#
assess_packet

fn assess_packet(packet : ObservationPacket, minimum_finite_fraction : Double) -> PacketQuality

#
assess_sensor_samples

fn assess_sensor_samples(samples : Array[SensorSample]) -> DataQualityReport

#
calibrate_scalar

fn calibrate_scalar(measurements : Array[Double], expected : Array[Double], spacing : Double, minimum_noise : Double) -> ScalarCalibration

#
candidate_from_filter

fn candidate_from_filter(name : String, filter : KalmanND, result : UpdateResult, confidence : Double) -> StateCandidate

#
candidate_from_scalar

fn candidate_from_scalar(name : String, filter : Kalman1D, result : UpdateResult, confidence : Double) -> StateCandidate

#
clamp_state_to_bounds

fn clamp_state_to_bounds(state : Array[Double], lower : Array[Double], upper : Array[Double]) -> Array[Double]

#
classify_residual_vector

fn classify_residual_vector(policy : ResidualPolicy, residual : Array[Double]) -> ResidualAction

Apply a scalar policy to a residual vector. The smallest component weight is used for the complete observation, which is conservative for correlated sensors and avoids accidentally trusting a partially corrupted packet.

#
combine_validation_reports

fn combine_validation_reports(name : String, reports : Array[ValidationReport]) -> ValidationReport

#
compare_filter_quality

fn compare_filter_quality(left : Double, right : Double) -> Int

#
compare_model_scores

fn compare_model_scores(left : ModelScore, right : ModelScore, penalty : Double) -> Int

#
constant_acceleration_process_noise

fn constant_acceleration_process_noise(dimensions : Int, dt : Double, jerk_variance : Double) -> Matrix

#
constant_acceleration_transition

fn constant_acceleration_transition(dimensions : Int, dt : Double) -> Matrix

Constant-acceleration transition for each independent axis. State order is [position, velocity, acceleration] repeated by axis.

#
constant_jerk_process_noise

fn constant_jerk_process_noise(dimensions : Int, dt : Double, snap_variance : Double) -> Matrix

#
constant_jerk_transition

fn constant_jerk_transition(dimensions : Int, dt : Double) -> Matrix

Constant-jerk model with state [position, velocity, acceleration, jerk] per axis for highly dynamic motion.

#
constant_velocity_model

fn constant_velocity_model(dimensions : Int, dt : Double, acceleration_variance : Double, measurement_variance : Double) -> LinearModel

Build a usable constant-velocity model for a position sensor.

#
constant_velocity_process_noise

fn constant_velocity_process_noise(dimensions : Int, dt : Double, acceleration_variance : Double) -> Matrix

White-acceleration process noise for the constant-velocity model.

#
constant_velocity_transition

fn constant_velocity_transition(dimensions : Int, dt : Double) -> Matrix

Constant-velocity transition for dimensions independent axes. State order is [position_0..position_n, velocity_0..velocity_n].

#
control_energy

fn control_energy(commands : Array[ControlCommand]) -> Double

#
control_interpolate

fn control_interpolate(left : ControlCommand, right : ControlCommand, timestamp : Int) -> ControlCommand

#
control_peak

fn control_peak(commands : Array[ControlCommand]) -> Double

#
control_schedule_energy

fn control_schedule_energy(sequence : ControlSequence) -> Double

#
control_schedule_peak

fn control_schedule_peak(sequence : ControlSequence) -> Double

#
covariance_average_variance

fn covariance_average_variance(covariance : Matrix) -> Double

#
covariance_is_positive_definite

fn covariance_is_positive_definite(covariance : Matrix, tolerance : Double) -> Bool

#
covariance_is_psd

fn covariance_is_psd(covariance : Matrix, tolerance : Double) -> Bool

Return whether a matrix is symmetric positive semidefinite within a caller-supplied tolerance.

#
covariance_project_psd

fn covariance_project_psd(covariance : Matrix, floor : Double) -> Matrix

#
covariance_relative_change

fn covariance_relative_change(previous : Matrix, current : Matrix) -> Double

#
covariance_to_markdown

fn covariance_to_markdown(covariance : Matrix, digits? : Int) -> String

#
covariance_trace

fn covariance_trace(covariance : Matrix) -> Double

#
decimate

fn decimate(values : Array[Double], factor : Int) -> Array[Double]

#
detect_spikes

fn detect_spikes(values : Array[Double], threshold : Double, radius : Int) -> Array[Bool]

#
ensemble_quality

fn ensemble_quality(ensemble : EstimatorEnsemble) -> Double

#
estimate_noise

fn estimate_noise(measurements : Array[Double], expected : Array[Double]) -> NoiseEstimate

#
estimate_process_noise

fn estimate_process_noise(states : Array[Double], spacing : Double) -> NoiseEstimate

#
estimates_to_csv

fn estimates_to_csv(estimates : Array[Array[Double]], truth : Array[Array[Double]]) -> String

#
evaluate_consistency

fn evaluate_consistency(estimates : Array[Array[Double]], truth : Array[Array[Double]], covariances : Array[Matrix], innovations : Array[Array[Double]], innovation_covariances : Array[Matrix], accepted : Array[Bool]) -> ConsistencyReport

#
evaluate_errors

fn evaluate_errors(actual : Array[Array[Double]], expected : Array[Array[Double]]) -> ErrorMetrics

#
exponential_smooth

fn exponential_smooth(values : Array[Double], factor : Double) -> Array[Double]

#
extract_features

fn extract_features(values : Array[Double], spacing : Double) -> FeatureVector

#
extrapolate_trajectory_point

fn extrapolate_trajectory_point(point : TrajectoryPoint, seconds : Double) -> TrajectoryPoint

Constant-acceleration extrapolation of one point.

#
filter_quality_score

fn filter_quality_score(metrics : ErrorMetrics, rejected : Int, covariance_failures : Int) -> Double

A simple score for comparing two filter runs. Lower is better; rejected observations and covariance failures are penalized separately.

#
fuse_measurements

fn fuse_measurements(measurements : Array[FusionMeasurement], strategy : FusionStrategy, covariance_floor : Double) -> FusionResult

#
fusion_events_to_csv

fn fusion_events_to_csv(events : Array[FusionEvent]) -> String

#
hampel_filter

fn hampel_filter(values : Array[Double], radius : Int, threshold : Double) -> Array[Double]

#
handle_missing_observation

fn handle_missing_observation() -> Unit

#
inflate_for_residual

fn inflate_for_residual(covariance : Matrix, residual : Array[Double], policy : ResidualPolicy) -> Matrix

#
interpolate_missing

fn interpolate_missing(values : Array[Double?], fallback : Double) -> Array[Double]

#
interpolate_trajectory_point

fn interpolate_trajectory_point(left : TrajectoryPoint, right : TrajectoryPoint, timestamp : Int) -> TrajectoryPoint

Interpolate a position between two timestamped points.

#
jerk_acceleration_observation

fn jerk_acceleration_observation(dimensions : Int) -> Matrix

#
jerk_position_observation

fn jerk_position_observation(dimensions : Int) -> Matrix

#
jerk_state_accelerations

fn jerk_state_accelerations(state : Array[Double]) -> Array[Double]

#
jerk_state_jerks

fn jerk_state_jerks(state : Array[Double]) -> Array[Double]

#
jerk_state_positions

fn jerk_state_positions(state : Array[Double]) -> Array[Double]

#
jerk_state_velocities

fn jerk_state_velocities(state : Array[Double]) -> Array[Double]

#
jerk_velocity_observation

fn jerk_velocity_observation(dimensions : Int) -> Matrix

#
linear_slope

fn linear_slope(values : Array[Double], spacing : Double) -> Double

#
make_constant_acceleration_state

fn make_constant_acceleration_state(position : Array[Double], velocity : Array[Double], acceleration : Array[Double]) -> Array[Double]

#
make_constant_velocity_state

fn make_constant_velocity_state(position : Array[Double], velocity : Array[Double]) -> Array[Double]

Convert a position/velocity pair into a constant-velocity state vector.

#
make_innovation_diagnostics

fn make_innovation_diagnostics(innovation : Array[Double], covariance : Matrix, gate_threshold : Double) -> InnovationDiagnostics

#
make_model_schedule

fn make_model_schedule(timestamps : Array[Int], dimensions : Int, acceleration_variance : Double) -> Array[ModelStep]

#
make_replay_events

fn make_replay_events(start_timestamp : Int, count : Int, first_value : Double, velocity : Double, missing_period : Int) -> Array[ReplayEvent]

Make a reproducible sequence of scalar observations with periodic drops. This is intentionally small and deterministic so it is useful in examples, acceptance tests, and regression tests without a random dependency.

#
matrix_to_csv

fn matrix_to_csv(matrix : Matrix) -> String

#
median_smooth

fn median_smooth(values : Array[Double], radius : Int) -> Array[Double]

#
metrics_to_csv

fn metrics_to_csv(metrics : ErrorMetrics) -> String

#
metrics_to_markdown

fn metrics_to_markdown(metrics : ErrorMetrics) -> String

Produce a concise Markdown table suitable for a CI artifact or README.

#
missing_action

fn missing_action(policy : MissingObservationPolicy, consecutive : Int) -> MissingObservationAction

#
model_complexity

fn model_complexity(model : LinearModel) -> Int

#
model_is_well_formed

fn model_is_well_formed(model : LinearModel) -> Bool

#
model_stability_score

fn model_stability_score(model : LinearModel) -> Double

#
moving_average

fn moving_average(values : Array[Double], radius : Int) -> Array[Double]

#
normalize_confidences

fn normalize_confidences(confidences : Array[Double]) -> Array[Double]

Return normalized weights for a set of positive confidence scores.

#
normalize_signal

fn normalize_signal(values : Array[Double]) -> Array[Double]

#
observation_time_span

fn observation_time_span(buffer : ObservationBuffer) -> Int

#
packet_age

fn packet_age(packet : ObservationPacket, now : Int) -> Int

#
packet_is_fresh

fn packet_is_fresh(packet : ObservationPacket, now : Int, timeout : Int) -> Bool

Decide whether a packet timestamp is still usable relative to a clock.

#
planar_range

fn planar_range(position : Array[Double], reference : Array[Double]) -> Double

Predict the Euclidean range of a Cartesian position and the corresponding bearing-free residual used by a range-only sensor.

#
planar_range_jacobian

fn planar_range_jacobian(position : Array[Double], reference : Array[Double]) -> Array[Double]

#
position_observation

fn position_observation(dimensions : Int) -> Matrix

Observe only the position components of a constant-velocity state.

#
predict_constant_acceleration

fn predict_constant_acceleration(state : Array[Double], dt : Double) -> Array[Double]

#
predict_constant_velocity

fn predict_constant_velocity(state : Array[Double], dt : Double) -> Array[Double]

#
proportional_control

fn proportional_control(state : Array[Double], target : Array[Double], gain : Double, limits : ControlLimits) -> Array[Double]

Generate a control vector that moves a state toward a target under limits.

#
quality_adjusted_covariance

fn quality_adjusted_covariance(covariance : Matrix, report : DataQualityReport, floor : Double) -> Matrix

#
quality_weight

fn quality_weight(report : DataQualityReport) -> Double

#
replay_result_is_data_loss

fn replay_result_is_data_loss(result : UpdateResult) -> Bool

#
replay_result_is_success

fn replay_result_is_success(result : UpdateResult) -> Bool

#
report_line

fn report_line(label : String, value : Double, unit : String) -> String

#
report_lines

fn report_lines(lines : Array[(String, Double, String)]) -> String

#
resample_linear

fn resample_linear(values : Array[Double], output_length : Int) -> Array[Double]

#
resample_trajectory

fn resample_trajectory(points : Array[TrajectoryPoint], timestamps : Array[Int]) -> Array[TrajectoryPoint]

#
retime_constant_velocity

fn retime_constant_velocity(model : Matrix, dimensions : Int, dt : Double) -> Matrix

Update a transition matrix in-place for a new sampling interval while retaining its shape.

#
robust_covariance_factor

fn robust_covariance_factor(innovation : Array[Double], tuning : Double) -> Double

#
robust_fusion

fn robust_fusion(measurements : Array[FusionMeasurement], tuning : Double) -> FusionResult

#
robust_weight

fn robust_weight(residual : Double, tuning : Double) -> Double

Bounded residual reweighting for robust updates. The output can be used to inflate measurement covariance before calling KalmanND::update.

#
rolling_mean

fn rolling_mean(values : Array[Double], window : Int) -> Array[Double]

#
rolling_variance

fn rolling_variance(values : Array[Double], window : Int) -> Array[Double]

#
rts_smooth

fn rts_smooth(filtered_states : Array[Array[Double]], filtered_covariances : Array[Matrix], predicted_states : Array[Array[Double]], predicted_covariances : Array[Matrix], transitions : Array[Matrix]) -> SmoothingResult

Rauch-Tung-Striebel smoother for a linear model.

#
run_constant_velocity_2d_simulation

fn run_constant_velocity_2d_simulation(steps : Int, dt : Double, measurement_noise : Double, missing_period : Int, outlier_period : Int, seed : Int) -> SimulationResult

Run the ready-to-use tracker against a simulated two-dimensional stream.

#
run_scalar_simulation

fn run_scalar_simulation(steps : Int, measurement_noise : Double, missing_period : Int, outlier_period : Int, seed : Int) -> SimulationResult

#
score_model

fn score_model(name : String, residuals : Array[Array[Double]], parameter_count : Int, consistency : Double) -> ModelScore

Calculate common model-selection scores from residuals.

#
sensor_samples_to_csv

fn sensor_samples_to_csv(samples : Array[SensorSample]) -> String

#
signal_autocorrelation

fn signal_autocorrelation(values : Array[Double], lag : Int) -> Double

#
signal_correlation

fn signal_correlation(left : Array[Double], right : Array[Double]) -> Double

#
signal_difference

fn signal_difference(values : Array[Double], spacing : Double) -> Array[Double]

#
signal_integral

fn signal_integral(values : Array[Double], spacing : Double) -> Array[Double]

#
simulate_constant_velocity_2d

fn simulate_constant_velocity_2d(steps : Int, dt : Double, initial_position : Array[Double], velocity : Array[Double], measurement_noise : Double, missing_period : Int, outlier_period : Int, seed : Int) -> Array[SensorSample]

Generate a two-dimensional constant-velocity trajectory with repeatable sensor noise, dropped packets, and occasional gross outliers.

#
simulate_scalar_measurements

fn simulate_scalar_measurements(steps : Int, initial_value : Double, drift : Double, noise : Double, missing_period : Int, outlier_period : Int, seed : Int) -> Array[SensorSample]

#
smooth_with_missing

fn smooth_with_missing(values : Array[Double?], fallback : Double, alpha : Double) -> Array[Double]

#
state_has_valid_uncertainty

fn state_has_valid_uncertainty(state : Array[Double], covariance : Matrix) -> Bool

#
state_positions

fn state_positions(state : Array[Double]) -> Array[Double]

#
state_velocities

fn state_velocities(state : Array[Double]) -> Array[Double]

#
state_within_bounds

fn state_within_bounds(state : Array[Double], lower : Array[Double], upper : Array[Double]) -> Bool

Check a state against component-wise bounds without mutating it.

#
summarize_pipeline

fn summarize_pipeline(events : Array[PipelineEvent], sensor : String) -> PipelineReport

#
summarize_telemetry

fn summarize_telemetry(samples : Array[TelemetrySample]) -> TelemetrySummary

#
telemetry_acceptance_rate

fn telemetry_acceptance_rate(summary : TelemetrySummary) -> Double

#
telemetry_all_finite

fn telemetry_all_finite(samples : Array[TelemetrySample]) -> Bool

#
telemetry_failure_rate

fn telemetry_failure_rate(summary : TelemetrySummary) -> Double

#
telemetry_from_filter

fn telemetry_from_filter(timestamp : Int, channel : String, filter : Kalman1D, result : UpdateResult) -> TelemetrySample

#
telemetry_gap_count

fn telemetry_gap_count(samples : Array[TelemetrySample], expected_period : Int) -> Int

#
telemetry_is_monotonic

fn telemetry_is_monotonic(samples : Array[TelemetrySample]) -> Bool

#
telemetry_is_usable

fn telemetry_is_usable(summary : TelemetrySummary, minimum_quality : Double) -> Bool

#
telemetry_merge

fn telemetry_merge(left : Array[TelemetrySample], right : Array[TelemetrySample]) -> Array[TelemetrySample]

#
telemetry_outlier_count

fn telemetry_outlier_count(samples : Array[TelemetrySample], threshold : Double) -> Int

#
telemetry_quality_adjusted_value

fn telemetry_quality_adjusted_value(sample : TelemetrySample, fallback : Double) -> Double

#
telemetry_quality_histogram

fn telemetry_quality_histogram(samples : Array[TelemetrySample], buckets : Int) -> Histogram

#
telemetry_quality_weighted_mean

fn telemetry_quality_weighted_mean(samples : Array[TelemetrySample]) -> Double

#
telemetry_range

fn telemetry_range(samples : Array[TelemetrySample]) -> Double

#
telemetry_resample

fn telemetry_resample(samples : Array[TelemetrySample], timestamps : Array[Int]) -> Array[TelemetrySample]

#
telemetry_sample_count

fn telemetry_sample_count(samples : Array[TelemetrySample], result : UpdateResult) -> Int

#
telemetry_status

fn telemetry_status(samples : Array[TelemetrySample]) -> FilterStatus

#
telemetry_status_score

fn telemetry_status_score(status : FilterStatus) -> Double

#
telemetry_to_csv

fn telemetry_to_csv(samples : Array[TelemetrySample]) -> String

#
telemetry_values

fn telemetry_values(samples : Array[TelemetrySample]) -> Array[Double]

#
trajectory_accelerations

fn trajectory_accelerations(points : Array[TrajectoryPoint]) -> Array[Array[Double]]

Approximate acceleration from adjacent velocity samples.

#
trajectory_average_speed

fn trajectory_average_speed(points : Array[TrajectoryPoint]) -> Double

#
trajectory_length

fn trajectory_length(points : Array[Array[Double]]) -> Double

Arc length of a sequence of positions.

#
trajectory_max_speed

fn trajectory_max_speed(points : Array[TrajectoryPoint]) -> Double

#
trajectory_turning_angles

fn trajectory_turning_angles(points : Array[TrajectoryPoint]) -> Array[Double]

#
update_result_to_string

fn update_result_to_string(result : UpdateResult) -> String

#
validate_matrix

fn validate_matrix(name : String, matrix : Matrix, expected_rows : Int, expected_cols : Int) -> ValidationReport

#
validate_packet

fn validate_packet(name : String, packet : ObservationPacket, dimension : Int) -> ValidationReport

#
validate_sensor_configuration

fn validate_sensor_configuration(configuration : SensorConfiguration) -> ValidationReport

#
validate_state

fn validate_state(name : String, state : Array[Double], covariance : Matrix) -> ValidationReport

#
validate_trajectory

fn validate_trajectory(name : String, points : Array[TrajectoryPoint]) -> ValidationReport

#
validation_has_error

fn validation_has_error(report : ValidationReport) -> Bool

#
validation_has_warning

fn validation_has_warning(report : ValidationReport) -> Bool

#
validation_summary

fn validation_summary(report : ValidationReport) -> String

#
vector_add

fn vector_add(left : Array[Double], right : Array[Double]) -> Array[Double]

#
vector_all_close

fn vector_all_close(left : Array[Double], right : Array[Double], tolerance : Double) -> Bool

#
vector_axpy

fn vector_axpy(alpha : Double, x : Array[Double], y : Array[Double]) -> Array[Double]

#
vector_clamp

fn vector_clamp(values : Array[Double], lower : Double, upper : Double) -> Array[Double]

#
vector_covariance

fn vector_covariance(samples : Array[Array[Double]]) -> Matrix

#
vector_distance

fn vector_distance(left : Array[Double], right : Array[Double]) -> Double

#
vector_dot

fn vector_dot(left : Array[Double], right : Array[Double]) -> Double

Dot product with a safe length check.

#
vector_hadamard

fn vector_hadamard(left : Array[Double], right : Array[Double]) -> Array[Double]

#
vector_is_finite

fn vector_is_finite(values : Array[Double]) -> Bool

#
vector_l1_norm

fn vector_l1_norm(values : Array[Double]) -> Double

#
vector_l2_norm

fn vector_l2_norm(values : Array[Double]) -> Double

#
vector_lerp

fn vector_lerp(left : Array[Double], right : Array[Double], amount : Double) -> Array[Double]

#
vector_linf_norm

fn vector_linf_norm(values : Array[Double]) -> Double

#
vector_mad

fn vector_mad(values : Array[Double]) -> Double

#
vector_mae

fn vector_mae(actual : Array[Double], expected : Array[Double]) -> Double

#
vector_mean

fn vector_mean(values : Array[Double]) -> Double

#
vector_mean_center

fn vector_mean_center(values : Array[Double]) -> Array[Double]

#
vector_median

fn vector_median(values : Array[Double]) -> Double

#
vector_normalize

fn vector_normalize(values : Array[Double]) -> Array[Double]

Normalize a vector. Zero vectors stay zero instead of producing NaNs.

#
vector_project

fn vector_project(value : Array[Double], basis : Array[Double]) -> Array[Double]

#
vector_quantile

fn vector_quantile(values : Array[Double], probability : Double) -> Double

Linear-interpolated quantile in the closed interval [0, 1].

#
vector_reject

fn vector_reject(value : Array[Double], basis : Array[Double]) -> Array[Double]

#
vector_replace_non_finite

fn vector_replace_non_finite(values : Array[Double], fallback : Double) -> Array[Double]

#
vector_rmse

fn vector_rmse(actual : Array[Double], expected : Array[Double]) -> Double

#
vector_scale

fn vector_scale(values : Array[Double], factor : Double) -> Array[Double]

#
vector_sub

fn vector_sub(left : Array[Double], right : Array[Double]) -> Array[Double]

#
vector_sum

fn vector_sum(values : Array[Double]) -> Double

#
vector_to_csv

fn vector_to_csv(values : Array[Double]) -> String

Convert a vector to one CSV row.

#
vector_variance

fn vector_variance(values : Array[Double]) -> Double

#
vector_weighted_mean

fn vector_weighted_mean(values : Array[Double], weights : Array[Double]) -> Double

#
vector_weighted_variance

fn vector_weighted_variance(values : Array[Double], weights : Array[Double]) -> Double

#
vector_wrap

fn vector_wrap(value : Double, period : Double) -> Double

#
velocity_observation

fn velocity_observation(dimensions : Int) -> Matrix

Observe only the velocity components of a constant-velocity state.