additiveMatrixFitter: Additive Pattern Fitter

View source: R/additiveMatrixFitter.R

additiveMatrixFitterR Documentation

Additive Pattern Fitter

Description

Fits an additive pattern to matrix data using training data specified by a mask. The pattern is based on row and column main effects, creating an additive model where each cell value is the sum of a row effect and column effect minus the overall mean.

Usage

additiveMatrixFitter(mat, trainMask)

Arguments

mat

Numeric matrix containing the data to fit

trainMask

Logical matrix of same dimensions as mat, indicating which cells to use for training

Details

The function creates an additive pattern by:

  • Masking non-training cells as NA to compute statistics only on training data

  • Computing overall mean of training data

  • Computing row means and column means from training data

  • Replacing non-finite means with overall mean as fallback

  • Creating additive pattern as outer sum of row and column effects minus overall mean

Value

Numeric matrix of same dimensions as mat containing the fitted additive pattern


SIMPLICA documentation built on Sept. 11, 2025, 1:08 a.m.