Component class abstract base Components How it works

One additive block of a structural time-series model.

A model is a sum of components, y(t) = sum_i H_i(t) x_i(t) + noise, where each component owns stateDim consecutive states. The engine stacks the blocks and never looks inside them; a component supplies its own transition and process-noise matrices and never sees the filter.

Everything is continuous-time: transition and processNoise take a gap dt in whatever time unit the caller uses, and must be exact for any non-negative gap, including zero (A(0) = I, Q(0) = 0).

Implementations are immutable. withParameters returns a new instance.

To write one, extend this class with a final or base class (final class MyComponent extends Component) and implement the nine abstract members: stateDim, parameterCount, transition, processNoise, observationAt, diffuseStates, properPrior, parameters and withParameters. The rest have defaults. checkComponent in package:state_space/authoring.dart tests the properties the engine relies on.

Implementers

Constructors

Component()
Const, so that components can be.
const

Properties

diffuseStates → List<bool>
Which of this component's states have no proper prior, one flag per state.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isStatic → bool
Whether this component's states never move: A(dt) = I and Q(dt) = 0 for every gap, and every state diffuse.
no setter
name → String
A name for this component in the sentences FitResult.warnings writes.
no setter
parameterCount → int
Number of free parameters in the unconstrained vector used by withParameters and returned by parameters.
no setter
parameters → Float64List
The current parameter vector, unconstrained (variances as logs, bounded quantities as logits), as a fresh copy.
no setter
parameterSpecs → List<ParameterSpec>
What each entry of parameters is, in the same order.
no setter
rateStateIndex → int?
Index within this component's block of a state holding the instantaneous rate of change of the component's contribution, or null if it has none.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stateDim → int
Number of states this component contributes.
no setter

Methods

identifiabilityHint(double from, double to, {double resolution = 0}) → String?
Why this component's flat directions might not be identifiable on a series running from from to to with readings typically resolution apart, or null if nothing about it is suspect.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
observationAt(double time, Float64List out) → void
Writes this component's slice of the observation row H(t) into out, a view of length stateDim.
parameterSpecsAt({required double resolution}) → List<ParameterSpec>
parameterSpecs, narrowed by what data sampled every resolution time units can resolve.
processNoise(double dt, MatrixBlock out) → void
Writes the process-noise block Q_i(dt) into out, which is stateDim x stateDim and may contain stale values. It must be symmetric and positive semi-definite.
properPrior(Float64List mean, MatrixBlock covariance) → void
Writes the prior mean and covariance of the non-diffuse states.
toString() → String
A string representation of this object.
inherited
transition(double dt, MatrixBlock out) → void
Writes the transition block A_i(dt) into out, which is stateDim x stateDim and may contain stale values.
wanderOver(double span) → double
Root-mean-square deviation of this component's contribution from its own average, over a window of span time units of its own driving noise.
withParameters(Float64List theta) → Component
A copy of this component with theta as its parameters.

Operators

operator ==(Object other) → bool
The equality operator.
inherited