build_XtX: Compute X'X

View source: R/helper_functions.R

build_XtXR Documentation

Compute X'X

Description

Build the Tp x Tp matrix XtX using the Matrix() package

Usage

build_XtX(X)

Arguments

X

T x p matrix of predictors

Value

Block diagonal Tp x Tp Matrix (object) where each p x p block is tcrossprod(matrix(X[t,]))

Note

X'X is a one-time computing cost. Special cases may have more efficient computing options, but the Matrix representation is important for efficient computations within the sampler.


dsp documentation built on Aug. 21, 2025, 5:29 p.m.