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)
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
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.
# 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
#>
# A 2D system which has no stationary variance
(dLinSDE(A=diag(c(0,-1)),G=diag(2),t=1))
#> $eAt
#> [,1] [,2]
#> [1,] 1 0.0000000
#> [2,] 0 0.3678794
#>
#> $St
#> 2 x 2 Matrix of class "dgeMatrix"
#> [,1] [,2]
#> [1,] 1 0.0000000
#> [2,] 0 0.4323324
#>