Assigns each sample (observation) to a population/stock based on the highest Linear Discriminant Function (LDF) score. It also computes posterior probabilities (or values proportional to them if priors are not explicitly used).
Arguments
- samples
A numeric matrix of samples to be classified. Rows are observations, columns are variables.
- coefs
A numeric matrix of LDF coefficients, as returned by
compute_ldf_coefficients
. Rows are populations, columns are coefficients for variables followed by the constant term.- freq
Optional numeric vector of frequency weights for the samples. Defaults to 1 for each sample if NULL. (Used mainly for HISEA compatibility).
- type
Character, indicates the type of run (e.g., "S" for simulation). This parameter is from HISEA Fortran and affects a condition for processing, though its impact here is minor if
freq
are positive. Default "S".