Skip to main content

ORIGINAL RESEARCH article

Front. Artif. Intell., 02 August 2021
Sec. Machine Learning and Artificial Intelligence
This article is part of the Research Topic Tensor Methods for Deep Learning View all 5 articles

Solution of the Fokker–Planck Equation by Cross Approximation Method in the Tensor Train Format

Andrei Chertkov
Andrei Chertkov*Ivan OseledetsIvan Oseledets
  • Skolkovo Institute of Science and Technology, Moscow, Russia

We propose the novel numerical scheme for solution of the multidimensional Fokker–Planck equation, which is based on the Chebyshev interpolation and the spectral differentiation techniques as well as low rank tensor approximations, namely, the tensor train decomposition and the multidimensional cross approximation method, which in combination makes it possible to drastically reduce the number of degrees of freedom required to maintain accuracy as dimensionality increases. We demonstrate the effectiveness of the proposed approach on a number of multidimensional problems, including Ornstein-Uhlenbeck process and the dumbbell model. The developed computationally efficient solver can be used in a wide range of practically significant problems, including density estimation in machine learning applications.

1 Introduction

Fokker–Planck equation (FPE) is an important in studying properties of the dynamical systems, and has attracted a lot of attention in different fields. In recent years, FPE has become widespread in the machine learning community in the context of the important problems of density estimation (Grathwohl et al., 2018) for neural ordinary differential equation (ODE) (Chen et al., 2018; Chen and Duvenaud, 2019), generative models (Kidger et al., 2021), etc.

Consider a stochastic dynamical system which is described by stochastic differential equation (SDE) of the form1

dx=f(x,t)dt+S(x,t)dβ,dβdβ=Q(t)dt,x=x(t)d,(1)

where dβ is a q-dimensional space-time white noise, f is a known d-dimensional vector-function and Sd×q, Qq×q are known matrices. The FPE for the corresponding probability density function (PDF) ρ(x,t) of the spatial variable x has the form

ρ(x,t)t=i=1dj=1dxixj[Dij(x,t)ρ(x,t)]i=1dxi[fi(x,t)ρ(x,t)],(2)

where D(x,t)=12S(x,t)Q(t)S(x,t) is a diffusion tensor.

One of the major complications in solution of the FPE is the high dimensionality of the practically significant computational problems. Complexity of using grid-based representation of the solution grows exponentially with d, thus some low-parametric representations are required. One of the promising directions is the usage of low-rank tensor methods, studied in (Dolgov et al., 2012). The equation is discretized on a tensor-product grid, such that the solution is represented as a d-dimensional tensor, and this tensor is approximated in the low-rank tensor train format (TT-format) (Oseledets, 2011). Even with such complexity reduction, the computations often take a long time. In this paper we propose another approach of using low-rank tensor methods for the solution of the FPE, based on its intimate connection to the dynamical systems.

The key idea can be illustrated for S=0, i.e. in the deterministic case. For this case the evolution of the PDF along the trajectory is given by the formula

ρ(x,t)t=Tr(f(x,t)x)ρ(x,t),(3)

where Tr() is a trace operation for the matrix. Hence, to compute the value of ρ(x,t) at the specific point x=x^, it is sufficient to find a preimage x^0 such that if it is used as an initial condition for eq. 1, then we arrive to x^. To find the preimage, we need to integrate the eq. 1 backwards in time, and then to find the PDF value, we integrate a system of eqs 1, 3. Since we can evaluate the value of ρ(x,t) at any x^, we can use the cross approximation method (CAM) (Oseledets and Tyrtyshnikov, 2010; Savostyanov and Oseledets, 2011; Dolgov and Savostyanov, 2020) in the TT-format to recover a supposedly low-rank tensor from its samples. In this way we do not need to have any compact representation of f, but only numerically solve the corresponding ODE. For S0 the situation is more complicated, but we develop a splitting and multidimensional interpolation schemes that allow us effectively recompute the values of the density from some time moment t to the next step t+h.

To summarize, main contributions of our paper are the following:

• we derive a formula to recompute the values of the PDF on each time step, using the second order operator splitting, Chebyshev interpolation and spectral differentiation techniques;

• we propose to use a TT-format and CAM to approximate the solution of the FPE which makes it possible to drastically reduce the number of degrees of freedom required to maintain accuracy as dimensionality increases;

• we implement FPE solver, based on the proposed approach, as a publicly available python code2, and we test our approach on several examples, including multidimensional Ornstein-Uhlenbeck process and dumbbell model, which demonstrate its efficiency and robustness.

2 Computation of the Probability Density Function

For ease of demonstration of the proposed approach, we suppose that the noise βq has the same dimension as the spatial variable xd (q=d), and the matrices in eq. 1 and eq. 2 have the form3

Q(t)Id,S(x,t)2χId,D(x,t)χId,(4)

where χ0 is a scalar diffusion coefficient. Then eqs 1, 2 can be rewritten in a more compact form

dx=f(x,t)dt+2χdβ,dβdβ=Iddt,(5)
ρt=χΔρdiv[f(x,t)ρ],(6)

where d-dimensional spatial variable x=x(t)Ωd has the corresponding PDF ρ(x,t) with initial conditions

x(0)=x0ρ(x,0),ρ(x,0)=ρ0(x).(7)

To construct the PDF at some moment τ (τ>0) for the known initial distribution ρ0(x), we discretize eqs 5, 6 on the uniform time grid with M (M2) points

tm=mh,h=τM1,m=0,1,,M1,(8)

and introduce the notation xm=x(tm) for value of the spatial variable at the moment tm and ρm()=ρ(,tm) for values of the PDF at the same moment.

2.1 Splitting Scheme

Let V^ and W^ be diffusion and convection operators from the eq. 6

V^vχΔv,W^wdiv[f(x,t)w],(9)

then on each time step m (m=0,1,,M2) we can integrate equation

ρt=(V^+W^)ρ,ρ(,tm)=ρm(),(10)

on the interval (tm,tm+h), to find ρm+1 for the known value ρm from the previous time step. Its solution can be represented in the form of the product of an initial solution with the matrix exponential

ρm+1=eh(V^+W^)ρm,(11)

and if we apply the standard second order operator splitting technique (Glowinski et al., 2017), then

ρm+1eh2V^ehW^eh2V^ρm,(12)

which is equivalent to the sequential solution of the following equations

v(1)t=χΔv(1),v(1)(,tm)=ρm(),(13)
wt=div[f(x,t)w],w(,tm)=v(1)(,tm+h2),(14)
v(2)t=χΔv(2),v(2)(,tm)=w(,tm+h),(15)

with the final approximation of the solution ρm+1()=v(2)(,tm+h2).

2.2 Interpolation of the Solution

To efficiently solve the convection eq. 14, we need the ability to calculate the solution of the diffusion eq. 13 at arbitrary spatial points, hence the natural choice for the discretization in the spatial domain are Chebyshev nodes, which makes it possible to interpolate the corresponding function on each time step by the Chebyshev polynomials (Trefethen, 2000).

We introduce the d-dimensional spatial grid X(g) as a tensor product of the one-dimensional grids4

xk(g)Nk,xk(g)[nk]=cosπ(nk1)Nk1,nk=1,2,,Nk,(16)

where Nk (Nk2) is a number of points along the kth spatial axis (k=1,2,,d), and the total number of the grid points is N=N1N2Nd. Note that this grid can be also represented in the flatten form as a following matrix

X(g)d×N,X(g)[k,n]=xk(g)[mind(n)[k]],(17)

where n=1,2,,N, k=1,2,,d and by mind(n)=[n1,n2,,nd we denoted an operation of construction of the multi-index from the flatten long index according to the big-endian convention

n=nd+(nd11)Nd++(n11)N2N3Nd.(18)

Suppose that we calculated PDF ρm on some time step m (m0) at the nodes of the spatial grid X(g) [note that for the case m=0, the corresponding values come from the known initial condition ρ0(x)]. These values can be collected as elements of a tensor5mN1×N2××Nd such that

m[n1,n2,,nd]=ρm(x1(g)[n1],x2(g)[n2],,xd(g)[nd]),(19)

where nk=1,2,,Nk (k=1,2,,d).

Let us interpolate PDF ρm via the system of orthogonal Chebyshev polynomials of the first kind

T0(x)=1,T1(x)=x,Tk+1(x)=2xTk(x)Tk1(x)fork=1,2,,(20)

in the form of the naturally cropped sum

ρm(x)ρm˜(x)==n1=1N1n2=1N2nd=1NdAm[n1,n2,,nd]Tn11(x1)Tn21(x2)Tnd1(xd),(21)

where x=(x1,x2,,xd) is some spatial point and interpolation coefficients are elements of the tensor AmN1×N2××Nd. For construction of this tensor we should set equality in the interpolation nodes eq. 16

ρm˜(x1(g)[n1],x2(g)[n2],,xd(g)[nd])=ρm(x1(g)[n1],x2(g)[n2],,xd(g)[nd])(22)

for all combinations of nk=1,2,,Nk (k=1,2,,d).

Therefore the interpolation process can be represented as a transformation of the tensor m to the tensor Am according to the system of eq. 22. If the Chebyshev polynomials and nodes are used for interpolation, then a good way is to apply a fast Fourier transform (FFT) (Trefethen, 2000) for this transformation. However the exponential growth of computational complexity and memory consumption with the growth of the number of spatial dimensions makes it impossible to calculate and store related tensors for the multidimensional case in the dense data format. Hence in the next sections we present an efficient algorithm for construction of the tensor Am in the low-rank TT-format.

2.3 Solution of the Diffusion Equation

To solve the diffusion eqs 13, 15 on the Chebyshev grid, we discretize Laplace operator using the second order Chebyshev differential matrices [see, for example, (Trefethen, 2000)] DkNk×Nk such that Dk=D˜kD˜k, where for each spatial dimension k=1,2,,d

D˜k[i,j]=2(Nk1)2+16,i=j=1,xk(g)[j]2(1(xk(g)[j])2),i=j=2,3,,Nk1,cicj(1)i+jxk(g)[i]xk(g)[j],ij,i,j=2,3,,Nk1,2(Nk1)2+16,i=j=Nk,(23)

with ci=2 if i=1 or i=Nk and ci=1 otherwise, and one dimensional grid points xk(g) defined from eq. 16. Then discretized Laplace operator has the form6

Δ=D1IN2INd+IN1D2INd++IN1IN2Dd.(24)

Let VmN1×N2××Nd be the known initial condition for the diffusion equation on the time step m (tm=mh), then for the solution Vm+12 at the moment tm+h2 we have

vec(Vm+12)=eh2χΔvec(Vm),(25)

where an operation vec() constructs a vector from the tensor by a standard reshaping procedure like eq. 18. And finally due to the well known property of the matrix exponential, we come to

vec(Vm+12)=(eh2χD1eh2χD2eh2χDd)vec(Vm).(26)

If we can represent the initial condition Vm in the form of Kronecker product of the one-dimensional tensors (for example, in terms of the TT-format in the form of the Kronecker products of the TT-cores, as will be presented below in this work), then we can efficiently evaluate the formula eq. 26 to obtain the desired approximation for solution vec(Vm+12).

2.4 Solution of the Convection Equation

Convection eq. 14 can be reformulated in terms of the FPE without diffusion part, when the corresponding ODE has the form

dx=f(x,t)dt,x=x(t)d,xρ(x,t).(27)

If we consider the differentiation along the trajectory of the particles, as was briefly described in the Introduction, then

(wt)x=x(t)=k=1dwxkxkt+wt=k=1dwxkxktdiv[fw]==k=1dwxkfkk=1dfkxkwk=1dfkwxk=k=1dfkxkw,(28)

where we replaced the term wt by the right hand side of eq. 14 and xkt by the right hand side of the corresponding equation in eq. 27.

Hence equation for w may be rewritten in terms of the trajectory integration of the following system

{xt=f(x,t),wt=Tr(fx(x,t))w(29)

Let us integrate eq. 29 on a time step m (m=0,1,,M2). If we set any spatial grid point x*=X(g)[:,n] (n=1,2,,N) as initial condition for the spatial variable, then we’ll obtain solution w^m+1 for some point x^m+1 outside the grid (see Figure 1 with the illustration for the two-dimensional case). Hence we should firstly solve eq. 27 backward in time to find the corresponding spatial point x^m that will be transformed to the grid point x* by the step m+1. If we select this point x^m and the related value w^m=w(x^m,tm) as initial conditions for the system eq. 29, then its solution wm+1 will be related to the point of interest x*.

FIGURE 1
www.frontiersin.org

FIGURE 1. Evolution of the spatial variable and the corresponding PDF for two consecutive time steps related to the fixed Chebyshev grid in the case of two dimensions.

Note that, according to our splitting scheme, we solve the convection part eq. 14 after the corresponding diffusion eq. 13, and hence the initial condition wm is already known and defined as a tensor WmN1×N2××Nd on the Chebyshev spatial grid. Using this tensor, we can perform interpolation according to the formula eq. 22 and calculate the tensor of interpolation coefficients Am. Then we can evaluate the approximated value at the point x^m as wm˜(x^m) according to eq. 21.

Hence our solution strategy for convection equation is the following. For the given spatial grid point x*=X(g)[:,n] we integrate equation

xt=f(x,t),x(tm+1)=x*,(30)

backward in time to find the corresponding point x^m=x(tm). Then we find the value of w at this point, using interpolation wm˜, and then we solve the system eq. 29 on the time interval (tm,tm+h) with initial condition (x^m,wm˜(x^m)) to obtain the value wm+1 at the point x*. The described process should be repeated for each grid point (n=1,2,,N) and, ultimately, we’ll obtain a tensor Wm+1N1×N2××Nd which is the approximated solution of convection part eq. 14 of the splitting scheme on the Chebyshev spatial grid.

An important contribution of this paper is an indication of the possibility and a practical implementation of the usage of the multidimensional CAM in the TT-format to recover a supposedly low-rank tensor Wm+1 from computations on only a part of specially selected spatial grid points. This scheme will be described in more details later in the work after setting out the fundamentals of the TT-format.

3 Low-Rank Representation

There has been much interest lately in the development of data-sparse tensor formats for high-dimensional problems. A very promising tensor format is provided by the tensor train (TT) approach (Oseledets and Tyrtyshnikov, 2009; Oseledets, 2011), which was proposed for compact representation and approximation of high-dimensional tensors. It can be computed via standard decompositions (such as SVD and QR-decomposition) but does not suffer from the curse of dimensionality7.

In many analytical considerations and practical cases a tensor is given implicitly by a procedure enabling us to compute any of its elements, so the tensor appears rather as a black box. For example, to construct the convection part of PDF (i.e., the tensor Wm introduced above), we should compute the corresponding function for all possible sets of indices. This process requires an extremely large number of operations and can be time-consuming, so it may be useful to find some suitable low-parametric approximation of this tensor using only a small portion of all tensor elements. CAM (Oseledets and Tyrtyshnikov, 2010) which is a widely used method for approximation of high-dimensional tensors looks appropriate for this case.

In this section we describe the properties of the TT-format and multidimensional CAM that are necessary for efficient solution of our problem, as well as the specific features of the practical implementation of interpolation by the Chebyshev polynomials in terms of the TT-format and CAM.

3.1 Tensor Train Format

A tensor N1×N2××Nd is said to be in the TT-format (Oseledets, 2011), if its elements are represented by the formula

[n1,n2,,nd]=r1=1R1r2=1R2rd1=1Rd1G1[1,n1,r1]G2[r1,n2,r2]Gd1[rd2,nd1,rd1]Gd[rd1,nd,1](31)

where nk=1,2,,Nk (k=1,2,,d), three-dimensional tensors GkRk1×Nk×Rk are named TT-cores, and integers R0,R1,,Rd (with convention R0=Rd=1) are named TT-ranks. The latter formula can be also rewritten in a more compact form

[n1,n2,,nd]=G1(n1)G2(n2)Gd(nd),(32)

where Gk(nk)=Gk[:,nk,:] is an Rk1×Rk matrix for each fixed nk (since R0=Rd=1, the result of matrix multiplications in eq. 32 is a scalar). And a vector form of the TT-decomposition looks like

vec()=r1=1R1r2=1R2rd1=1Rd1G1[1,:,r1]G2[r1,:,r2]Gd[rd1,:,1],(33)

where the slices of the TT-cores Gk are vectors of length Nk (k=1,2,,d).

The benefit of the TT-decomposition is the following. Storage of the TT-cores G1,G2,,Gd requires less or equal than d×max1kd(NkRk2) memory cells (instead of N=N1N2NdN0d cells for the uncompressed tensor, where N0 is an average size of the tensor modes), and hence the TT-decomposition is free from the curse of dimensionality if the TT-ranks are bounded.

The detailed description of the TT-format and linear algebra operations in terms of this format8 is given in works (Oseledets and Tyrtyshnikov, 2009; Oseledets, 2011). It is important to note that for a given tensor ^ in the full format, the TT-decomposition (compression) can be performed by a stable TT-SVD algorithm. This algorithm constructs an approximation in the TT-format to the given tensor ^ with a prescribed accuracy ϵTT in the Frobenius norm9

^FϵTT^F,(34)

but a procedure of the tensor approximation in the full format is too costly, and is even impossible for large dimensions due to the curse of dimensionality. Therefore more efficient algorithms like CAM are needed to quickly construct the tensor in the low rank TT-format.

www.frontiersin.org

3.2 Cross Approximation Method

The CAM allows to construct a TT-approximation of the tensor with prescribed accuracy ϵCA, using only part of the full tensor elements. This method is a multi-dimensional analogue of the simple cross approximation method for the matrices (Tyrtyshnikov, 2000) that allows one to approximate large matrices in O(N0R2) time by computing only O(N0R) elements, where N0 is an average size of the matrix modes and R is the rank of the matrix. The CAM and the TT-format can significantly speed up the computation and reduce the amount of consumed memory as will be illustrated in the next sections on the solution of the model equations.

The CAM constructs a TT-approximation to the tensor ^, given as a function f(n1,n2,,nd), that returns the (n1,n2,,nd) th entry of ^ for a given set of indices. This method requires only

www.frontiersin.org

O(d×max1kd(NkRk3)) operations for the construction of the approximation with a prescribed accuracy ϵCA, where R0,R1,,Rd (R0=Rd=1) are TT-ranks of the tensor [see detailed discussion of the CAM in (Oseledets and Tyrtyshnikov, 2010)]. It should be noted that TT-ranks can depend on the value of selected accuracy ϵCA, but for a wide class of practically interesting tasks the TT-ranks are bounded or depend polylogarithmically on ϵCA [(Oseledets, 2010; Oseledets, 2011) for more details and examples]. In Algorithm 1 the description of the process of construction of the tensor in the TT-format on the Chebyshev grid by the CAM is presented (we’ll call it as a function crossX() below). We prepare function func, which transforms given indices into the spatial grid points and return an array of the corresponding values of the target r(). Then this function is passed as an argument to the standard rank adaptive method tt_rectcross from the ttpy package. The CAM is described in more detail in the original papers (Oseledets and Tyrtyshnikov, 2010; Savostyanov and Oseledets, 2011), as well as in a recent work (Dolgov and Savostyanov, 2020), which formulates a computationally efficient parallel implementation of the algorithm.

3.3 Multidimensional Interpolation

As was discussed in the previous sections, we discretize the FPE on the multidimensional Chebyshev grid and interpolate solution of the first diffusion equation in the splitting scheme eq. 13 by the Chebyshev polynomials to obtain its values on custom spatial points (different from the grid nodes) and then perform efficient trajectory integration of the convection eq. 14.

The desired interpolation may be constructed from solution of the system of eq. 22 in terms of the FFT (Trefethen, 2000), but for the high dimension numbers we have the exponential growth of computational complexity and memory consumption, hence it is very promising to construct tensor of the nodal values and the corresponding interpolation coefficients in the TT-format.

Consider a TT-tensor N1×N2××Nd with the list of TT-cores [G1,G2,Gd], which collects PDF values on the nodes of the Chebyshev grid at some time step (the related function is r(x), and this tensor is obtained, for example, by the CAM or according to TT-SVD procedure from the tensor in the full format). Then the corresponding TT-tensor AN1×N2××Nd of interpolation coefficients with the TT-cores [G˜1,G˜2,G˜d] can be constructed according to the scheme, which is presented in Algorithm 2 [we’ll call it as a function interpolate() below].

In this Algorithm we use standard linear algebra operations swapaxes and reshape, which rearrange the axes and change the dimension of the given tensor respectively, function fft for construction of the one-dimensional FFT for the given vector, and function tt_round from the ttpy package, which round the given tensor to the prescribed accuracy ϵ. Note that the inner loop in Algorithm 2 for r* may be replaced by the vectorized computations of the corresponding two-dimensional FFT.

For the known tensor A we can perform a fast computation of the function value at any given spatial point x=[x1,x2,,xd] by a matrix product of the convolutions of the TT-cores of A with appropriate column vectors of Chebyshev polynomials

r(x)r1=1R1r2=1R2rd1=1Rd1(n1=1N1G˜1[1,n1,r1]Tn11(x1))(n2=1N2G˜2[r1,n2,r2]Tn21(x2))(nd=1NdG˜d[rd1,nd,1]Tnd1(xd)),(35)

We’ll call the corresponding function as inter_eval(A,X) below. This function constructs a list of r() values for the given set of I points Xd×I (I1), using interpolation coefficients A and sequentially applying the formula eq. 35 for each spatial point.

4 Detailed Algorithms

In Algorithms 3, 4 and 5 we combine the theoretical details discussed in the previous sections of this work and present the final calculation scheme for solution of the multidimensional FPE in the TT-format, using CAM (function crossX, Algorithm 1)10 and interpolation by the Chebyshev polynomials (function interpolate from Algorithm 2 that constructs interpolation coefficients and function inter_eval that evaluates interpolation result at given points according to the formula eq. 35).

We denote by einsum the standard linear algebra operation that evaluates the Einstein summation convention on the operands (see, for example, the numpy python package). Function vstack stack arrays in sequence vertically, function ode_solve(rhs,t1,t2,Y0) (where t1 and t2 are initial and final times, rhs is the right hand side of equations, and matrix Y0 collects initial conditions) solves a system of ODE with vectorized initial condition by the one step of the fourth order Runge-Kutta method.

www.frontiersin.org

www.frontiersin.org

www.frontiersin.org

5 Numerical Examples

In this section we illustrate the proposed computational scheme, which was presented above, with the numerical experiments. All calculations were carried out in the Google Colab cloud interface11 with the standard configuration (without GPU support).

Firstly we consider an equation with a linear convection term—Ornstein-Uhlenbeck process (OUP) (Vatiwutipong and Phewchean, 2019) in one, three and five dimensions. For the one-dimensional case, which is presented for convention, we only solve equation using the dense format (not TT-format), hence the corresponding results are used to verify the general correctness and convergence properties of the proposed algorithm, but not its efficiency. In the case of the multivariate problems we use the proposed tensor based solver, which operates in accordance with the algorithm described above. To check the results of our computations, we use the known analytic stationary solution for the OUP, and for the one-dimensional case we also perform comparison with constructed analytic solution at any time moment.

Then we consider more complicated dumbbell problem (Venkiteswaran and Junk, 2005) which may be represented as a three-dimensional FPE with a nonlinear convection term. For this case we consider the Kramer expression and compare our computation results with the results from another works for the same problem.

In the numerical experiments we consider the spatial region Ω such that PDF is almost vanish on the boundaries ρ(x,t)|Ω0, and the initial condition is selected in the form of the Gaussian function

ρ(x,0)=ρ0(x)=(2πs)d2exp[12s||x||2],s,s>0,(36)

where parameter s is selected as s=1. To estimate the accuracy of the obtained PDF (ρ) we use the relative 2-norm of deviation from the exact value (ρexact)

e=||ρρexact||2|ρexact||2.(37)

We compute the value ρexact through the given function, using a CAM with an accuracy parameter two orders of magnitude higher, than the one that was used in the solver.

5.1 Numerical Solution of the Ornstein-Uhlenbeck Process

Consider FPE of the form eq. 6 in the d-dimensional case with

f(x,t)=A(μx(t)),χ=12,xΩ=[xmin,xmax]d,t[0,τ],(38)

where Ad×d is invertible real matrix, μd is the long-term mean, xmin and xmax (xmin<xmax), τ (τ>0). This equation is a well known multivariate OUP with the following properties [see for example (Singh et al., 2018; Vatiwutipong and Phewchean, 2019)]:

• mean vector is

M(t,x0)=eAtx0+(IdeAt)μ;(39)

• covariance matrix is

Σ(t)=0teA(st)SSeA(st)ds,(40)

and, in our case as noted above S=2χId;

• transitional PDF is

ρ(x,t,x0)=exp[12(xM(t,x0))Σ1(t)(xM(t,x0))]|2πΣ(t)|;(41)

• stationary solution is

ρst(x)=exp[12xW1x](2π)ddet(W),(42)

where matrix Wd×d can be found from the following equation

AW+WA=2χId;(43)

• the (multivariate) OUP at any time is a (multivariate) normal random variable;

• the OUP is mean-reverting (the solution tends to its long-term mean μ as time t tends to infinity) if all eigenvalues of A are positive (if A>0 in the one-dimensional case).

5.1.1 One-Dimensional Process

Let consider the one-dimensional (d=1) OUP with

A=1,μ=0,xmin=5,xmax=5,τ=10.(44)

We can calculate the analytic solution in terms of only spatial variable and time via integration of the transitional PDF eq. 41

ρ(x,t)=ρ(x,t,x0)ρ0(x0)dx0.(45)

Accurate computations lead to the following formula

ρ(x,t)=12π(Σ(t)+se2At)exp[x22(Σ(t)+se2At)],(46)

where Σ(t) is defined by eq. 40 and for the one-dimensional case may be represented in the form

Σ(t)=1e2At2A.(47)

Using the formulas eq. 42 and eq. 43 we can represent a stationary solution for the one-dimensional case in the explicit form

ρstat(x)=AπeAx2.(48)

We perform computation for N1=50 spatial points and M=1000 time points and compare the numerical solution with the known analytic eq. 46 and stationary eq. 48 solution. In the Figure 2 we present the corresponding result. Over time, the error of the numerical solution relative to the analytical solution first increases slightly, and then stabilizes at approximately 105. At the same time, the numerical solution approaches the stationary one, and the corresponding error at large times also becomes approximately 105. Note that the time to build the solution was about 5 s.

FIGURE 2
www.frontiersin.org

FIGURE 2. Relative error of the calculated solution vs known analytic and stationary solutions for the one-dimensional OUP.

5.1.2 Three-Dimensional Process

Our next example is the three-dimensional (d=3) OUP with the following parameters

A=[1.5100100.50.31],μ=0,xmin=5,xmax=5,τ=5.(49)

When carrying out numerical calculation, we select 104 as the accuracy of the CAM, 100 as a total number of time points and 30 as a number of points along each of the spatial dimensions. The computation result is compared with the stationary solution eq. 42 which was obtained as solution of the related matrix eq. 43 by a standard solver for Lyapunov equation.

The result is shown in Figure 3. As can be seen, the TT-rank12 remains limited, and the accuracy of the solution over time grows, reaching 103 by the time t=5. The time to build the solution was about 26 s.

FIGURE 3
www.frontiersin.org

FIGURE 3. Relative error of the calculated solution vs known stationary solution (A) and the effective TT-rank (B) for the three-dimensional OUP.

To evaluate the efficiency of the proposed algorithm in the TT-format, we also solve these three-dimensional OUP, using dense format (as for the one-dimensional case, all arrays are presented in its full form). The corresponding calculation took about 376 s, so in this case we have an acceleration of calculations by more than an order of magnitude.

5.1.3 Five-Dimensional Process

This multidimensional case is considered in the same manner as the previous one. We select the following parameters

A=[1.500000100000100000100.50.30.201],μ=0,xmin=5,xmax=5,τ=5.(50)

We select the same values as in the previous example for the CAM accuracy (104), the number of time points (100) and the number of spatial points (30), and compare result of the computation with the stationary solution from eq. 42 and eq. 43.

The results are presented on the plots on Figure 4. The TT-rank of the solution remains limited and reaches the value 4.5 at the end time step, and the solution accuracy reaches almost 103. The time to build the solution was about 100 s.

FIGURE 4
www.frontiersin.org

FIGURE 4. Relative error of the calculated solution vs known stationary solution (A) and the effective TT-rank (B) for the five-dimensional OUP.

5.2 Numerical Solution of the Dumbbell Problem

Now consider a more complex non-linear example corresponding to the three-dimensional (d=3) dumbbell model of the form eq. 6 with13

f(x,t)=Ax12ϕ,A=β[010000000],ϕ=||x||22+αp3e||x||22p2,(51)

where

χ=12,xΩ=[10,10]3,t[0,10],α=0.1,β=1,p=0.5.(52)

Making simple calculations (taking into account the specific form of the matrix A), we get explicit expressions for the function and the required partial derivatives (k=1,2,3)

f=β[x200]12x+α2p5e||x||22p2x,(53)
fkxk=12+α2p5e||x||22p2α2p7e||x||22p2xk2.(54)

Next, we consider the Kramer expression

τ(t)=ρ(x,t)[xϕ]dx,(55)

and as the values of interest (as in the works (Venkiteswaran and Junk, 2005; Dolgov et al., 2012)) we select

ψ(t)=τ11(t)τ22(t)β2=1β2ρ(x,t)(x1ϕx1x2ϕx2),(56)
η(t)=τ12(t)β=1βρ(x,t)x1ϕx2.(57)

During the calculations we used the following solver parameters:

• the accuracy of the CAM is 105;

• the number of time grid points is 100;

• the number of grid points along each of the spatial dimensions is 60.

The results are presented on the plots on Figure 5. The time to build the solution was about 200 s (also additional time was required to calculate the values ψ(t) and η(t) from eq. 56 and eq. 57 respectively). As can be seen, the TT-rank remains limited, and its stationary value is about 8. We compared the obtained stationary values of the ψ(t) and η(t) variables:

ψ(t=10)=2.0707,η(t=10)=1.0318,(58)

with the corresponding results from (Dolgov et al., 2012)14, and we get the following values for relative errors

ϵψ=1.9×104,ϵη=9.7×104.(59)

FIGURE 5
www.frontiersin.org

FIGURE 5. Computed values (A) and the effective TT-rank (B) for the three-dimensional dumbbell problem.

6 Related Works

The problem of uncertainty propagation through nonlinear dynamical systems subject to stochastic excitation is given by the FPE, which describes the evolution of the PDF, and has been extensively studied in the literature. A number of numerical methods such as the path integral technique (Wehner and Wolfer, 1983; Subramaniam and Vedula, 2017), the finite difference and the finite element method (Kumar and Narayanan, 2006; Pichler et al., 2013) have been proposed to solve the FPE.

These methods inevitably require mesh or associated transformations, which increase the amount of computation. The problem becomes worse when the system dimension increases. To maintain accuracy in traditional discretization based numerical methods, the number of degrees of freedom of the approximation, i.e. the number of unknowns, grows exponentially as the dimensionality of the underlying state-space increases.

On the other hand, the Monte Carlo method, that is common for such kind of problems (Kikuchi et al., 1991; Küchlin and Jenny, 2017), has slow rate of convergence, causing it to become computationally burdensome as the underlying dimensionality increases. Hence, the so-called curse of dimensionality fundamentally limits the use of the FPE for uncertainty quantification in high dimensional systems.

In recent years, low-rank tensor approximations have become especially popular for solving multidimensional problems in various fields of knowledge (Cichocki et al., 2016). However, for the FPE, this approach is not yet widely used. We note the works (Dolgov et al., 2012; Sun and Kumar, 2014; Sun and Kumar, 2015; Dolgov, 2019; Fox et al., 2020) in which the low-rank TT-decomposition was proposed for solution of the multidimensional FPE. In these works, the differential operator and the right-hand side of the system are represented in the form of TT-tensor. Moreover, in paper (Dolgov et al., 2012) the joint discretization of the solution in space-time is considered. The difference of our approach from these works is its more explicit iterative form for time integration, as well as the absence of the need to represent the right hand side of the system in a low-rank format, which allows to use this approach in machine learning applications.

7 Conclusion

In this paper we proposed the novel numerical scheme for solution of the multidimensional Fokker–Planck equation, which is based on the Chebyshev interpolation and spectral differentiation techniques as well as low rank tensor approximations, namely, the tensor train decomposition and cross approximation method, which in combination make it possible to drastically reduce the number of degrees of freedom required to maintain accuracy as dimensionality increases.

The proposed approach can be used for the numerical analysis of uncertainty propagation through nonlinear dynamical systems subject to stochastic excitations, and we demonstrated its effectiveness on a number of multidimensional problems, including Ornstein-Uhlenbeck process and dumbbell model.

As part of the further development of this work, we plan to conduct more rigorous estimates of the convergence of the proposed scheme, as well as formulate a set of heuristics for the optimal choice of number of time and spatial grid points and tensor train rank. Another promising direction for further research is the application of established approaches and developed solver to the problem of density estimation for machine learning models.

Data Availability Statement

Program code, input data and calculation results can be found here: https://github.com/AndreiChertkov/fpcross

Author Contributions

IO contributed to general formulation of the problem and formulation of the preliminary version of the algorithm. AC contributed to development of the final version of algorithms and program code, carrying out numerical experiments.

Funding

The work was supported by Ministry of Science and Higher Education grant No. 075-10-2021-068.

Conflict of Interest

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Publisher’s Note

All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.

Footnotes

1Vectors and matrices are denoted hereinafter by lower case bold letters (a,b,c,) and upper case letters (A,B,C,) respectively. We denote the (i1,i2) th element of an N1×N2 matrix A as A[i1,i2] and assume that 1i1N1, 1i2N2. For vectors we use the same notation: a[i] is the i-th element of the vector a (i=1,2,,N). In addition, for a compact representation of an i-th (i=1,2,,d, where d1) element of a vector function f= [f1,f2,,fd], we will use the notation fi, which means fi()=fi()[i].

2The code is publicly available from https://github.com/AndreiChertkov/fpcross.

3We use notation Ik for the k×k (k=1,2,) identity matrix.

4We suppose that for each spatial dimension the variable x varies within [1,1]. In other cases, an appropriate scaling can be easily applied.

5By tensors we mean multidimensional arrays with a number of dimensions d (d1). A two-dimensional tensor (d=2) is a matrix, and when d=1 it is a vector. For tensors with d>2 we use upper case calligraphic letters (A,,C,). The (n1,n2,,nd) th entry of a d-dimensional tensor AN1×N2××Nd is denoted by A[n1,n2,,nd], where nk=1,2,,Nk (k=1,2,,d) and Nk is a size of the k-th mode, and mode-k slice of such tensor is denoted by A[n1,,nk1,:,nk+1,,nd].

6Note that for the case N1=N2==NdN0, we have only one matrix D1=D2==DdD0N0×N0 which greatly simplifies the computation process.

7By the full format tensor representation or uncompressed tensor we mean the case, when one calculates and saves in the memory all tensor elements. The number of elements of an uncompressed tensor (hence, the memory required to store it) and the amount of operations required to perform basic operations with such tensor grows exponentially in the dimensionality, and this problem is called the curse of dimensionality.

8All basic operations in the TT-format are implemented in the ttpy python package https://github.com/oseledets/ttpy and its MATLAB version https://github.com/oseledets/TT-Toolbox.

9An exact TT-representation exists for the given full tensor ^, and TT-ranks of such representation are bounded by ranks of the corresponding unfolding matrices (Oseledets, 2011). Nevertheless, in practical applications it is more useful to construct TT-approximation with a prescribed accuracy ϵTT, and then carry out all operations (summations, products, etc) in the TT-format, maintaining the same accuracy ϵTT of the result.

10Note that in Algorithm 4 we use the solution of the convection part from the previous time step (k1) as an initial guess W0 for CAM on the next time step (k). As it was found empirically It may seem more logical to use the solution of the diffusion part from the same time step (k) as an initial guess, but we found empirically that it leads to higher TT-ranks of the result.

11Actual links to the corresponding Colab notebooks are available in our public repository https://github.com/AndreiChertkov/fpcross.

12Hereinafter, we present effective TT-rank of the computation result. For TT-tensor XN1×N2××Nd with TT-ranks R0,R1,,Rd (R0=Rd=1) the effective TT-rank R^ is a solution of quadratic equation N1R^+α=2d1NαR^2+NdR^=α=1dNαRα1Rα. The representation with a constant TT-rank R^ (R^0=1, R^1=R^2=R^d1=R^, R^d=1) yields the same total number of parameters as in the original decomposition of the tensor X.

13This choice of parameters corresponds to the problem of polymer modeling from the work (Venkiteswaran and Junk, 2005). In the corresponding model, the molecules of the polymer are represented by beads and interactions are indicated by connecting springs. Accordingly, for the case of only two particles we come to the dumbbell problem, which can be mathematically written in the form of the FPE.

14As values for comparison, we used the result of the most accurate calculation from work (Dolgov et al., 2012), within which ψ^(t=10)=2.071143, and η^(t=10)=1.0328125.

References

Chen, R. T., and Duvenaud, D. (2019). Neural Networks with Cheap Differential Operators. New York, NY: arXiv preprint arXiv:1912.03579.

Chen, T. Q., Rubanova, Y., Bettencourt, J., and Duvenaud, D. K. (2018). Neural Ordinary Differential Equations. Adv. Neural Inf. Process. Syst., 6571–6583.

Google Scholar

Cichocki, A., Lee, N., Oseledets, I., Phan, A.-H., Zhao, Q., and Mandic, D. P. (2016). Tensor Networks for Dimensionality Reduction and Large-Scale Optimization: Part 1 Low-Rank Tensor Decompositions. FNT Machine Learn. 9, 249–429. doi:10.1561/2200000059

CrossRef Full Text | Google Scholar

Dolgov, S., and Savostyanov, D. (2020). Parallel Cross Interpolation for High-Precision Calculation of High-Dimensional Integrals. Comp. Phys. Commun. 246, 106869. doi:10.1016/j.cpc.2019.106869

CrossRef Full Text | Google Scholar

Dolgov, S. V. (2019). A Tensor Decomposition Algorithm for Large Odes with Conservation Laws. Comput. Methods Appl. Math. 19, 23–38. doi:10.1515/cmam-2018-0023

CrossRef Full Text | Google Scholar

Dolgov, S. V., Khoromskij, B. N., and Oseledets, I. V. (2012). Fast Solution of Parabolic Problems in the Tensor Train/Quantized Tensor Train Format with Initial Application to the Fokker--Planck Equation. SIAM J. Sci. Comput. 34, A3016–A3038. doi:10.1137/120864210

CrossRef Full Text | Google Scholar

Fox, C., Dolgov, S., Morrison, M. E., and Molteno, T. C. (2020). Grid Methods for Bayes-Optimal Continuous-Discrete Filtering and Utilizing a Functional Tensor Train Representation. Inverse Probl. Sci. Eng., 1–19. doi:10.1080/17415977.2020.1862109

Google Scholar

Glowinski, R., Osher, S. J., and Yin, W. (2017). Splitting Methods in Communication, Imaging, Science, and Engineering. Springer.

Grathwohl, W., Chen, R. T., Bettencourt, J., Sutskever, I., and Duvenaud, D. (2018). Ffjord: Free-form Continuous Dynamics for Scalable Reversible Generative Models. arXiv preprint arXiv:1810.01367.

Kidger, P., Foster, J., Li, X., Oberhauser, H., and Lyons, T. (2021). Neural Sdes as Infinite-Dimensional gans. arXiv preprint arXiv:2102.03657.

Kikuchi, K., Yoshida, M., Maekawa, T., and Watanabe, H. (1991). Metropolis Monte Carlo Method as a Numerical Technique to Solve the Fokker-Planck Equation. Chem. Phys. Lett. 185, 335–338. doi:10.1016/s0009-2614(91)85070-d

CrossRef Full Text | Google Scholar

Küchlin, S., and Jenny, P. (2017). Parallel Fokker-Planck-DSMC Algorithm for Rarefied Gas Flow Simulation in Complex Domains at All Knudsen Numbers. J. Comput. Phys. 328, 258–277. doi:10.1016/j.jcp.2016.10.018

CrossRef Full Text | Google Scholar

Kumar, P., and Narayanan, S. (2006). Solution of Fokker-Planck Equation by Finite Element and Finite Difference Methods for Nonlinear Systems. Sadhana 31, 445–461. doi:10.1007/bf02716786

CrossRef Full Text | Google Scholar

Oseledets, I., and Tyrtyshnikov, E. (2010). Tt-cross Approximation for Multidimensional Arrays. Linear Algebra its Appl. 432, 70–88. doi:10.1016/j.laa.2009.07.024

CrossRef Full Text | Google Scholar

Oseledets, I. V. (2010). Approximation of $2^d\times2^d$ Matrices Using Tensor Decomposition. SIAM J. Matrix Anal. Appl. 31, 2130–2145. doi:10.1137/090757861

CrossRef Full Text | Google Scholar

Oseledets, I. V. (2011). Tensor-train Decomposition. SIAM J. Sci. Comput. 33, 2295–2317. doi:10.1137/090752286

CrossRef Full Text | Google Scholar

Oseledets, I. V., and Tyrtyshnikov, E. E. (2009). Breaking the Curse of Dimensionality, or How to Use Svd in many Dimensions. SIAM J. Sci. Comput. 31, 3744–3759. doi:10.1137/090748330

CrossRef Full Text | Google Scholar

Pichler, L., Masud, A., and Bergman, L. A. (2013). “Numerical Solution of the Fokker-Planck Equation by Finite Difference and Finite Element Methods-A Comparative Study,” in Computational Methods in Stochastic Dynamics (Springer), 69–85. doi:10.1007/978-94-007-5134-7_5

CrossRef Full Text | Google Scholar

Savostyanov, D., and Oseledets, I. (2011). “Fast Adaptive Interpolation of Multi-Dimensional Arrays in Tensor Train Format,” in The 2011 International Workshop on Multidimensional (nD) Systems (IEEE), 1–8. doi:10.1109/nds.2011.6076873

CrossRef Full Text | Google Scholar

Singh, R., Ghosh, D., and Adhikari, R. (2018). Fast Bayesian Inference of the Multivariate Ornstein-Uhlenbeck Process. Phys. Rev. E 98, 012136. doi:10.1103/PhysRevE.98.012136

PubMed Abstract | CrossRef Full Text | Google Scholar

Subramaniam, G. M., and Vedula, P. (2017). A Transformed Path Integral Approach for Solution of the Fokker-Planck Equation. J. Comput. Phys. 346, 49–70. doi:10.1016/j.jcp.2017.06.002

CrossRef Full Text | Google Scholar

Sun, Y., and Kumar, M. (2015). A Numerical Solver for High Dimensional Transient Fokker-Planck Equation in Modeling Polymeric Fluids. J. Comput. Phys. 289, 149–168. doi:10.1016/j.jcp.2015.02.026

CrossRef Full Text | Google Scholar

Sun, Y., and Kumar, M. (2014). Numerical Solution of High Dimensional Stationary Fokker-Planck Equations via Tensor Decomposition and Chebyshev Spectral Differentiation. Comput. Math. Appl. 67, 1960–1977. doi:10.1016/j.camwa.2014.04.017

CrossRef Full Text | Google Scholar

Trefethen, L. N. (2000). Spectral Methods in MATLAB, Vol. 10. Philadelphia, PA: Siam.

Tyrtyshnikov, E. (2000). Incomplete Cross Approximation in the Mosaic-Skeleton Method. Computing 64, 367–380. doi:10.1007/s006070070031

CrossRef Full Text | Google Scholar

Vatiwutipong, P., and Phewchean, N. (2019). Alternative Way to Derive the Distribution of the Multivariate Ornstein-Uhlenbeck Process. Adv. Differ. Equ 2019, 276. doi:10.1186/s13662-019-2214-1

CrossRef Full Text | Google Scholar

Venkiteswaran, G., and Junk, M. (2005). A QMC Approach for High Dimensional Fokker-Planck Equations Modelling Polymeric Liquids. Mathematics Comput. Simulation 68, 43–56. doi:10.1016/j.matcom.2004.09.002

CrossRef Full Text | Google Scholar

Wehner, M. F., and Wolfer, W. G. (1983). Numerical Evaluation of Path-Integral Solutions to Fokker-Planck Equations. Phys. Rev. A. 27, 2663–2670. doi:10.1103/physreva.27.2663

CrossRef Full Text | Google Scholar

Keywords: fokker-planck equation, probability density function, tensor train format, cross approximation, chebyshev polynomial, ornstein-uhlenbeck process, dumbbell model

Citation: Chertkov A and Oseledets I (2021) Solution of the Fokker–Planck Equation by Cross Approximation Method in the Tensor Train Format. Front. Artif. Intell. 4:668215. doi: 10.3389/frai.2021.668215

Received: 15 February 2021; Accepted: 29 June 2021;
Published: 02 August 2021.

Edited by:

Evangelos Papalexakis, University of California, Riverside, United States

Reviewed by:

Devin Matthews, Southern Methodist University, United States
Prakash Vedula, University of Oklahoma, United States

Copyright © 2021 Chertkov and Oseledets. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.

*Correspondence: Andrei Chertkov, a.chertkov@skoltech.ru

Disclaimer: All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article or claim that may be made by its manufacturer is not guaranteed or endorsed by the publisher.