parameter_sensitivity_analysis: Parameter Sensitivity Analysis

View source: R/adaptive_sampling.R

parameter_sensitivity_analysisR Documentation

Parameter Sensitivity Analysis

Description

Analyzes the sensitivity of the model performance (measured by MAE) to changes in a single parameter. This function bins the parameter range to identify the minimum MAE for each bin, helping to understand how robust the model is to parameter choices.

Usage

parameter_sensitivity_analysis(
  param,
  samples,
  bins = 30,
  mae_col = "Holdout_MAE",
  threshold_pct = 5,
  min_samples = 1
)

Arguments

param

The character name of the parameter to analyze.

samples

A data frame containing parameter samples and performance metrics.

bins

The integer number of bins to divide the parameter range into.

mae_col

The character name of the column containing the Mean Absolute Error (MAE) values.

threshold_pct

A numeric percentage above the minimum MAE to define an acceptable performance threshold.

min_samples

The integer minimum number of samples required in a bin for it to be included in the analysis.

Details

The function performs these steps:

  1. Cleans the input data using Median Absolute Deviation (MAD) to remove outliers.

  2. Bins the parameter values into equal-width bins.

  3. Calculates the minimum MAE within each bin to create an empirical performance curve.

  4. Identifies a performance threshold based on a percentage above the global minimum MAE.

  5. Returns an S3 object for plotting and further analysis.

Value

An object of class "parameter_sensitivity" containing:

param_values

Vector of parameter bin midpoints

min_mae

Vector of minimum MAE values per bin

param_name

Name of analyzed parameter

threshold

Threshold value (default: min. +5%)

min_value

Minimum MAE value across all bins

sample_counts

Number of samples per bin


topolow documentation built on Aug. 31, 2025, 1:07 a.m.