Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,20 @@ elbo!(plds::LinearDynamicalSystem{T,S,O}, suf::StateSpaceDynamics.SufficientStat
elbo!(slds::SLDS{T,S,O}, tfs::StateSpaceDynamics.TrialFilterSmooth{T}, fb_storage::StateSpaceDynamics.HMMs.ForwardBackwardStorage, y::AbstractVector{<:AbstractMatrix{T}}, slds_ws::StateSpaceDynamics.SLDSSmoothWorkspace{T}) where {T<:Real,S<:AbstractStateModel,O<:AbstractObservationModel}
```

## Model comparison

Latent-free baselines to score a fitted model against, plus the StatsAPI
methods built on them.

```@docs
AffineNullModel
fit!(null::StateSpaceDynamics.AffineNullModel{T}, y) where {T<:Real}
loglikelihood(null::StateSpaceDynamics.AffineNullModel{T}, y) where {T<:Real}
r2(lds::LinearDynamicalSystem{T,SM,OM}, y, variant::Symbol) where {T<:Real,SM<:GaussianStateModel{T},OM<:GaussianObservationModel{T}}
nullloglikelihood(lds::LinearDynamicalSystem{T,SM,OM}, y) where {T<:Real,SM<:GaussianStateModel{T},OM<:GaussianObservationModel{T}}
nobs(lds::LinearDynamicalSystem{T}, y) where {T<:Real}
```

## Validation

```@docs
Expand Down
7 changes: 6 additions & 1 deletion src/StateSpaceDynamics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ using ProgressMeter: Progress, next!, finish!
using SpecialFunctions: loggamma
using Statistics: mean
using StatsAPI: StatsAPI
import StatsAPI: loglikelihood, fit!
import StatsAPI: loglikelihood, fit!, nobs, nullloglikelihood, r2

using OhMyThreads: tforeach, tmapreduce
using Base.Iterators: partition
Expand All @@ -40,6 +40,7 @@ include("utils/validation.jl")
include("stats/preprocessing.jl") # PPCA (standalone model)
include("stats/sufficient_statistics.jl")
include("stats/simulate.jl")
include("stats/null_models.jl") # latent-free baselines + model comparison

# latents models (LDS, PLDS, SLDS) + inference machinery (E-step).
include("lds/continuous_latents.jl") # state-model Q-term + state M-step
Expand Down Expand Up @@ -76,4 +77,8 @@ export tview
# Common functions
export rand, smooth, fit!, loglikelihood, elbo, elbo!

# Model comparison against latent-free baselines
export AffineNullModel
export r2, nobs, nullloglikelihood

end
Loading
Loading