The parameters of a hybrid state: a discrete mode, and a component conditioned on each mode.
More...
|
|
using | ComponentType = Params<Component_> |
| | the component given one mode
|
|
using | Scalar = typename ComponentType::Scalar |
| | the scalar type
|
|
using | SpaceType = typename ComponentType::SpaceType |
| | the continuous state space
|
|
using | ModeSpaceType = ModeSpace_ |
| | the discrete mode space
|
|
using | ModesType = CategoricalParams<ModeSpace_, Scalar> |
| | the weights of the modes
|
|
using | MomentsType = typename ComponentType::MomentsType |
| | a mean and covariance together
|
|
using | allocator_type = Allocator_ |
| | the allocator the components come from
|
|
using | DensityType = Hybrid<Component_, ModeSpace_, Allocator_> |
| | the view toDensity() returns
|
|
using | ConditionalsType = internal::Buffer<ComponentType, Allocator_> |
| | The components, one per mode in flat-index order.
|
|
|
| HybridParams (ModesType modes, ComponentType const &conditional, Allocator_ const &allocator={}) |
| | Mode weights modes, with conditional as the component in every mode.
|
|
| HybridParams (ModesType modes, ConditionalsType conditionals) |
| | Mode weights modes, and conditionals, one component per mode in flat-index order.
|
|
template<typename Conditionals> |
| | HybridParams (ModesType modes, Conditionals const &conditionals, Allocator_ const &allocator) |
| | As above, with the components copied into storage from allocator.
|
|
| HybridParams (HybridParams const &other, Allocator_ const &allocator) |
| | Copies the modes and components into storage from allocator.
|
|
| HybridParams (HybridParams &&other, Allocator_ const &allocator) |
| | Moves the modes and components into storage from allocator.
|
|
| HybridParams (HybridParams const &)=default |
| | copies the modes and components
|
|
| HybridParams (HybridParams &&) noexcept=default |
| | moves the modes and components
|
|
HybridParams & | operator= (HybridParams const &)=default |
| | Copies the modes and components, reusing the storage held.
|
|
HybridParams & | operator= (HybridParams &&) noexcept=default |
| | Moves the modes and components.
|
| allocator_type | get_allocator () const |
| SpaceType const & | space () const |
| ModeSpace_ const & | modeSpace () const |
| Eigen::Index | size () const |
| Eigen::Index | valueDimension () const |
| Eigen::Index | differenceDimension () const |
| ModesType const & | modes () const |
|
void | setModes (ModesType modes) |
| | Replaces the mode weights.
|
| ComponentType const & | conditional (Eigen::Index mode) const & |
|
void | conditional (Eigen::Index mode) const &&=delete |
| | A component of a temporary would outlive it; copy it from a named hybrid instead.
|
|
void | setConditional (Eigen::Index mode, ComponentType const &component) |
| | Replaces the component given the mode with flat index mode with component, which must be in the hybrid's space, copying into the storage the component holds.
|
|
void | setConditional (Eigen::Index mode, ComponentType &&component) |
| | As above, moving component in.
|
template<typename F>
requires std::invocable<F &, ComponentType &> |
| decltype(auto) | updateConditional (Eigen::Index mode, F &&f) |
template<typename... Values, typename... Paths, std::size_t... N>
requires (sizeof...(Values) + sizeof...(Paths) > 0) |
| ComponentType const & | conditional (AxisIndex< Paths, N > const &... indices) const & |
template<typename... Values, typename... Paths, std::size_t... N>
requires (sizeof...(Values) + sizeof...(Paths) > 0) |
| void | conditional (AxisIndex< Paths, N > const &...) const &&=delete |
| | A component of a temporary would outlive it.
|
|
void | swapConditionals (ConditionalsType &conditionals) |
| | Exchanges the components with conditionals, one per mode on the same space, which must come from an equal allocator: how a filter replaces them without copying.
|
| template<typename Path> |
| auto | marginal () const & |
|
template<typename Path> |
| void | marginal () const &&=delete |
| | A marginal of a temporary would outlive it.
|
|
template<typename Path> |
| auto | marginal (Eigen::Index element) const & |
| | marginal() of one repetition of a repeated block; see GaussianParams::marginal(element).
|
|
template<typename Path> |
| void | marginal (Eigen::Index element) const &&=delete |
| | A marginal of a temporary would outlive it.
|
| MixtureParams< Component_, Allocator_ > | toMixture () const |
| std::expected< void, NumericError > | factorize () const |
| | Checks the mode weights and factorizes every component that has changed, so that the state's log-density can be read (see ComponentTraits).
|
| template<typename R> |
| std::expected< void, NumericError > | factorize (R const &repair) |
| | factorize(), repairing each covariance that is not positive definite by repair (see GaussianParams::factorize(R const &)).
|
| std::expected< DensityType, NumericError > | toDensity () const & |
| | Checks the mode weights and factorizes every component that has changed (factorize()).
|
|
void | toDensity () const &&=delete |
| | A density of a temporary would outlive it.
|
| template<typename R> |
| std::expected< DensityType, NumericError > | toDensity (R const &repair) & |
| | toDensity(), repairing covariances that are not positive definite by repair (see factorize(R const &)): x.toDensity(roots::ridge()).
|
|
template<typename R> |
| void | toDensity (R const &) &&=delete |
| | A density of a temporary would outlive it.
|
template<internal::ComponentOrInfoForm Component_, DiscreteSpace ModeSpace_, typename Allocator_ = DefaultAllocator>
class Emrys::HybridParams< Component_, ModeSpace_, Allocator_ >
The parameters of a hybrid state: a discrete mode, and a component conditioned on each mode.
The density, evaluated by its Hybrid from toDensity(), is \( p(x, m) = P(m) \, p_m(x) \), with ModeSpace_ a discrete space (see Discrete spaces) and one component (see Component) for each of its values: a Gaussian, which makes the hybrid a HybridGaussian, \( p_m = \mathcal{N}(\mu_m, \Sigma_m) \), or any other component. This is the state of an ImmFilter, where the modes are maneuver regimes or sensor states; a grid of Kalman filters, whose cells can't be revived as modes can, is a GridGaussianParams (decisions.md [rao-blackwellized-core]). Unlike a Mixture, every component is labeled by its mode, and there is exactly one per mode.
A hybrid is itself a component (decisions.md [component-first]): its log-density is the log-sum-exp over its modes, and several hybrids on one mode space collapse into one whose mode probabilities are their weighted sums and whose conditional for mode \( m \) is the collapse of theirs with weights \( w_c P_c(m) \), which keeps each mode's mean and covariance. So a Mixture of hybrids is a mixture of IMM states [filters-and-recursions].
The components come from the allocator (see Allocation). The modes are a CategoricalParams, one weight per value of the mode space, which need not sum to one, as a mixture's weights need not: the state is \( p(x, m) \propto w_m \, p_m(x) \), and toDensity() checks the weights and factorizes the components before the density is read. The moments and the collapses read the components, so they are the density's: they mean something only once every component is a distribution (decisions.md [params-and-density]).
x.modes().toDensity()->probability<Turn>();
x.conditional<Turn, Inlier>();
x.marginal<Position>();
auto const density = x.toDensity();
density->collapsed();
density->collapse<Maneuver>();
The parameters of a probability distribution over a discrete space: one weight per value.
Definition Categorical.h:257
HybridParams< Gaussian< Space_, Scalar_ >, ModeSpace_, Allocator_ > HybridGaussianParams
The HybridParams of Gaussians in covariance form: the parameters of a HybridGaussian,...
Definition Hybrid.h:754
- Template Parameters
-
| Component_ | the component given a mode (see Component), which sets the continuous state space and the scalar |
| ModeSpace_ | the discrete mode space (see Discrete spaces) |
| Allocator_ | allocator for the components (see Allocation) |
- See also
- class Hybrid, HybridGaussianParams, class MixtureParams