Skip to contents

Specifies how regression coefficients vary across ordered composition categories. Smoothing requires ordered categories in magCompData. Unspecified methods default to independent coefficient priors.

Usage

magCompSmooth(intercept = c("none", "rw1", "rw2"),
              slope = c("none", "rw1", "rw2"),
              loading = c("none", "rw1", "rw2"),
              ordered = TRUE, ...)

Arguments

intercept

Smoothing for composition intercept coefficients: independent ("none"), first-order ("rw1"), or second-order ("rw2") random-walk smoothing.

slope

Smoothing for each composition slope, with the same choices.

loading

Loading smoothing. Only "none" is implemented.

ordered

Ordering flag stored in this specification. When preparing a model, the category ordering recorded by magCompData() determines whether smoothing is permitted. This flag does not order the data.

...

Named block or response overrides. Each is a list containing intercept, slope, loading, and/or ordered, or a single method name applied to both intercept and slope. Conditional block names have the form "child|parent".

Details

RW1 penalizes adjacent coefficient differences; RW2 penalizes changes in those differences. In conditional blocks, smoothing acts separately within each parent's child-category sequence. It does not smooth across parents.

Global settings apply unless overridden by a named block or response entry. An exact block name takes precedence over its response name. Smoothing variances are fixed prior settings controlled by magCompPriors; they are not sampled parameters. The technical guide's section on regression coefficients and ordered-category smoothing gives the precision matrices; see magComp-package.

Value

A magCompSmooth object to pass as magComp(smooth = ).

Examples

magCompSmooth(intercept = "rw2", slope = "rw2")
magCompSmooth(dbh_class = list(intercept = "rw2", slope = "rw1"))