|
10 | 10 | #' @param formula An R formula, possibly with the parameters followed by |
11 | 11 | #' brackets containing indices. If there are no indices, the macro attempts |
12 | 12 | #' to guess the correct indices from the context. The formula must be |
13 | | -#' right-hand side only (e.g. ~x). This must always be the first argument supplied |
14 | | -#' to LINPRED. |
15 | | -#' @param link A link function which will be applied to the |
| 13 | +#' right-hand side only (e.g. \code{~x}). This must always be the first argument supplied |
| 14 | +#' to \code{LINPRED}. |
| 15 | +#' @param link A link function that will be applied to the |
16 | 16 | #' left-hand-side (the response) in the final linear predictor. Default is none. |
17 | 17 | #' @param coefPrefix All model coefficient names will begin with this prefix. |
18 | | -#' default is beta_ (so x becomes beta_x, etc.) |
| 18 | +#' default is \code{"beta_"} (so 'x' becomes 'beta_x', etc.) |
19 | 19 | #' @param sdPrefix All dispersion parameters will begin with this prefix. |
20 | | -#' default is no prefix. |
21 | | -#' @param priorSpecs Prior specifications, should be generated with setPrior() |
22 | | -#' @param modMatNames Logical, should parameters be named so they match the |
23 | | -#' names you would get from R's model.matrix function? |
24 | | -#' @param noncenter Logical; use noncentered parameterization? |
25 | | -#' @param centerVar Grouping covariate to 'center' on in parameterization. By |
26 | | -#' default all random effects have mean 0 as with lme4. |
| 20 | +#' Default is no prefix. |
| 21 | +#' @param priorSpecs Prior specifications, generated with \code{setPrior()} |
| 22 | +#' @param modMatNames Logical indicating if parameters should be named so they match the |
| 23 | +#' names one would get from R's \code{model.matrix}. Default is \code{FALSE}. |
| 24 | +#' @param noncenter Logical indicating whether to use noncentered parameterization. |
| 25 | +#' Default is \code{FALSE}. |
| 26 | +#' @param centerVar Grouping variable (covariate) to 'center' the random effects on. By |
| 27 | +#' default all random effects have mean 0 as with \code{lme4}. |
27 | 28 | #' |
28 | 29 | #' @author Ken Kellner |
29 | 30 | #' |
|
33 | 34 | #' mu[1:3] <- LINPRED(~x + x2) |
34 | 35 | #' }) |
35 | 36 | #' |
36 | | -#' mod <- nimbleModel(code, constants=constants) |
| 37 | +#' mod <- nimbleModel(code, constants = constants) |
37 | 38 | #' mod$getCode() |
38 | 39 | NULL |
39 | 40 |
|
@@ -92,29 +93,31 @@ unpackArgs=TRUE |
92 | 93 | ) |
93 | 94 |
|
94 | 95 |
|
95 | | -#' Macro to build code for priors on a linear predictor from R formula |
| 96 | +#' Macro to build code for priors on a linear predictor from an R formula |
96 | 97 | #' |
97 | 98 | #' Generates appropriate priors for a linear predictor derived from an |
98 | 99 | #' R formula. As such it makes the most sense to use this macro together with |
99 | | -#' the LINPRED macro which takes similar arguments. |
| 100 | +#' the LINPRED macro, which takes similar arguments. |
100 | 101 | #' |
101 | 102 | #' @name LINPRED_PRIORS |
102 | 103 | #' @author Ken Kellner |
103 | 104 | #' |
104 | | -#' @param formula An R formula The formula must be right-hand side only (e.g. ~x). |
105 | | -#' This must always be the first argument supplied to LINPRED_PRIORS |
| 105 | +#' @param formula An R formula The formula must be right-hand side only (e.g., \code{~x}). |
| 106 | +#' This must always be the first argument supplied to \code{LINPRED_PRIORS}. |
106 | 107 | #' @param coefPrefix All model coefficient names will begin with this prefix. |
107 | | -#' default is beta_ (so x becomes beta_x, etc.) |
| 108 | +#' default is \code{"beta_"} (so 'x' becomes 'beta_x', etc.) |
108 | 109 | #' @param sdPrefix All dispersion parameters will begin with this prefix. |
109 | | -#' default is no prefix. |
110 | | -#' @param priorSpecs List of prior specifications, should be generated using |
| 110 | +#' Default is no prefix. |
| 111 | +#' @param priorSpecs List of prior specifications, generated using \code{setPriors}. |
111 | 112 | #' setPriors() |
112 | | -#' @param modMatNames Logical, should parameters be named so they match the |
113 | | -#' names you would get from R's model.matrix function? |
114 | | -#' @param noncenter Logical, use noncentered parameterization? |
115 | | -#' @param centerVar Grouping covariate to 'center' on in parameterization. By |
116 | | -#' default all random effects have mean 0 as with lme4. |
| 113 | +#' @param modMatNames Logical indicating if parameters should be named so they match the |
| 114 | +#' names one would get from R's \code{model.matrix}. Default is \code{FALSE}. |
| 115 | +#' @param noncenter Logical indicating whether to use noncentered parameterization. |
| 116 | +#' Default is \code{FALSE}. |
| 117 | +#' @param centerVar Grouping variable (covariate) to 'center' the random effects on. By |
| 118 | +#' default all random effects have mean 0 as with \code{lme4}. |
117 | 119 | #' |
| 120 | +#' |
118 | 121 | #' @author Ken Kellner |
119 | 122 | #' |
120 | 123 | #' @examples |
@@ -1378,12 +1381,12 @@ correlatedRandomPrior <- function(x, priorSpecs, sdPrefix, sd_name, modelInfo, c |
1378 | 1381 | #' uppertri_mult_diag |
1379 | 1382 | #' |
1380 | 1383 | #' nimbleFunction needed when fitting correlated random effects. |
1381 | | -#' Generates upper triangular Cholesky factor of covariance matrix (U in code) |
1382 | | -#' from upper tri Cholesky factor of correlation matrix (Ustar in code) |
| 1384 | +#' Generates upper triangular Cholesky factor of covariance matrix ("U" in code) |
| 1385 | +#' from upper triangular Cholesky factor of correlation matrix ("Ustar" in code) |
1383 | 1386 | #' and vector of standard deviations. Taken from the NIMBLE manual, |
1384 | | -#' section 5.2.4.1.2 LKJ distribution for correlation matrices. |
| 1387 | +#' section 5.2.4.1.2 (LKJ Distribution for Correlation Matrices). |
1385 | 1388 | #' |
1386 | | -#' @param mat upper triangular Cholesky factor of correlation matrix (Ustar) |
| 1389 | +#' @param mat upper triangular Cholesky factor of correlation matrix ("Ustar") |
1387 | 1390 | #' @param vec vector of standard deviations for individual random effects |
1388 | 1391 | #' |
1389 | 1392 | #' @name uppertri_mult_diag |
|
0 commit comments