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
@@ -3,92 +3,123 @@ Constructs and returns a latent model based on the provided `inference_config` a
3
3
The purpose of this function is to make adjustments to the latent model based on the
4
4
full `inference_config` provided.
5
5
6
-
The `tscale` argument is used to scale the standard deviation of the latent model based on the
7
-
idea that some processes have a variance that is (approximately) proportional to a time period (due to non-stationarity)
8
-
and some processes have a variance that is constant in time (at stationarity). The default
9
-
value is `sqrt(21.0)`, which corresponds to matching the variance of stationary processes to
10
-
the eventual variance of non-stationary process after 21 days.
11
-
12
6
The `pipeline` argument is used for dispatch purposes.
13
7
14
-
# Returns
15
-
- A latent model object which can be one of `DiffLatentModel`, `AR`, or `RandomWalk` depending on the `latent_model_name` and `igp` specified in `inference_config`.
8
+
The prior decisions are based on the target standard deviation and autocorrelation of the latent process,
9
+
which are determined by the infection generating process (igp) and whether the latent process is stationary or non-stationary
10
+
via the `_make_target_std_and_autocorr` function.
16
11
17
-
# Details
18
-
- The function first constructs a dictionary of priors using `make_model_priors(pipeline)`.
19
-
- It then retrieves the `igp` (inference generation process) and `latent_model_name` from `inference_config`.
20
-
- Depending on the `latent_model_name` and `igp`, it constructs and returns the appropriate latent model:
21
-
- `"diff_ar"`: Constructs a `DiffLatentModel` with an `AR` model.
22
-
- `"ar"`: Constructs an `AR` model.
23
-
- `"rw"`: Constructs a `RandomWalk` model.
24
-
- The priors for the models are set based on the `prior_dict` and the `tscale` parameter.
25
12
13
+
# Returns
14
+
- A latent model object which can be one of `DiffLatentModel`, `AR`, or `RandomWalk` depending on the `latent_model_name` and `igp` specified in `inference_config`.
Constructs and returns a latent model based on an approximation to the specified target standard deviation and autocorrelation.
84
+
85
+
NB: The stationary variance of an AR(1) process is given by `σ² = σ²_ε / (1 - ρ²)` where `σ²_ε` is the variance of the noise and `ρ` is the autocorrelation.
86
+
The approximation here are based on `E[1/(1 - ρ²)`] ≈ 1 / (1 - E[ρ²])` which only holds for fairly tight distributions of `ρ`.
87
+
However, for priors this should get the expected order of magnitude.
88
+
89
+
# Models
90
+
- `"diff_ar"`: Constructs a `DiffLatentModel` with an autoregressive (AR) process.
91
+
- `"ar"`: Constructs an autoregressive (AR) process.
0 commit comments