rxmc.physical_model.PhysicalModel#

class rxmc.physical_model.PhysicalModel(params: list[Parameter])[source]#

Bases: object

Abstract base class for parametric physical models.

Represents an arbitrary parametric model $y_{mathrm{model}}(x;,alpha)$ for comparison to an experimental measurement ${x_i,, y(x_i)}$ encapsulated in an Observation.

Parameters:

params (list of Parameter) – Parameters that define the model. Each entry should carry a name and a data type.

__init__(params: list[Parameter])[source]#

Methods

__init__(params)

evaluate(observation, *params)

Evaluate the model at the given parameter values.

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

Evaluate the model at the given parameter values.

Must be overridden by subclasses.

Parameters:
  • observation (Observation) – Observation containing the independent-variable grid.

  • *params (float) – Model parameter values.

Returns:

np.ndarray – Predicted observable values on the observation grid.

Raises:

NotImplementedError – Always — subclasses must implement this method.