-
Notifications
You must be signed in to change notification settings - Fork 3
Description
It looks like at some point we've diverged on the interpretation of the type parameter for ObservationProcess
.
As a recap, we have just the one type parameter
abstract type ObservationProcess{T} end
This is used in two places with contradictory meanings. First it is used to determine the output container type for forward simulation:
SSMProblems.jl/src/utils/forward_simulation.jl
Lines 9 to 13 in 672da2f
T_dyn = eltype(LD) | |
T_obs = eltype(OP) | |
xs = Vector{T_dyn}(undef, T) | |
ys = Vector{T_obs}(undef, T) |
It is also used to define the main type parameter of the SSM which I believe corresponds to the type of the log-likelihoods generated by the SSM:
SSMProblems.jl/src/SSMProblems.jl
Lines 258 to 259 in 672da2f
T = promote_type(eltype(OPT), eltype(LDT)) | |
return new{T,typeof(dyn),typeof(obs)}(dyn, obs) |
I feel like both of these use-cases have a place. Is it worth having two type parameters?
One for the element type (which could be some weird abstract thing, e.g. a collection of Lévy jumps, rather than just a Vector{T}). One for the type returned by the logdensity function?
If we are doing this, the same should probably hold for the LatentDynamics. One for the state type, one for the type returned by logdensity.
Alternatively, it might be overkill to store the type of the state/observation. Are there any serious drawbacks that come from sampling x1, y1 and then constructing a vector from their empirical types?
Would especially appreciate thoughts from @charlesknipp as I believe it was your desire to store the log-likelihood type.