diff --git a/EpiAware/src/EpiObsModels/ObservationErrorModels/AbstractTuringObservationModel.jl b/EpiAware/src/EpiObsModels/ObservationErrorModels/AbstractTuringObservationModel.jl index b068b01bd..89a7d208a 100644 --- a/EpiAware/src/EpiObsModels/ObservationErrorModels/AbstractTuringObservationModel.jl +++ b/EpiAware/src/EpiObsModels/ObservationErrorModels/AbstractTuringObservationModel.jl @@ -33,7 +33,7 @@ Generates priors for the observation error model. This should return a named tup end @doc raw" -Generates the observation error distribution for the observation error model. This function should return the distribution for the observation error given the expected observation value `Y_t` and the priors generated by `generate_observation_error_priors`. +The observation error distribution for the observation error model. This function should return the distribution for the observation error given the expected observation value `Y_t` and the priors generated by `generate_observation_error_priors`. " function observation_error(obs_model::AbstractTuringObservationErrorModel, Y_t) @info "No concrete implementation for `observation_error` is defined." diff --git a/EpiAware/src/EpiObsModels/ObservationErrorModels/NegativeBinomialError.jl b/EpiAware/src/EpiObsModels/ObservationErrorModels/NegativeBinomialError.jl index a041e9c07..f4eeaeb3a 100644 --- a/EpiAware/src/EpiObsModels/ObservationErrorModels/NegativeBinomialError.jl +++ b/EpiAware/src/EpiObsModels/ObservationErrorModels/NegativeBinomialError.jl @@ -35,6 +35,9 @@ struct NegativeBinomialError{S <: Sampleable, T <: AbstractFloat} <: end end +@doc raw" +Generates observation error priors based on the `NegativeBinomialError` observation model. This function generates the cluster factor prior for the negative binomial error model. +" @model function generate_observation_error_priors( obs_model::NegativeBinomialError, Y_t, y_t) cluster_factor ~ obs_model.cluster_factor_prior @@ -42,6 +45,9 @@ end return (; sq_cluster_factor) end +@doc raw" +This function generates the observation error model based on the negative binomial error model with a positive shift. It dispatches to the `NegativeBinomialMeanClust` distribution. +" function observation_error(obs_model::NegativeBinomialError, Y_t, sq_cluster_factor) return NegativeBinomialMeanClust(Y_t + obs_model.pos_shift, sq_cluster_factor) diff --git a/EpiAware/src/EpiObsModels/ObservationErrorModels/PoissonError.jl b/EpiAware/src/EpiObsModels/ObservationErrorModels/PoissonError.jl index 600d86a07..cea48fffd 100644 --- a/EpiAware/src/EpiObsModels/ObservationErrorModels/PoissonError.jl +++ b/EpiAware/src/EpiObsModels/ObservationErrorModels/PoissonError.jl @@ -1,7 +1,6 @@ @doc raw" The `PoissonError` struct represents an observation model for Poisson errors. It -is a subtype of `AbstractTuringObservationErrorModel`. Note that -when Y_t is shorter than y_t, then the first `length(y_t) - length(Y_t)` elements of y_t are assumed to be missing. +is a subtype of `AbstractTuringObservationErrorModel`. ## Constructors - `PoissonError(; pos_shift::AbstractFloat = 0.)`: Constructs a `PoissonError` @@ -25,6 +24,10 @@ struct PoissonError{T <: AbstractFloat} <: AbstractTuringObservationErrorModel end end +@doc raw" +The observation error model for Poisson errors. This function generates the +observation error model based on the Poisson error model with a positive shift. +" function observation_error(obs_model::PoissonError, Y_t) return Poisson(Y_t + obs_model.pos_shift) end