`uz2_linpred_recap.Rd`

Bayesian inference for the Type 2 moult model with repeat measures

```
uz2_linpred_recap(
moult_index_column,
date_column,
id_column,
start_formula = ~1,
duration_formula = ~1,
sigma_formula = ~1,
lump_non_moult = FALSE,
active_moult_recaps_only = FALSE,
data,
init = "auto",
flat_prior = TRUE,
beta_sd = 0,
log_lik = FALSE,
use_phi_approx = FALSE,
same_sigma = FALSE,
...
)
```

- moult_index_column
the name the column in

`data`

containing moult indices, i.e. a numeric vector of (linearized) moult scores (0 = old plumage,1 = new plumage).- date_column
the name the column in

`data`

containing sampling dates, encoded as days since an arbitrary reference date, i.e. a numeric vector- id_column
factor identifier. Usually a season-individual combination to encode within-season recaptures

- start_formula
model formula for start date

- duration_formula
model formula for duration

- sigma_formula
model formula for start date sigma

- lump_non_moult
logical; should pre- and post-moult observations be treated as indistinguishable? if TRUE, the type 2L model will be fitted.

- active_moult_recaps_only
logical flag whether to ignore repeated observations outside the active moult phase

- data
Input data frame

- init
Specification of initial values for all or some parameters. Can be the string "auto" for an automatic guess based on the data, or any of the permitted rstan options: the digit 0, the strings "0" or "random", or a function. See the detailed documentation for the init argument in ?rstan::stan.

- flat_prior
use uniform prior on start date and duration (TRUE) or vaguely informative truncated normal prior (FALSE). Defaults to TRUE.

- beta_sd
use zero-centred normal priors for regression coefficients other than intercepts? If <= 0 the stan default of improper flat priors is used.

- log_lik
boolean retain pointwise log-likelihood in output? This enables model assessment and selection via the loo package. Defaults to FALSE, can lead to very large output arrays if sample size is large.

- use_phi_approx
logical flag whether to use stan's Phi_approx function to calculate the "old" likelihoods

- same_sigma
logical flag, currently unused

- ...
Arguments passed to

`rstan::sampling`

(e.g. iter, chains).

An object of class `stanfit`

returned by `rstan::sampling`