Description Usage Arguments Value See Also Examples

Helper functions to specify linear and non-linear
formulas for use with `brmsformula`

.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ```
nlf(formula, ..., flist = NULL, dpar = NULL, resp = NULL, loop = NULL)
lf(
...,
flist = NULL,
dpar = NULL,
resp = NULL,
center = NULL,
cmc = NULL,
sparse = NULL,
decomp = NULL
)
acformula(autocor, resp = NULL)
set_nl(nl = TRUE, dpar = NULL, resp = NULL)
set_rescor(rescor = TRUE)
set_mecor(mecor = TRUE)
``` |

`formula` |
Non-linear formula for a distributional parameter.
The name of the distributional parameter can either be specified
on the left-hand side of |

`...` |
Additional |

`flist` |
Optional list of formulas, which are treated in the
same way as formulas passed via the |

`dpar` |
Optional character string specifying the distributional
parameter to which the formulas passed via |

`resp` |
Optional character string specifying the response
variable to which the formulas passed via |

`loop` |
Logical; Only used in non-linear models.
Indicates if the computation of the non-linear formula should be
done inside ( |

`center` |
Logical; Indicates if the population-level design
matrix should be centered, which usually increases sampling efficiency.
See the 'Details' section for more information.
Defaults to |

`cmc` |
Logical; Indicates whether automatic cell-mean coding
should be enabled when removing the intercept by adding |

`sparse` |
Logical; indicates whether the population-level design matrices
should be treated as sparse (defaults to |

`decomp` |
Optional name of the decomposition used for the
population-level design matrix. Defaults to |

`autocor` |
A one sided formula containing autocorrelation
terms. All none autocorrelation terms in |

`nl` |
Logical; Indicates whether |

`rescor` |
Logical; Indicates if residual correlation between
the response variables should be modeled. Currently this is only
possible in multivariate |

`mecor` |
Logical; Indicates if correlations between latent variables
defined by |

For `lf`

and `nlf`

a `list`

that can be
passed to `brmsformula`

or added
to an existing `brmsformula`

or `mvbrmsformula`

object.
For `set_nl`

and `set_rescor`

a logical value that can be
added to an existing `brmsformula`

or `mvbrmsformula`

object.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ```
# add more formulas to the model
bf(y ~ 1) +
nlf(sigma ~ a * exp(b * x)) +
lf(a ~ x, b ~ z + (1|g)) +
gaussian()
# specify 'nl' later on
bf(y ~ a * inv_logit(x * b)) +
lf(a + b ~ z) +
set_nl(TRUE)
# specify a multivariate model
bf(y1 ~ x + (1|g)) +
bf(y2 ~ z) +
set_rescor(TRUE)
# add autocorrelation terms
bf(y ~ x) + acformula(~ arma(p = 1, q = 1) + car(W))
``` |

```
Loading required package: Rcpp
Loading 'brms' package (version 2.14.4). Useful instructions
can be found by typing help('brms'). A more detailed introduction
to the package is available through vignette('brms_overview').
Attaching package: ‘brms’
The following object is masked from ‘package:stats’:
ar
Warning message:
In file(con, "r") : cannot open file '/proc/stat': Permission denied
y ~ 1
sigma ~ a * exp(b * x)
a ~ x
b ~ z + (1 | g)
y ~ a * inv_logit(x * b)
a ~ z
b ~ z
y1 ~ x + (1 | g)
y2 ~ z
y ~ x
autocor ~ arma(p = 1, q = 1) + car(W)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.