Analyzes the sensitivity of model performance (MAE) to changes in a parameter. Uses binning to identify the minimum MAE across parameter ranges and calculates thresholds for acceptable parameter values.
parameter_sensitivity_analysis(
param,
samples,
bins = 30,
mae_col = "Holdout_MAE",
threshold_pct = 5,
min_samples = 1
)
Object of class "parameter_sensitivity" containing:
Vector of parameter bin midpoints
Vector of minimum MAE values per bin
Name of analyzed parameter
Threshold value (default: Topolow min. +5%)
Minimum MAE value across all bins
Number of samples per bin
Character name of parameter to analyze
Data frame containing parameter samples and performance metrics
Integer number of bins for parameter range (default: 40)
Character name of column containing MAE values (default: "Holdout_MAE")
Numeric percentage above minimum for threshold calculation (default: 5)
Integer minimum number of samples required in a bin (default: 1)
The function performs these steps:
Cleans the input data using MAD-based outlier detection
Bins the parameter values into equal-width bins
Calculates the minimum MAE within each bin. Analogous to "poorman's likelihood" approach, minimum MAE within each bin is an empirical estimate of the performance surface at this parameter value when other parameters are at their optimal values.
Identifies a threshold of acceptable performance (default: Topolow min. +5% MAE)
Returns an object for visualization and further analysis