IntegratedOrnsteinUhlenbeckProcess¶
- class probnum.randprocs.markov.integrator.IntegratedOrnsteinUhlenbeckProcess(driftspeed, initarg, num_derivatives=1, wiener_process_dimension=1, initrv=None, diffuse=False, forward_implementation='classic', backward_implementation='classic')¶
Bases:
MarkovProcess
Integrated Ornstein-Uhlenbeck process.
Convenience access to \(\nu\) times integrated (\(d\) dimensional) Ornstein-Uhlenbeck processes.
- Parameters
driftspeed – Drift-speed of the underlying OrnsteinUhlenbeck process.
initarg – Initial time point.
num_derivatives – Number of modelled derivatives of the integrated process (‘’order’’, ‘’number of integrations’’). Optional. Default is \(\nu=1\).
wiener_process_dimension – Dimension of the underlying Wiener process. Optional. Default is \(d=1\). The dimension of the integrated Wiener process itself is \(d(\nu + 1)\).
initrv – Law of the integrated Wiener process at the initial time point. Optional. Default is a \(d(\nu + 1)\) dimensional standard-normal distribution.
diffuse – Whether to instantiate a diffuse prior. A diffuse prior has large initial variances. Optional. Default is False. If True, and if an initial random variable is not passed, an initial random variable is created, where the initial covariance is of the form \(\kappa I_{d(\nu + 1)}\) with \(\kappa=10^6\). Diffuse priors are used when initial distributions are not known. They are common for filtering-based probabilistic ODE solvers.
forward_implementation – Implementation of the forward-propagation in the underlying transitions. Optional. Default is classic. sqrt implementation is more computationally expensive, but also more stable.
backward_implementation – Implementation of the backward-conditioning in the underlying transitions. Optional. Default is classic. sqrt implementation is more computationally expensive, but also more stable.
- Raises
Warning – If initrv is not None and diffuse is True.
Examples
>>> ioup1 = IntegratedOrnsteinUhlenbeckProcess(driftspeed=1., initarg=0.) >>> print(ioup1) <IntegratedOrnsteinUhlenbeckProcess with input_shape=(), output_shape=(2,), dtype=float64>
>>> ioup2 = IntegratedOrnsteinUhlenbeckProcess(driftspeed=1.,initarg=0., num_derivatives=2) >>> print(ioup2) <IntegratedOrnsteinUhlenbeckProcess with input_shape=(), output_shape=(3,), dtype=float64>
>>> ioup3 = IntegratedOrnsteinUhlenbeckProcess(driftspeed=1.,initarg=0., wiener_process_dimension=10) >>> print(ioup3) <IntegratedOrnsteinUhlenbeckProcess with input_shape=(), output_shape=(20,), dtype=float64>
>>> ioup4 = IntegratedOrnsteinUhlenbeckProcess(driftspeed=1.,initarg=0., num_derivatives=4, wiener_process_dimension=1) >>> print(ioup4) <IntegratedOrnsteinUhlenbeckProcess with input_shape=(), output_shape=(5,), dtype=float64>
Attributes Summary
Covariance function \(k(x_0, x_1)\) of the random process.
Data type of (elements of) the random process evaluated at an input.
Syntactic sugar for
len(input_shape)
.Shape of inputs to the random process.
Mean function \(m(x) := \mathbb{E}[f(x)]\) of the random process.
Syntactic sugar for
len(output_shape)
.Shape of the random process evaluated at an input.
Methods Summary
__call__
(args)Evaluate the random process at a set of input arguments.
marginal
(args)Batch of random variables defining the marginal distributions at the inputs.
push_forward
(args, base_measure, sample)Transform samples from a base measure into samples from the random process.
sample
(rng[, args, size])Sample paths from the random process.
std
(args)Standard deviation function.
var
(args)Variance function.
Attributes Documentation
- cov¶
Covariance function \(k(x_0, x_1)\) of the random process.
\begin{equation} k(x_0, x_1) := \mathbb{E} \left[ (f(x_0) - \mathbb{E}[f(x_0)]) (f(x_1) - \mathbb{E}[f(x_1)])^\top \right] \end{equation}
- dtype¶
Data type of (elements of) the random process evaluated at an input.
- input_ndim¶
Syntactic sugar for
len(input_shape)
.
- input_shape¶
Shape of inputs to the random process.
- mean¶
Mean function \(m(x) := \mathbb{E}[f(x)]\) of the random process.
- output_ndim¶
Syntactic sugar for
len(output_shape)
.
- output_shape¶
Shape of the random process evaluated at an input.
Methods Documentation
- __call__(args)¶
Evaluate the random process at a set of input arguments.
- Parameters
args (Union[floating, ndarray]) – shape=
batch_shape +
input_shape
– (Batch of) input(s) at which to evaluate the random process. Currently, we requirebatch_shape
to have at most one dimension.- Returns
shape=
batch_shape +
output_shape
– Random process evaluated at the input(s).- Return type
- marginal(args)¶
Batch of random variables defining the marginal distributions at the inputs.
- Parameters
args (InputType) – shape=
batch_shape +
input_shape
– (Batch of) input(s) at which to evaluate the random process. Currently, we requirebatch_shape
to have at most one dimension.- Return type
- push_forward(args, base_measure, sample)¶
Transform samples from a base measure into samples from the random process.
This function can be used to control sampling from the random process by explicitly passing samples from a base measure evaluated at the input arguments.
- Parameters
args (InputType) – Input arguments.
base_measure (Type[RandomVariable]) – Base measure. Given as a type of random variable.
sample (ndarray) – shape=
sample_shape +
input_shape
– (Batch of) input(s) at which to evaluate the random process. Currently, we requiresample_shape
to have at most one dimension.
- Return type
- sample(rng, args=None, size=())¶
Sample paths from the random process.
If no inputs are provided this function returns sample paths which are callables, otherwise random variables corresponding to the input locations are returned.
- Parameters
rng (Generator) – Random number generator.
args (Optional[InputType]) – shape=
size +
input_shape
– (Batch of) input(s) at which the sample paths will be evaluated. Currently, we requiresize
to have at most one dimension. IfNone
, sample paths, i.e. callables are returned.size (ShapeLike) – Size of the sample.
- Return type
- std(args)¶
Standard deviation function.
- Parameters
args (InputType) – shape=
batch_shape +
input_shape
– (Batch of) input(s) at which to evaluate the standard deviation function.- Returns
shape=
batch_shape +
output_shape
– Standard deviation of the process atargs
.- Return type
OutputType
- var(args)¶
Variance function.
Returns the variance function which is the value of the covariance or kernel evaluated elementwise at
args
for each output dimension separately.- Parameters
args (InputType) – shape=
batch_shape +
input_shape
– (Batch of) input(s) at which to evaluate the variance function.- Returns
shape=
batch_shape +
output_shape
– Variance of the process atargs
.- Return type
OutputType