edges_cal.modelling.Polynomial

class edges_cal.modelling.Polynomial(*, parameters=None, n_terms=_Nothing.NOTHING, transform: ModelTransform = IdentityTransform(), offset=0)[source]

A polynomial foreground model.

Parameters:
  • log_x (bool) – Whether to fit the poly coefficients with log-space co-ordinates.

  • offset (float) – An offset to use for each index in the polynomial model.

  • kwargs – All other arguments passed through to Foreground.

Notes

The polynomial model can be written

\[\sum_{i=0}^{n} c_i y^{i + offset},\]

where y is log(x) if log_x=True and simply x otherwise.

Methods

__init__(*[, parameters, n_terms, ...])

Method generated by attrs for class Polynomial.

at(**kwargs)

Get an evaluated linear model.

fit(xdata, ydata[, weights])

Create a linear-regression fit object.

from_str(model, **kwargs)

Obtain a Model given a string name.

get_basis_term(indx, x)

Define the basis functions of the model.

get_basis_term_transformed(indx, x)

Get the basis term after coordinate transformation.

get_basis_terms(x)

Get a 2D array of all basis terms at x.

with_nterms([n_terms, parameters])

Return a new Model with given nterms and parameters.

with_params(parameters)

Get new model with different parameters.

Attributes

default_n_terms

n_terms_max

n_terms_min

offset

parameters

n_terms

transform