Skip to main content

ridge_prediction_intervals

Function ridge_prediction_intervals 

Source
pub fn ridge_prediction_intervals(
    y_json: &str,
    x_vars_json: &str,
    new_x_json: &str,
    alpha: f64,
    lambda: f64,
    standardize: bool,
) -> String
Expand description

Computes approximate Ridge regression prediction intervals via WASM.

Fits a Ridge model and computes conservative prediction intervals using leverage from unpenalized X’X and MSE from the ridge fit.

§Arguments

  • y_json - JSON array of response variable values
  • x_vars_json - JSON array of predictor arrays (training data)
  • new_x_json - JSON array of predictor arrays (new observations)
  • alpha - Significance level (e.g., 0.05 for 95% PI)
  • lambda - Regularization strength
  • standardize - Whether to standardize predictors