Fit a beta-regression model via Laplace, estimating the precision
Source:R/fit_laplace_beta.R
tulpa_laplace_beta.RdThin wrapper around tulpa_laplace() for family = "beta". The
Laplace engine treats phi as fixed per fit (same contract as gamma
and neg_binomial_2); this wrapper does an outer 1-D optimisation of
the Laplace-approximated log-marginal over phi, then refits at the
optimum to return betas and Hessian.
The mean-precision parameterisation is y ~ Beta(mu * phi, (1 - mu) * phi)
with default logit link; y must be strictly in (0, 1).
Arguments
- y
Response in
(0, 1).- X
Fixed-effects design matrix.
- re_list, spatial, weights, offset, max_iter, tol, n_threads, beta_prior
Passed to
tulpa_laplace()verbatim.beta_priorplaces a Gaussian penalty on the fixed effects (a list withsd, optionalmean; seetulpa_laplace()). It is included in the Laplace log-marginal that the precisionphiis optimised against, so the penalised model is fit consistently across the outerphisearch. Not supported withspatial(the spatial solver carries its own prior).- phi_init
Optional starting value for the precision. If
NULL, a method-of-moments warm start is used.- phi_bounds
Numeric length-2 vector with lower/upper bounds on
phifor the outer optimisation. Defaultc(0.1, 1e4).- outer_tol
Tolerance for the outer optimisation. Default 1e-4.
- mode
Inference method (the method is an argument, not a parallel verb):
"laplace"(default) is the Laplace + Brent-over-phipoint fit documented here;"nuts"delegates totulpa_nuts_beta(), which samplesphijointly with the coefficients via NUTS. In"nuts"mode the Laplace-only arguments (re_list,spatial,weights,offset,phi_init,phi_bounds,outer_tol) are not used, and NUTS knobs are passed viacontrol(seetulpa_nuts_beta()).- control
Passed to
tulpa_nuts_beta()whenmode = "nuts"(ignored formode = "laplace").
Value
For mode = "laplace", the list returned by tulpa_laplace() at the
optimum, augmented with phi (the optimised precision) and
phi_log_marginal (the optimisation trace). For mode = "nuts", the draws
object returned by tulpa_nuts_beta().