MarkovProcess¶
-
class
probnum.randprocs.
MarkovProcess
(initarg, initrv, transition)¶ Bases:
probnum.randprocs.RandomProcess
Random processes with the Markov property.
A Markov process is a random process with the additional property that conditioned on the present state of the system its future and past states are independent. This is known as the Markov property or as the process being memoryless. A Markov process can be fully defined via an initial state and a state transition.
- Parameters
initarg (
ndarray
) – Initial starting input of the process.initrv (
RandomVariable
) – Random variable describing the initial state.transition (
Transition
) – State transition of the system.
See also
RandomProcess
Random processes.
GaussianProcess
Gaussian processes.
Attributes Summary
Data type of (elements of) the random process evaluated at an input.
Shape of inputs to the random process.
Shape of the random process evaluated at an input.
Methods Summary
__call__
(args)Evaluate the random process at a set of input arguments.
cov
(args0[, args1])Covariance function or kernel.
marginal
(args)Batch of random variables defining the marginal distributions at the inputs.
mean
(args)Mean function.
push_forward
(args, base_measure, sample)Transform samples from a base measure into samples from the random process.
sample
([args, size, random_state])Sample paths from the random process.
std
(args)Standard deviation function.
var
(args)Variance function.
Attributes Documentation
Methods Documentation
-
__call__
(args)[source]¶ Evaluate the random process at a set of input arguments.
-
cov
(args0, args1=None)[source]¶ Covariance function or kernel.
Returns the covariance function \(\operatorname{Cov}(f(x_0), f(x_1)) = \mathbb{E}[(f(x_0) - \mathbb{E}[f(x_0)])(f(x_0) - \mathbb{E}[f( x_0)])^\top]\) of the process evaluated at \(x_0\) and \(x_1\). If only
args0
is given the covariance among the components of the random process at the inputs defined byargs0
is computed.- Parameters
- Returns
shape=(), (output_dim, output_dim), (n0, n1) or (n0, n1, output_dim, output_dim) – Covariance of the process at
args0
andargs1
. If onlyargs0
is given the kernel matrix \(K=k(x_0, x_0)\) is computed.- Return type
_OutputType
-
marginal
(args)¶ Batch of random variables defining the marginal distributions at the inputs.
- Parameters
args (~InputType) – shape=(input_dim,) or (n, input_dim) – Input(s) to evaluate random process at.
- Return type
_RandomVariableList
-
push_forward
(args, base_measure, sample)[source]¶ 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.
-
sample
(args=None, size=(), random_state=None)¶ 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
args (
Optional
[~InputType]) – shape=(input_dim,) or (n, input_dim) – Evaluation input(s) of the sample paths of the process. IfNone
, sample paths, i.e. callables are returned.size (
Union
[Integral
,Iterable
[Integral
]]) – Size of the sample.random_state (
Union
[None
,int
,RandomState
,Generator
]) – Random state of the random process. If None (or np.random), the globalnumpy.random
state is used. If integer, it is used to seed the localRandomState
instance.
- Return type
-
std
(args)¶ Standard deviation function.
- Parameters
args (~InputType) – shape=(input_dim,) or (n, input_dim) – Input(s) to the standard deviation function.
- Returns
shape=(), (output_dim,) or (n, output_dim) – Standard deviation of the process at
args
.- 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=(input_dim,) or (n, input_dim) – Input(s) to the variance function.
- Returns
shape=(), (output_dim,) or (n, output_dim) – Variance of the process at
args
.- Return type
_OutputType