Description Usage Arguments Details Value See Also Examples

Bayesian inference for NLMMs with group-specific coefficients that have unknown covariance matrices with flexible priors.

1 2 3 4 5 |

`formula, data` |
Same as for `data` is
specified (and is a data frame) many post-estimation functions (including
`update` , `loo` , `kfold` ) are not guaranteed to work
properly. | |||||||||||

`subset, weights, offset` |
Same as | |||||||||||

`na.action, contrasts` |
Same as | |||||||||||

`...` |
Further arguments passed to the function in the rstan
package ( | |||||||||||

`prior` |
The prior distribution for the regression coefficients.
See the priors help page for details on the families and
how to specify the arguments for all of the functions in the table above.
To omit a prior —i.e., to use a flat (improper) uniform prior—
| |||||||||||

`prior_aux` |
The prior distribution for the "auxiliary" parameter (if
applicable). The "auxiliary" parameter refers to a different parameter
depending on the
| |||||||||||

`prior_covariance` |
Cannot be | |||||||||||

`prior_PD` |
A logical scalar (defaulting to | |||||||||||

`algorithm` |
A string (possibly abbreviated) indicating the
estimation approach to use. Can be | |||||||||||

`adapt_delta` |
Only relevant if | |||||||||||

`QR` |
A logical scalar defaulting to | |||||||||||

`sparse` |
A logical scalar (defaulting to |

The `stan_nlmer`

function is similar in syntax to
`nlmer`

but rather than performing (approximate) maximum
marginal likelihood estimation, Bayesian estimation is by default performed
via MCMC. The Bayesian model adds independent priors on the "coefficients"
— which are really intercepts — in the same way as
`stan_nlmer`

and priors on the terms of a decomposition of the
covariance matrices of the group-specific parameters. See
`priors`

for more information about the priors.

The supported transformation functions are limited to the named
"self-starting" functions in the stats library:
`SSasymp`

, `SSasympOff`

,
`SSasympOrig`

, `SSbiexp`

,
`SSfol`

, `SSfpl`

,
`SSgompertz`

, `SSlogis`

,
`SSmicmen`

, and `SSweibull`

.

A stanreg object is returned
for `stan_nlmer`

.

`stanreg-methods`

and
`nlmer`

.

The vignette for `stan_glmer`

, which also discusses
`stan_nlmer`

models. http://mc-stan.org/rstanarm/articles/

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
data("Orange", package = "datasets")
Orange$circumference <- Orange$circumference / 100
Orange$age <- Orange$age / 100
fit <- stan_nlmer(
circumference ~ SSlogis(age, Asym, xmid, scal) ~ Asym|Tree,
data = Orange,
# for speed only
chains = 1,
iter = 1000
)
print(fit)
posterior_interval(fit)
plot(fit, regex_pars = "b\\[")
``` |

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.