check#

This module provides functions for checking and validating Pastas models and their components.

Examples

Run a checklist of standard checks on a Pastas model:

checks = [
    {"func": rsq_geq_threshold, "threshold": 0.7},
    {"func": response_memory, "cutoff": 0.95, "factor_length_oseries": 0.5},
    {"func": uncertainty_gain, "n_std": 1.96},
    {"func": parameter_bounds},
]

ps.check.checklist(ml, checks)

Or use the list of checks defined in Brakenhoff et al. (2022):

ps.check.checklist(ml, ps.check.checks_brakenhoff_2022)

Functions#

rsq_geq_threshold(ml[, threshold])

Check R^2 >= threshold.

response_memory(ml[, cutoff, factor_length_oseries, names])

Check if response function memory is shorter than fraction of calibration period.

response_memory_vs_warmup(ml[, cutoff, names])

Check if response function memory is shorter than warmup.

uncertainty_gain(ml[, n_std, names])

Check if the gain is larger than n_std times the uncertainty in the gain.

parameter_bounds(ml[, parameters])

Check if the optimal parameter values are not on the lower or upper bounds.

uncertainty_parameters(ml[, parameters, n_std])

Check if parameter value is larger than n_std times the standard deviation.

guess_unit_or_dims(parameter[, return_dims])

Guess the unit or dimension of a parameter based on its name.

acf_runs_test(ml[, p_threshold])

Runs test to check if there is significant autocorrelation in the noise.

acf_stoffer_toloi_test(ml[, p_threshold])

Stoffer-Toloi test to check if there is significant autocorrelation in the noise.

checklist(ml, checks[, report])

Run a list of checks on a Pastas model.

print_check_report(df)

Print a report of the check results.