# TimeSeriesRegressionProblem¶

class probnum.problems.TimeSeriesRegressionProblem(locations, observations, measurement_models, solution=None)

Bases: `object`

Time series regression problem.

Fit a stochastic process to data, given a likelihood (realised by a `NonlinearGaussian` transition). Solved by filters and smoothers in `probnum.filtsmooth`.

Parameters:
• observations (Union[Sequence, np.ndarray]) – Observations of the latent process.

• locations (Union[Sequence, np.ndarray]) – Grid-points on which the observations were taken.

• measurement_models (Union[Sequence, np.ndarray]) – Measurement models.

• solution (Optional[Union[Sequence, np.ndarray]]) – Array containing solution to the problem at `locations`. Used for testing and benchmarking.

Examples

```>>> import numpy as np
>>> from probnum import randprocs, randvars
>>> obs = [11.4123, -15.5123]
>>> loc = [0.1, 0.2]
>>> transition_matrix = np.eye(1)
>>> noise = randvars.Normal(mean=np.ones((1,)), cov=np.eye(1))
>>> model = randprocs.markov.discrete.LTIGaussian(
...     transition_matrix=transition_matrix, noise=noise
... )
>>> measurement_models = [model, model]
>>> rp = TimeSeriesRegressionProblem(
...     observations=obs, locations=loc,
...     measurement_models=measurement_models,
... )
>>> rp
TimeSeriesRegressionProblem(locations=[0.1, 0.2],
observations=[11.4123, -15.5123],
measurement_models=[LTIGaussian(input_dim=1, output_dim=1),
LTIGaussian(input_dim=1, output_dim=1)], solution=None)
>>> rp.observations
[11.4123, -15.5123]
```

Regression problems are also indexable.

```>>> len(rp)
2
>>> rp[0]
(0.1, 11.4123, LTIGaussian(input_dim=1, output_dim=1))
```

Attributes Summary

Attributes Documentation

solution: Sequence | np.ndarray | None = None