rapid_models.gp_diagnostics.utils.stats

Module Contents

Functions

snorm_qq(x)

Function for calculating standard normal QQ plot data with 95% confidence.

split_test_train_fold(folds, X, i)

Split X into X_train, X_test where

rapid_models.gp_diagnostics.utils.stats.snorm_qq(x)[source]

Function for calculating standard normal QQ plot data with 95% confidence.

Based on extRemes.qqnorm in R. https://rdrr.io/cran/extRemes/man/qqnorm.html

Parameters

x (array) – data in 1D array

Returns

sample quantiles q_snorm (array): standard normal quantiles q_snorm_upper (array): 95% upper band q_snorm_lower (array): 95% lower band

Return type

q_sample (array)

For plotting:

x = q_snorm, q_snorm_upper, q_snorm_lower (Standard Normal Quantiles) y = q_sample (Sample Quantiles)

Example: fig, ax = plt.subplots() ax.scatter(q_snorm, q_sample) ax.plot(q_snorm_upper, q_sample, ‘k–‘) ax.plot(q_snorm_lower, q_sample, ‘k–‘)

rapid_models.gp_diagnostics.utils.stats.split_test_train_fold(folds, X, i)[source]

Split X into X_train, X_test where

Parameters
  • folds (list of lists) – The index subsets.

  • X (array_like) – The indexed object to split

  • i (int) – Split on the indices folds[i]

Returns

X_test = X[folds[i]] X_train = the rest