Skip to main content

peer

Function peer 

Source
pub fn peer(
    data: &FdMatrix,
    y: &[f64],
    argvals: &[f64],
    config: &PeerConfig,
) -> Result<PeerResult, FdarError>
Expand description

Fit the PEER scalar-on-function regression model.

Estimates the coefficient function β(t) on the argvals grid by solving the penalized normal equations (W_c'W_c + λQ)β = W_c'y_c, where W_c[i,j] = (data[(i,j)] · w[j]) − column_mean and w are Simpson’s integration weights.

§Arguments

  • data — n×m functional predictor matrix (rows = observations, columns = evaluation points; column-major FdMatrix).
  • y — scalar response vector, length n.
  • argvals — evaluation grid, length m (must equal data.ncols()).
  • config — penalty family and λ selection.

§Errors

Returns FdarError::InvalidDimension when dimensions are inconsistent or a Decree Q has wrong size, FdarError::InvalidParameter for unsupported Difference orders, and FdarError::ComputationFailed when the penalized system is numerically singular.