Transition probabilities in a linear SDE dX = A*X*dt + u*dt + G*dB

dLinSDE(A, G, t, x0 = NULL, u = NULL, S0 = 0 * A)

Arguments

A

system matrix, quadratic numeric array or matrix

G

noise matrix, same number of rows as A

t

time, numeric scalar

x0

Initial state

u

forcing. A numeric vector or matrix; see details

S0

Initial variance

Value

A list containing St, the variance of the state at time t, and, depending on input arguments

eAt, the matrix that maps X0 to Xt, i.e. expm(A*t), provided x0==NULL

EX, the expectation of the state at time t, provided x0 is not NULL

Details

When returning EX, the expectation at time t, the input u can be specified as follows:

* NULL, in which case it is assumed to be absent from the equation

* a numeric vector with an element for each row in A. In this case u is assumed to be constant

* a numeric array or matrix with same number of rows as A and two columns. In this case u is assumed to vary affinely in time, equaling the first column at time 0 and the second column at time t.

The computations are not optimized for large systems, since they rely on the vector form of the matrix equations and do not use sparsity.

Examples

# A scalar equation with no input
(dLinSDE(-1,1,1))
#> $eAt
#>           [,1]
#> [1,] 0.3678794
#> 
#> $St
#>           [,1]
#> [1,] 0.4323324
#> 
# A scalar equation with constant input, starting in steady-state
(dLinSDE(A=-1,G=1,t=3,x0=1,u=1,S0=0.5))
#> $EX
#> [1] 1
#> 
#> $St
#>      [,1]
#> [1,]  0.5
#>