|
60 | 60 | #' For more details see the BinRW [vignette](https://ghurault.github.io/EczemaPred/articles/BinRW.html).
|
61 | 61 | #'
|
62 | 62 | #' @param max_score Maximum value that the score can take
|
63 |
| -#' @param prior Named list of the model's priors. If `NULL`, uses the default prior for the model (see [default_prior()]). |
| 63 | +#' @param prior Named list of the model's priors. |
| 64 | +#' If `NULL`, uses the default prior for the model (see [default_prior()]). |
64 | 65 | #'
|
65 | 66 | #' @details Details of the model are available in the [paper](#).
|
66 | 67 | #'
|
67 | 68 | #' @section Parameters:
|
68 | 69 | #'
|
69 | 70 | #' ## Population parameters:
|
70 | 71 | #'
|
71 |
| -#' - `sigma`: Standard deviation of the random walk |
| 72 | +#' - `sigma_lat`: Standard deviation of the random walk |
| 73 | +#' - `sigma_meas`: Standard deviation (not scale) of the logistic distribution (in `[0, max_score]` space) |
| 74 | +#' - `sigma_tot`: Total standard deviation for prediction one step ahead |
| 75 | +#' - `rho2`: Proportion of measurement variance to the total variance. |
| 76 | +#' It can be interpreted similarly to an R-squared, the proportion of the explained variance |
| 77 | +#' (the variance of the measurements) in the total variance. |
72 | 78 | #' - `mu_y0`: Population mean of `y0` (initial condition).
|
73 | 79 | #' - `sigma_y0`: Population standard deviation of `y0` (initial condition).
|
74 |
| -#' - `delta`: Difference between cutpoints (vector of length `max_score - 1`) |
75 |
| -#' - `ct`: Cutpoints (vector of length `max_score`) |
76 |
| -#' - `p0`: Probability distribution of the average patient at t0 (vector of length `max_score`) |
| 80 | +#' - `delta`: Relative difference between cutpoints (simplex of length `max_score - 1`) |
| 81 | +#' - `ct`: Cutpoints (vector of length `max_score`, in `[0, max_score]` space) |
77 | 82 | #'
|
78 | 83 | #' ## Patient-dependent parameters:
|
79 | 84 | #'
|
80 |
| -#' - `y0`: `y_lat` at t0. |
| 85 | +#' - `y0`: initial latent score (`y_lat` at t0). |
81 | 86 | #'
|
82 | 87 | #' ## Observation-dependent (patient- and time-dependent) parameters:
|
83 | 88 | #'
|
84 |
| -#' - `y_lat`: Latent score |
| 89 | +#' - `y_lat`: Latent score (in `[0, max_score]` space) |
85 | 90 | #'
|
86 | 91 | #' See `list_parameters(model = "OrderedRW")` for more details.
|
87 | 92 | #'
|
88 | 93 | #' @section Priors:
|
89 |
| -#' The priors are passed as a named list with elements `delta`, `sigma`, `mu_y0` and `sigma_y0` |
| 94 | +#' The priors are passed as a named list with elements `delta`, `sigma_lat`, `sigma_meas`, `mu_y0` and `sigma_y0` |
90 | 95 | #' specifying priors for the corresponding parameters.
|
91 | 96 | #'
|
92 |
| -#' The element `delta` should be a matrix with 2 rows and `max_score - 1` columns, |
93 |
| -#' such as the i-th column is a vector with values x1 and x2, where x2 > 0 and |
94 |
| -#' `delta[i] ~ normal+(x1, x2)`. |
95 |
| -#' The other parameters are normalised by the difference between the highest and lowest cutpoints (approx. the range of the score), |
96 |
| -#' and their priors are defined by a vector of length 2, containing values for x1 and x2, x2 > 0, such as: |
| 97 | +#' The element `delta` should be a vector X1 of length `max_score - 1`, |
| 98 | +#' such as all all elements of X1 are positive and |
| 99 | +#' `delta ~ dirichlet(X1)`. |
97 | 100 | #'
|
98 |
| -#' - `sigma ~ normal+(x1, x2)` |
| 101 | +#' The latent score can be interpreted in the original `[0, max_score]` space, |
| 102 | +#' the priors for the other parameters are specified normalised `max_score`. |
| 103 | +#' Their priors are defined by a vector of length 2, containing values for x1 and x2, x2 > 0, such as: |
| 104 | +#' |
| 105 | +#' - `sigma_meas / max_score ~ lognormal(x1, x2)` |
| 106 | +#' - `sigma_lat / max_score ~ lognormal(x1, x2)` |
99 | 107 | #' - `mu_y0 ~ normal(x1, x2)`
|
100 | 108 | #' - `sigma_y0 ~ normal+(x1, x2)`
|
101 | 109 | #'
|
102 |
| -#' NB: `delta`, `sigma` and `sigma_y0` are constrained to be positive so x1 are usually set to 0 to define a half-normal distribution. |
| 110 | +#' NB: for the lognormal distribution, x1 corresponds to the mean of the log and x2 to the sd of the log. |
| 111 | +#' NB: `sigma_y0` is constrained to be positive so x1 are usually set to 0 to define a half-normal distribution. |
103 | 112 | #'
|
104 | 113 | #' @section Default priors:
|
105 |
| -#' - The default prior for `delta` is set so that `delta` is less than the width of the logistic distribution. |
106 |
| -#' - The default prior for `sigma` assumes it would be to go to a state where `y = 0` is the most likely outcome to |
107 |
| -#' a state where `y = M` in two transitions. |
108 |
| -#' - The default priors for `mu_y0` and `sigma_y0` have reasonable ranges and translate to an approximately uniform prior |
109 |
| -#' over the range of the score for `y0`. |
| 114 | +#' - The default prior for `delta` is a uniform symmetric Dirichlet distribution with concentration 2. |
| 115 | +#' - The default priors for `sigma_meas` and `sigma_lat` are lognormal distribution which translate to |
| 116 | +#' a 95% CI that is approximately `[.02, 0.40] * M`. |
| 117 | +#' The prior for `sigma_lat` thus allows fast or slow transitions from a state where `y = 0` |
| 118 | +#' is the most likely outcome to a state where `y = M` is the most likely outcome. |
| 119 | +#' The prior for `sigma_meas` allows very precise or imprecise measurements. |
| 120 | +#' - The default priors for `mu_y0` and `sigma_y0` have reasonable ranges and translate to |
| 121 | +#' an approximately uniform prior over the range of the score for `y0`. |
110 | 122 | #'
|
111 | 123 | #' @name OrderedRW
|
112 | 124 | #'
|
|
0 commit comments