rxmc.physical_model.Polynomial#

class rxmc.physical_model.Polynomial(order: int)[source]#

Bases: PhysicalModel

Polynomial model of fixed order.

Predicts observable values as

\[y_{\mathrm{model}}(x;\,a_0,\dots,a_n) = \sum_{i=0}^{n} a_i\, x^i\]
Parameters:

order (int) – Polynomial order $n$. The model has $n+1$ free coefficients.

__init__(order: int)[source]#

Methods

__init__(order)

evaluate(observation, *params)

Evaluate the polynomial at the observation grid.

evaluate(observation: Observation, *params) ndarray[source]#

Evaluate the polynomial at the observation grid.

Parameters:
  • observation (Observation) – Observation whose x attribute provides the evaluation grid.

  • *params (float) – Polynomial coefficients a0, a1, ..., an (lowest order first).

Returns:

np.ndarray – Polynomial values at observation.x.

Raises:

ValueError – If the number of supplied coefficients does not match self.order + 1.