Skip to content

Commit

Permalink
add some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen committed Dec 20, 2024
1 parent af0aed3 commit c22a8ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/LowLevelParticleFilters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module LowLevelParticleFilters
export KalmanFilter, SqKalmanFilter, UnscentedKalmanFilter, DAEUnscentedKalmanFilter, ExtendedKalmanFilter, ParticleFilter, AuxiliaryParticleFilter, AdvancedParticleFilter, PFstate, index, state, covariance, num_particles, effective_particles, weights, expweights, particles, particletype, smooth, sample_measurement, simulate, loglik, log_likelihood_fun, forward_trajectory, mean_trajectory, mode_trajectory, weighted_mean, weighted_cov, update!, predict!, correct!, reset!, metropolis, shouldresample, TupleProduct
export IMM, interact!, combine!
export LinearMeasurementModel, EKFMeasurementModel, UKFMeasurementModel, CompositeMeasurementModel
export KalmanFilteringSolution, ParticleFilteringSolution
@deprecate weigthed_mean weighted_mean
@deprecate weigthed_cov weighted_cov

Expand Down
12 changes: 11 additions & 1 deletion src/imm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ In addition to the [`predict!`](@ref) and [`correct!`](@ref) steps, the IMM filt
These two orders are cyclic permutations of each other, and the order used in [`update!`](@ref) is chosen to align with the order used in the other filters, where the initial condition is corrected using the first measurement, i.e., we assume the first measurement updates ``x(0|-1)`` to ``x(0|0)``.
The (combined) state and covariance of the IMM filter is made up of the weighted average of the states and covariances of the individual filters. The weights are the initial mixing probabilities `μ`.
The initial (combined) state and covariance of the IMM filter is made up of the weighted average of the states and covariances of the individual filters. The weights are the initial mixing probabilities `μ`.
Ref: "Interacting multiple model methods in target tracking: a survey", E. Mazor; A. Averbuch; Y. Bar-Shalom; J. Dayan
Expand Down Expand Up @@ -238,6 +238,16 @@ covtype(imm::IMM) = typeof(imm.R)
state(imm::IMM) = imm.x
covariance(imm::IMM) = imm.R


"""
forward_trajectory(imm::IMM, u, y, p = parameters(imm); interact = true)
When performing batch filtering using an [`IMM`](@ref) filter, one may
- Override the `interact` parameter of the filter
- Access the mode probabilities along the trajectory as the `sol.extra` field. This is a matrix of size `(n_modes, T)` where `T` is the length of the trajectory (length of `u` and `y`).
The returned solution object is of type [`KalmanFilteringSolution`](@ref) and has the following fields:
"""
function forward_trajectory(imm::IMM, u::AbstractVector, y::AbstractVector, p=parameters(imm); interact = true)
reset!(imm)
T = length(y)
Expand Down

0 comments on commit c22a8ed

Please sign in to comment.