Skip to contents

Connects the mathematical notation used in the manuscript and technical document to the package's prior settings, starting values, and sample labels. This is a help topic, not a function. The technical guide is linked from magComp-package.

Details

The magnitude model uses regression coefficients \(\beta\), iid group effects \(\delta_g\), and spatial effects \(v(s)\). Composition uses intercepts \(\alpha_{0j}\) and slope vectors \(\alpha_j\). Iid factor scores \(u_h\) have loadings \(\gamma_j\); spatial factor scores \(w(s)\) have loadings \(\lambda_j\). Additional terms and allocation blocks have their own parameter indices. Both factor types retain unit scale and the specified loading-anchor constraints. The index \(\ell\) denotes a retained posterior draw in the technical document.

The descriptive software names map to those symbols as follows:

Magnitude coefficients \(\beta\)

Within starting$magnitude, coefficients is a vector named by design columns, including "(Intercept)". In the magnitude priors, coefficient_variance is \(\sigma_\beta^2\).

Composition coefficients \(\alpha_{0j},\alpha_j\)

Each composition block has a coefficients matrix with one row per coefficient stick and one column per design column. Its intercept column contains \(\alpha_{0j}\). Block prior settings intercept_variance and slope_variance are \(\sigma_{\alpha,0}^2\) and \(\sigma_\alpha^2\), with defaults inherited from composition settings.

Magnitude effects \(\delta_{gt},v_t(s_i)\)

Within starting$magnitude$terms[[term]], effects contains the group or spatial effects, variance is \(\sigma_{\delta,t}^2\) or \(\sigma_{v,t}^2\), and an estimated spatial covariance$phi is \(\phi_{v,t}\). The corresponding prior term uses variance for inverse-gamma shape and scale and covariance$phi for uniform bounds.

Composition loadings and scores

Within a composition block's terms[[term]] entry, loadings contains \(\gamma\) for iid terms or \(\lambda\) for spatial terms; scores contains \(u\) or \(w\), respectively. An estimated spatial covariance$phi has one value \(\phi_{w,t,k}\) per factor column. For the term, loading_variance specifies \(c_{\gamma,t}\) or \(c_{\lambda,t}\); covariance$phi gives uniform bounds.

Negative-binomial size \(r_M\)

The magnitude prior entry size gives Gamma shape and rate when size is estimated. The corresponding starting entry gives its initial value. By default size is estimated with Gamma(shape = 1, rate = 0.01) when there are no magnitude process terms. With those terms, or an explicit size = NULL prior setting, control$nb_size fixes its value.

Space-time effects use \(v(s,t)\) and \(w(s,t)\). Covariance entries use the names listed by magCompCovModels, for example covariance$lambda for temporal exponential decay.

Coefficient and loading prior variances and smoothing variances are fixed hyperparameters. Magnitude process variances are estimated parameters. For a composition coefficient vector \(\boldsymbol{\theta}_q\), with \(q=0\) for intercepts and \(q>0\) for slopes, smoothing uses \(\tau_q^2\): intercept_smoothing_variance sets the intercept value and slope_smoothing_variance sets the common slope value within a block.

magCompSmooth(intercept = , slope = ) controls composition intercept and slope smoothing. samples returns posterior arrays using the same descriptive branches and entry names as starting values. Fixed size and covariance values are omitted.

magCompSettings and summary include a symbol column using portable ASCII notation, such as beta, sigma_delta^2, and phi_w. Summary columns separately identify component, block, term, parameter, and index. The index identifies a coefficient, stick/covariate pair, stick/factor pair, or factor as appropriate. Parameter names are coefficients, size, variance, loadings, and covariance parameter names such as phi, lambda, and nu. Traceplot labels join these identifying columns and display the corresponding symbol.