scippneutron.peaks.model.PolynomialModel#

class scippneutron.peaks.model.PolynomialModel(*, degree, prefix='')[source]#

A polynomial of fixed degree.

PolynomialModel(degree=n) implements

\[f(x; a_0, \ldots, a_n) = \sum_{i=0}^{n}\,a_i x^i\]

where the sum is inclusive on the upper bound. \(a_i\) are the parameters and are named ['a0', 'a1', ...].

__init__(*, degree, prefix='')[source]#

Initialize a polynomial model.

Parameters:
  • degree (int) – Degree of the polynomial.

  • prefix (str, default: '') – Prefix for model parameter names.

Methods

__init__(*, degree[, prefix])

Initialize a polynomial model.

fwhm(params)

Compute full width at half maximum.

guess(data, *[, coord])

Roughly estimate the model parameters for given data.

with_prefix(prefix)

Return a copy of the model with a new prefix.

Attributes

degree

The degree of the polynomial.

param_bounds

Parameter bounds.

param_names

Parameter names including the prefix.

prefix

Prefix for parameter names.

property degree: int#

The degree of the polynomial.