You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: EpiAware/src/EpiLatentModels/models/HierarchicalNormal.jl
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ The `HierarchicalNormal` struct represents a non-centered hierarchical normal di
5
5
6
6
- `HierarchicalNormal(mean, std_prior)`: Constructs a `HierarchicalNormal` instance with the specified mean and standard deviation prior.
7
7
- `HierarchicalNormal(; mean = 0.0, std_prior = truncated(Normal(0,1), 0, Inf))`: Constructs a `HierarchicalNormal` instance with the specified mean and standard deviation prior using named arguments and with default values.
8
-
8
+
- `HierarchicalNormal(std_prior)`: Constructs a `HierarchicalNormal` instance with the specified standard deviation prior.
9
9
## Examples
10
10
11
11
```jldoctest HierarchicalNormal
@@ -29,6 +29,10 @@ rand(mdl)
29
29
@kwdefstruct HierarchicalNormal{R <:Real, D <:Sampleable} <:AbstractTuringLatentModel
30
30
mean::R=0.0
31
31
std_prior::D=truncated(Normal(0, 1), 0, Inf)
32
+
33
+
functionHierarchicalNormal(std_prior::D)
34
+
returnHierarchicalNormal(; mean =0.0, std_prior = std_prior)
Copy file name to clipboardExpand all lines: EpiAware/src/EpiLatentModels/models/MA.jl
+31-32Lines changed: 31 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,16 @@
2
2
The moving average (MA) model struct.
3
3
4
4
# Constructors
5
-
- `MA(coef_prior::Distribution, std_prior::Distribution; q::Int = 1, ϵ_t::AbstractTuringLatentModel = IDD(Normal()))`: Constructs an MA model with the specified prior distributions for MA coefficients and standard deviation. The order of the MA model and the error term distribution can also be specified.
5
+
- `MA(θ::Distribution, σ::Distribution; q::Int = 1, ϵ::AbstractTuringLatentModel = IDD(Normal()))`: Constructs an MA model with the specified prior distributions.
6
6
7
-
- `MA(; coef_priors::Vector{C} = [truncated(Normal(0.0, 0.05), -1, 1)], std_prior::Distribution = HalfNormal(0.1), ϵ_t::AbstractTuringLatentModel = IDD(Normal())) where {C <: Distribution}`: Constructs an MA model with the specified prior distributions for MA coefficients, standard deviation, and error term. The order of the MA model is determined by the length of the `coef_priors` vector.
7
+
- `MA(; θ::Vector{C} = [truncated(Normal(0.0, 0.05), -1, 1)], σ::Distribution = HalfNormal(0.1), ϵ::AbstractTuringLatentModel = HierarchicalNormal) where {C <: Distribution}`: Constructs an MA model with the specified prior distributions.
8
8
9
-
- `MA(coef_prior::Distribution, std_prior::Distribution, q::Int, ϵ_t::AbstractTuringLatentModel)`: Constructs an MA model with the specified prior distributions for MA coefficients, standard deviation, and error term. The order of the MA model is explicitly specified.
9
+
- `MA(θ::Distribution, q::Int, ϵ_t::AbstractTuringLatentModel)`: Constructs an MA model with the specified prior distributions and order.
10
+
11
+
# Parameters
12
+
- `θ`: Prior distribution for the MA coefficients. For MA(q), this should be a vector of q distributions or a multivariate distribution of dimension q.
13
+
- `q`: Order of the MA model, i.e., the number of lagged error terms.
14
+
- `ϵ_t`: Distribution of the error term, typically standard normal.
10
15
11
16
# Examples
12
17
@@ -32,35 +37,32 @@ rand(mdl)
32
37
33
38
struct MA{C <:Sampleable, S <:Sampleable, Q <:Int, E <:AbstractTuringLatentModel} <:
34
39
AbstractTuringLatentModel
35
-
"Prior distribution for the MA coefficients."
36
-
coef_prior::C
37
-
"Prior distribution for the standard deviation."
38
-
std_prior::S
39
-
"Order of the MA model."
40
+
"Prior distribution for the MA coefficients. For MA(q), this should be a vector of q distributions or a multivariate distribution of dimension q"
41
+
θ::C
42
+
"Order of the MA model, i.e., the number of lagged error terms."
0 commit comments