Fitting (fitting)#

Reference/API#

ctapipe.fitting Module#

Utilities for fitting functions to data.

Functions#

design_matrix(x)

Build the design matrix for linear regression for a given array of x-values.

linear_regression(X, y)

Analytical linear regression

residual_sum_of_squares(X, y, beta)

Calculate the residual sum of squares

residuals(X, y, beta)

Calculate the residuals of a linear regression.

choose_two_without_replacement(rng, n)

Draw two distinct random integers from [0, n) without replacement.

lts_linear_regression(x, y[, samples, ...])

Perform a Least Trimmed Squares regression.