Skip to contents

Distributions

The general univariate distribution interface: 38 families with density, quantile, seeded random generation, and fitting.

distribution()
Create a univariate distribution object
dist_pdf() dist_log_pdf() dist_cdf() dist_quantile() dist_random()
Distribution functions
dist_moments() dist_params() dist_lmoments() dist_log_likelihood()
Distribution properties
dist_fit()
Fit a distribution to data
distribution_names()
List the supported distribution families

Composite distributions

Five distributions built from other distributions rather than a flat parameter vector – truncation, mixtures, competing risks, empirical, and kernel density. Each returns a corehydro_dist accepted by every dist_*() verb.

dist_truncated()
Truncate a distribution
dist_mixture()
Mixture distribution
dist_competing_risks()
Competing-risks distribution
dist_empirical()
Empirical distribution
dist_kde()
Kernel density distribution

Copulas

The seven bivariate copula families (copula_names()), constructed directly or fitted to paired data.

copula()
Construct a bivariate copula
copula_fit()
Fit a bivariate copula to data
copula_pdf() copula_log_pdf() copula_cdf()
Copula density, distribution, and inverse functions
copula_inverse_cdf()
Copula inverse CDF
copula_tail_dependence()
Copula tail dependence
copula_exceedance()
Copula joint exceedance probability
copula_bounds()
Copula theta bounds
copula_params()
Copula parameters
copula_random()
Draw from a copula
copula_log_likelihood()
Copula log-likelihood
copula_names()
List the supported copula families

Multivariate distributions

The five multivariate distribution families (mvdist_names()): multivariate normal and Student-t, Dirichlet, multinomial, and bivariate empirical.

mvdist_normal()
Construct a multivariate normal distribution
mvdist_student_t()
Construct a multivariate Student-t distribution
mvdist_dirichlet()
Construct a Dirichlet distribution
mvdist_multinomial()
Construct a multinomial distribution
mvdist_bivariate_empirical()
Construct a bivariate empirical distribution
mvdist_pdf() mvdist_log_pdf() mvdist_cdf() mvdist_dimension()
Multivariate density, distribution, and dimension
mvdist_mean() mvdist_variance() mvdist_sd() mvdist_median() mvdist_mode() mvdist_covariance()
Multivariate moments
mvdist_mahalanobis()
Mahalanobis distance
mvdist_inverse_cdf()
Multivariate inverse CDF (Cholesky map)
mvdist_interval()
Rectangle probability of a multivariate normal
mvdist_marginal()
Marginal distribution of a multivariate normal
mvdist_conditional()
Conditional distribution of a multivariate normal
mvdist_random()
Draw from a multivariate distribution
mvdist_params()
Family-specific multivariate parameters
mvdist_names()
List the supported multivariate distribution families

GEV convenience functions

dgev() pgev() qgev()
Generalized Extreme Value distribution
gev_fit()
Fit a GEV distribution
gev_moments()
Moments of a GEV distribution
gev_quantile_se()
Standard error of a GEV quantile (maximum likelihood)

Observation data

Censored observation frames – historical and paleoflood intervals, perception thresholds, measurement uncertainty, and low outliers – plus the diagnostics computed off them.

analysis_data()
Censored observation data for an analysis
analysis_data_summary()
Summarize an observation frame
analysis_data_hypothesis_test()
A hypothesis test on an observation record
analysis_data_statistics()
Summary statistics for an observation record
threshold_diagnostics()
Threshold selection diagnostics for peaks-over-threshold analysis

Models

The nine RMC.BestFit model families as plain specs, with nonstationary trends and per-parameter bounds and priors. Pass one to any analysis in place of a data vector.

model_univariate()
Univariate distribution model
model_mixture()
Finite mixture model
model_competing_risks()
Competing risks model
model_point_process()
Peaks-over-threshold point process model
model_bulletin17c()
Bulletin 17C distribution model
model_ar()
Autoregressive AR(p) model
model_ma()
Moving-average MA(q) model
model_arima()
ARIMA(p, d, q) model
model_arimax()
ARIMAX(p, d, q, b) model with covariates
model_spatial_gev()
Hierarchical spatial GEV model
model_rating_curve()
BaRatin stage-discharge rating curve model
model_bivariate()
Bivariate copula model
trend()
Attach a trend to a distribution parameter
model_parameter()
Constrain or prime one model parameter
model_validate()
Validate a model
model_simulate()
Simulate from a model
model_log_likelihood()
Model log-likelihood
model_parameters()
Model parameters

Point-estimate fits

fit_mle()
Maximum likelihood fit
fit_map()
Maximum a posteriori fit

Bayesian and GMM fits

fit_bayesian()
Bayesian MCMC fit
fit_gmm()
Generalized method of moments fit (Bulletin 17C)
fit_gmm_moments()
Fit your own moment conditions by GMM
fit_diagnostics()
Estimation diagnostics for a fit
quantile_variance()
Delta-method variance of a fitted quantile

Fit accessor methods

S3 methods on a corehydro_fit (from fit_mle, fit_map, fit_bayesian or fit_gmm). print, summary, coef and vcov are undocumented plain methods and don’t appear here.

logLik(<corehydro_fit>)
Log-likelihood of a fit
confint(<corehydro_fit>)
Confidence or credible intervals for a fit

Frequency analysis

univariate_analysis()
Bayesian univariate frequency analysis
fit_distributions()
Fit and rank candidate distributions
bulletin17c_analysis()
Bulletin 17C flood-frequency analysis
composite_analysis()
Composite frequency analysis

Model-family analyses

mixture_analysis()
Bayesian mixture-model frequency analysis
competing_risk_analysis()
Bayesian competing-risk frequency analysis
point_process_analysis()
Bayesian point-process (peaks-over-threshold) frequency analysis
spatial_gev_analysis()
Hierarchical spatial-GEV frequency analysis
bivariate_analysis()
Bivariate (copula) joint-exceedance frequency analysis
coincident_frequency_analysis()
Coincident-frequency analysis
rating_curve_analysis()
Stage-discharge rating-curve frequency analysis

Time series

ar_analysis()
Bayesian autoregressive AR(p) time-series analysis
ma_analysis()
Bayesian moving-average MA(q) time-series analysis
arima_analysis()
Bayesian ARIMA(p,d,q) time-series analysis
arimax_analysis()
Bayesian ARIMAX(p,d,q) time-series analysis

MCMC

mcmc_sample()
Sample the posterior of a distribution's parameters by MCMC
mcmc_posterior()
Sample your own posterior by MCMC

Uncertainty and diagnostics

bootstrap_analysis()
Parametric bootstrap confidence bands for a distribution
bootstrap_custom()
Bootstrap your own statistic
estimation_diagnostics()
Bayesian estimation diagnostics (leverage / influence / prior influence)
prior_predictive_check()
Prior predictive check
posterior_predictive_check()
Posterior predictive check

Statistics utilities

mgbt_test()
Multiple Grubbs-Beck low-outlier test
box_cox_lambda() box_cox() box_cox_inverse()
Box-Cox transformation
yeo_johnson_lambda() yeo_johnson() yeo_johnson_inverse()
Yeo-Johnson transformation
plotting_positions()
Plotting positions
latin_hypercube()
Latin hypercube sampling

Correlation and goodness of fit

Correlation coefficients and the GoodnessOfFit metrics (continuous and binary classification), plus the information criteria and model-weight verbs used to rank candidate fits.

correlation()
Correlation between two samples, or a correlation matrix
goodness_of_fit()
Goodness-of-fit metrics for a modeled series
classification_metrics()
Classification metrics for two binary label vectors
gof_test()
Goodness-of-fit test statistic for a fitted distribution
gof_rmse()
Root mean squared error of a fitted distribution
aic() aicc() bic()
Information criteria
aic_weights() rmse_weights()
Model weights from a vector of criteria

Statistics

Sample moments, L-moments, ranks and percentiles, running (online) statistics and covariance, autocorrelation and cross-correlation, and the discrete Fourier transform.

summary_statistics()
Summary statistics for a sample
product_moments()
Product moments of a sample
l_moments()
L-moments of a sample
ranks()
Ranks of a sample
percentile()
Percentiles of a sample
running_statistics()
Streaming summary statistics
running_covariance()
Streaming covariance and correlation matrix
autocorrelation()
Autocorrelation, autocovariance, or partial autocorrelation function
cross_correlation()
Cross-correlation of two series
dft()
Discrete Fourier transform
dft_real()
Discrete Fourier transform of real-valued data

Hypothesis tests

The twelve ported Numerics one- and two-sample parametric and nonparametric hypothesis tests (t-tests, the F-test and its two-model form, Jarque-Bera, Wald-Wolfowitz, Ljung-Box, Mann-Whitney, Mann-Kendall, the linear trend test).

hypothesis_test()
Hypothesis tests

Interpolation and regression

Histogram binning, one- and two-dimensional interpolation with optional axis transforms, and ordinary least squares regression.

histogram()
Bin a sample into a histogram
interpolate()
Interpolate a paired series
interpolate_2d()
Interpolate a 2D grid (bilinear interpolation)
linear_regression()
Ordinary least squares by singular value decomposition
predict(<corehydro_lm>)
Predict from a fitted linear regression

Sampling utilities

Quasi-random Sobol sequences, deterministic stratification of an interval, and joint exceedance probabilities under a dependency structure.

sobol_sequence()
Sobol quasi-random low-discrepancy sequence
stratify()
Stratify an axis into equal-width bins
joint_probability()
Joint probability of multiple events

The Numerics link-function layer (identity, log, logit, and friends) and the trend models used by nonstationary distributions and models.

link_function()
Construct a link function
link() link_inverse() link_derivative()
Evaluate a link function
link_names()
Available link function types
trend_predict() trend_parameters()
Evaluate a trend model
trend_names()
Available trend model types

Optimizers and network routing

The fourteen ported Numerics optimizers (differential evolution, particle swarm, shuffled complex evolution, simulated annealing, multi-start, MLSL, BFGS, Powell, ADAM, gradient descent, Nelder-Mead, Brent, golden section, augmented Lagrange) over a user-written R objective, and the Dijkstra shortest-path solver from the same upstream Optimization namespace.

optim_minimize() optim_maximize()
Minimize or maximize a user-written objective
optim_constraint()
Declare one constraint for the augmented Lagrange optimizer
shortest_path()
Shortest paths through a network

Root finding, integration and differentiation

The ported Numerics Brent root finder, adaptive Gauss-Kronrod integrator and NumericalDerivative routines over a user-written R function.

root_find()
Find a root of a user-written function
root_find_system()
Solve a system of nonlinear equations
quadrature()
Integrate a user-written function
quadrature_2d()
Integrate a user-written function of two variables over a rectangle
quadrature_nd()
Integrate a user-written function over a multidimensional box
ode_solve()
Solve a user-written ordinary differential equation
derivative() gradient() hessian()
Differentiate a user-written function

Linear algebra and special functions

The ported Numerics QRDecomposition (Householder reflections) and GaussJordanElimination linear-algebra routines, the Debye and Evaluate special functions, and the two non-tabular IUnivariateFunction implementations (LinearFunction, PowerFunction).

qr_decomposition()
QR decomposition
qr_solve()
Solve a linear system by QR decomposition
gauss_jordan()
Gauss-Jordan elimination
debye()
The Debye function
polynomial_eval()
Evaluate a polynomial
univariate_function()
Evaluate a univariate function

Paired-data curves

The ported Paired Data subsystem (OrderedPairedData, UncertainOrderedPairedData) and its third IUnivariateFunction implementation, TabularFunction: interpolation and area under a curve, three simplification algorithms, sampling an uncertain curve at its mean or a quantile, and evaluating a tabular function built from that curve.

curve_interpolate()
Interpolate a paired x-y curve
curve_area()
Area under a paired x-y curve
curve_simplify()
Simplify a paired x-y curve
uncertain_curve_sample()
Sample an uncertain paired curve
tabular_function()
Evaluate a tabular function

Machine learning

The ported Numerics.MachineLearning layer: three unsupervised methods (k-means, Gaussian mixture models, Jenks natural breaks) and five supervised ones (decision trees, random forests, k-nearest neighbors, Gaussian naive Bayes, and generalized linear models). Each trains and answers in one call; a seeded fit is reproducible and agrees bit for bit with the identical call in Python.

ml_kmeans()
k-means clustering
ml_gaussian_mixture()
Gaussian mixture model
ml_jenks_breaks()
Jenks natural breaks classification
ml_decision_tree()
Decision tree regression or classification
ml_random_forest()
Random forest regression or classification
ml_knn()
k-nearest-neighbors regression or classification
ml_naive_bayes()
Gaussian naive Bayes classification
ml_glm()
Generalized linear model

Time-series container

The ported Numerics TimeSeries container. A time_series() carries dated observations on a stated interval; the verbs over it smooth, fill, clip, re-interval, summarize, reduce to annual maxima or peaks over a threshold, decompose, and resample. Seeded resampling agrees bit for bit with the identical call in Python.

time_series()
Create a time series
ts_interval_names()
The time intervals a time series can carry
ts_moving_average() ts_moving_sum()
Moving average and moving sum
ts_cumulative_sum() ts_difference() ts_standardize()
Cumulative sum, successive differences and standardization
ts_sort()
Sort a time series
ts_transform()
Transform the values of a time series
ts_replace_missing() ts_interpolate_missing() ts_fill_missing_dates()
Handle missing values
ts_clip() ts_shift() ts_convert_interval()
Clip, shift and re-interval a time series
ts_statistics() ts_hypothesis_test() ts_percentiles() ts_duration()
Summary statistics of a time series
ts_monthly_statistics() ts_monthly_percentiles() ts_monthly_frequency()
Monthly statistics
ts_block_series() ts_water_year() ts_calendar_year()
Block series: annual maxima and other block extremes
ts_peaks_over_threshold()
Peaks over a threshold
ts_seasonal_decompose()
Seasonal decomposition
ts_resample_knn() ts_resample_block_bootstrap()
Resample a time series

The generator a callback is handed

Drawing from the core’s seeded random number generator inside a function you write, so the run stays reproducible and agrees with the identical run in Python.

rng_uniform() rng_integers()
Draw from the generator a callback is handed