Skip to main content

regression_depth

Function regression_depth 

Source
pub fn regression_depth(
    fit: &FregreLmResult,
    data: &FdMatrix,
    y: &[f64],
    scalar_covariates: Option<&FdMatrix>,
    n_boot: usize,
    depth_type: DepthType,
    seed: u64,
) -> Result<RegressionDepthResult, FdarError>
Expand description

Regression depth diagnostics for a linear functional regression.

Computes depth of each observation’s FPC scores and depth of the regression coefficients in a bootstrap distribution.

§Arguments

  • fit — Fitted FregreLmResult
  • data — Functional data (n × m)
  • y — Response (length n)
  • scalar_covariates — Optional scalar covariates
  • n_boot — Number of bootstrap iterations
  • depth_type — Which depth measure to use
  • seed — Random seed

§Errors

Returns FdarError::InvalidDimension if data has fewer than 4 rows, zero columns, or y.len() does not match the row count. Returns FdarError::InvalidParameter if n_boot is zero. Returns FdarError::ComputationFailed if score depth computation returns empty.