Skip to main content

functional_pdp

Function functional_pdp 

Source
pub fn functional_pdp(
    fit: &FregreLmResult,
    data: &FdMatrix,
    _scalar_covariates: Option<&FdMatrix>,
    component: usize,
    n_grid: usize,
) -> Result<FunctionalPdpResult, FdarError>
Expand description

Functional PDP/ICE for a linear functional regression model.

Varies the FPC score for component across a grid while keeping other scores fixed, producing ICE curves and their average (PDP).

For a linear model, ICE curves are parallel lines (same slope, different intercepts).

§Arguments

  • fit – A fitted FregreLmResult
  • data – Original functional predictor matrix (n x m)
  • scalar_covariates – Optional scalar covariates (n x p)
  • component – Which FPC component to vary (0-indexed, must be < fit.ncomp)
  • n_grid – Number of grid points (must be >= 2)

§Errors

Returns FdarError::InvalidDimension if data has zero rows, its column count does not match fit.fpca.mean, or its row count does not match fit.fitted_values. Returns FdarError::InvalidParameter if component >= fit.ncomp or n_grid < 2.