Earth Temperature Model

The Earth Temperature Model is a very simple 1D Model with an analytical solution.

class Temperature(central_param: ndarray = array([0.78539816]), param_limits: ndarray = array([[0., 1.57079633]]), name: str | None = None, **kwargs)[source]

Bases: Model

The model describes the temperature \(y\) in degree celsius at a given latitude \(q\) in degree.

\[ \begin{align}\begin{aligned}s: [0^{\circ}, 90^{\circ}] \rightarrow [-30, 30]\\q \mapsto y = s(q) := 60 \cdot \cos{(q)} - 30\end{aligned}\end{align} \]

\(q=0^{\circ}\) corresponds to the equator and \(q=90^{\circ}\) to the north pole.

forward(param)[source]

Evaluates the temperature at the given latitude using the model equation

\[y = 60 \cdot \cos{(q)} - 30\]
jacobian(param)[source]

Calculates the analytical jacobian of the model equation at the given latitude

\[\frac{dy}{dq} = -60 \cdot \sin{(q)}\]
CENTRAL_PARAM = array([0.78539816])

The central latitude is \(\pi/4 = 45^{\circ}\)

PARAM_LIMITS = array([[0.        , 1.57079633]])

The latitude is between \(0^{\circ}\) and \(90^{\circ}\)

data_dim: int | None = 1

The temperature in degree celsius

param_dim: int | None = 1

The latitude of the location

class TemperatureArtificial(central_param: ndarray = array([0.78539816]), param_limits: ndarray = array([[0., 1.57079633]]), name: str | None = None, **kwargs)[source]

Bases: Temperature, ArtificialModelInterface

generate_artificial_params(num_data_points: int = -1)[source]

This method must be overwritten an return an numpy array of num_samples parameters.

Parameters:

num_samples (int) – The number of parameters to generate.

Returns:

The generated parameters.

Return type:

np.ndarray

Raises:

NotImplementedError – If the method is not overwritten in a subclass.

class TemperatureWithFixedParams(low_T: float64 = -30.0, high_T: float64 = 30.0, name: str | None = None, **kwargs)[source]

Bases: Temperature

The model describes the temperature \(y\) in degree celsius at a given latitude \(q\) in degree.

Note

  • Additional fixed parameters: The model includes fixed parameters self.low_T=30.0 and self.high_T=30.0. These fixed parameters are passed to the calc_forward function separately. You can create models with different parameters by creating several model objects. The best way to separate the outputs for the parametrized models is to pass a string based on the fixed_params to the attribute run_name of the inference() function.

  • The functions calc_forward() is not strictly necessary. However it can help to make it work with jax.

calc_forward(param, high_T, low_T)[source]
calc_jacobian(param, high_T, low_T)[source]
forward(param)[source]

Evaluates the temperature at the given latitude using the model equation

\[y = 60 \cdot \cos{(q)} - 30\]
jacobian(param)[source]

Calculates the analytical jacobian of the model equation at the given latitude

\[\frac{dy}{dq} = -60 \cdot \sin{(q)}\]