model_methods: Generate a statistical methods description for a smoothbp_fit...

View source: R/methods_text.R

model_methodsR Documentation

Generate a statistical methods description for a smoothbp_fit object

Description

Produces a human- and AI-readable description of the fitted model, including the structural equation, priors, MCMC sampling details, convergence diagnostics, and a reproducibility code snippet. The output is suitable for direct inclusion in the Statistical Analysis section of a scientific manuscript.

Usage

model_methods(object, ...)

## S3 method for class 'smoothbp_fit'
model_methods(object, width = 80, ...)

Arguments

object

A smoothbp_fit or smoothbp_ss_fit object.

...

Unused.

width

Integer; line-wrap width for the narrative paragraph (default 80).

Details

The function name model_methods() is used rather than methods() to avoid masking the base-R utils::methods() function, which lists S3/S4 methods for a generic and does not dispatch on object class.

When K = 0 (no breakpoints, i.e. deltas = list()), the model collapses to a Bayesian linear regression (with optional random intercepts) and the output reflects this accordingly.

Value

The full methods report as a single character string (invisibly). The text is also printed to the console via cat().

References

Bacon, D. W. & Watts, D. G. (1971). Estimating the transition between two intersecting straight lines. Biometrika, 58(3), 525–534. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2307/2334389")}

Kuo, L. & Mallick, B. (1998). Variable selection for regression models. Sankhya: The Indian Journal of Statistics, 60(1), 65–81.

Examples

## Not run: 
fit <- smoothbp(y ~ tau, b0 = ~ 1 + (1 | subject), data = dat,
                chains = 4L, iter = 2000L, warmup = 1000L, seed = 42L)
model_methods(fit)
txt <- model_methods(fit)
cat(txt)

## End(Not run)


smoothbp documentation built on June 14, 2026, 9:06 a.m.