Introduction

Real problems are mathematically modeled by stochastic differential equations (SDE) or, in more complicated cases, by nonlinear stochastic differential equations of the Itô type. Most of these equations do not have analytical solution, so it is important to find their approximate solution. In recent years, some different numerical methods for solving stochastic differential or stochastic integral equations have been presented [18]. The topic of our study is the integral form of SDE as follows:

x ( t ) = x 0 + 0 t k 1 ( t , s ) b ( s , x ( s ) ) ds + 0 t k 2 ( t , s ) σ ( s , x ( s ) ) dB ( s ) , t [ 0 , 1 ) ,
(1)

where x0 is a random variable independent of B(t), B = (B(t),t ≥ 0) is a Brownian motion, and stochastic process x is a strong solution of Equation 1 which is adapted to {г t ,t ≥ 0} Furthermore, all Lebesgue’s and Itô’s integrals in Equation 1 are well defined [9].

Block pulse functions (BPFs) have been studied by many authors and applied for solving different problems [1012]. In this paper, we used the stochastic operational matrix of BPFs for reducing the nonlinear stochastic differential equation to a set of algebraic equations.

The paper is ordered as follows: In ‘BPFs and their properties properties’ section, a brief review of the BPFs is presented. The ‘Implementation in stochastic integral equation’ section is devoted to the formulation of nonlinear SDE. In the ‘Error analysis’ section, convergence analysis of the method is discussed. In the ‘Numerical examples’ section, some numerical examples are provided. Finally, the ‘Conclusion’ section gives a brief conclusion.

BPFs and their properties

In this paper, BPFs are defined over [0,1). We consider m-set of BPFs as

ϕ i ( t ) = 1 ( i - 1 ) h t < ih , i = 1 , , m , 0 otherwise ,

where h= 1 m . The BPFs have the following properties:

  1. 1.

    Disjointness

    ϕ i ( t ) ϕ j ( t ) = δ ij ϕ i ( t ) ,

where i,j = 1,2,…,m and δ ij  is the Kronecker delta.

  1. 2.

    Orthogonality

    0 1 ϕ i ( t ) ϕ j ( t ) dt = h δ ij , i , j = 1 , 2 , , m .
  2. 3.

    Completeness

If m → , then the BPF set is complete, i.e., for every f ∈ L2([0,1)), Parseval’s identity holds,

0 1 f 2 ( t ) dt = i = 1 f i 2 ϕ i ( t ) 2 ,

where

f i = 1 h 0 1 f(t) ϕ i (t)dt.
(2)

Let

Φ ( t ) = ϕ 1 ( t ) , ϕ 2 ( t ) , , ϕ m ( t ) T , t [ 0 , 1 ) ,

so

Φ ( t ) Φ T ( t ) = ϕ 1 ( t ) 0 0 0 ϕ 2 ( t ) 0 0 0 ϕ m ( t ) m × m ,
Φ T ( t ) Φ ( t ) = 1 ,

and

Φ ( t ) Φ T ( t ) v = v ~ Φ ( t ) ,

where v is the m-vector, v ~ is the m × m matrix, and v ~ =diag(v). It is easy to see that

Φ T (t)(t)= A ̂ T Φ(t),
(3)

where A is the m × m matrix and A ̂ T is the m-vector with elements equal to the diagonal entries of matrix A.

An arbitrary real bounded function f(t), which is square integrable in the interval t ∈ [0,1), can be expanded as

f(t) f ̂ m (t)= i = 1 m f i ϕ i (t)= Φ T (t)F,
(4)

where f i  is the block pulse coefficient that is defined by (2). Let k(t,s) be a function of two variables in L2 ([0,1) × [0,1)). It can be similarly expanded with respect to BPFs as

k(t,s) Φ T (t)KΨ(s),
(5)

where Ψ(s) and Φ(t) are m1,m2-dimensional block pulse vectors, respectively. Also, K is the m1 × m2 block pulse coefficient matrix with

k ij = m 1 m 2 0 1 0 1 k ( t , s ) ϕ i ( t ) ψ j ( s ) dtds , i = 1 , 2 , , m 1 , j = 1 , 2 , , m 2 .

For convenience, we put m1 = m2 = m.

Lebesgue and Itô integral can be approximated as

0 t Φ(s)dsPΦ(t)
(6)

and

0 t Φ(s)dB(s) P s Φ(t),
(7)

where operational matrices P and P s  are given in [6]. So we can write

0 t f(s)ds 0 t F T Φ(s)ds F T PΦ(t)
(8)

and

0 t f(s)dB(s) 0 t F T Φ(s)dB(s) F T P s Φ(t).
(9)

Implementation in stochastic integral equation

Using the block pulse operational matrices, first, we find the collocation approximation to the functions z1(t) and z2(t) defined by

z 1 (t)=b t , x ( t ) , z 2 (t)=σ t , x ( t ) .
(10)

From Equations 1 and 10, we get

x(t)= x 0 + 0 t k 1 (t,s) z 1 (s)ds+ 0 t k 2 (t,s) z 2 (s)dB(s),
(11)

and

z 1 ( t ) = b t , x 0 + 0 t k 1 ( t , s ) z 1 ( s ) ds + 0 t k 2 ( t , s ) z 2 ( s ) dB ( s ) , z 2 ( t ) = σ t , x 0 + 0 t k 1 ( t , s ) z 1 ( s ) ds + 0 t k 2 ( t , s ) z 2 ( s ) dB ( s ) .
(12)

We approximate z1(t),z2(t), and k i (t,s),i = 1,2, by block pulse series as follows:

z 1 ( t ) z ̂ 1 ( t ) = Z 1 T Φ ( t ) = Φ T ( t ) Z 1 ,
(13)
z 2 ( t ) z ̂ 2 ( t ) = Z 2 T Φ ( t ) = Φ T ( t ) Z 2 ,
(14)
k i ( t , s ) k i ̂ ( t , s ) = Φ T ( t ) K i Φ ( s ) , i = 1 , 2 ,
(15)

such that m-vectors Z1, Z2, and m × m matrix K i  are block pulse coefficients of z1(t) and z2(t) and k i (t,s), respectively. By substituting Equations 13 and 14 in Equation 11, we get

0 t k 1 ( t , s ) z 1 ( s ) ds 0 t Φ T ( t ) K 1 Φ ( s ) Φ T ( s ) Z 1 ds = Φ T ( t ) K 1 0 t Φ ( s ) Φ T ( s ) Z 1 ds Φ T ( t ) K 1 0 t Z 1 ~ Φ ( s ) ds Φ T ( t ) K 1 Z 1 ~ P Φ ( t ) ;
(16)

also, the Itô integral of Equation 11 can be written as

0 t k 2 ( t , s ) z 2 ( s ) dB ( s ) 0 t Φ T ( t ) K 2 Φ ( s ) Φ T ( s ) Z 2 dB ( s ) = Φ T ( t ) K 2 0 t Φ ( s ) Φ T ( s ) Z 2 dB ( s ) Φ T ( t ) K 2 0 t Z 2 ~ Φ ( s ) dB ( s ) Φ T ( t ) K 2 Z 2 ~ P s Φ ( t ) ,
(17)

where Z ~ 1 =diag( Z 1 ), Z ~ 2 =diag( Z 2 ). By substituting (16) and (17) into (12) and replacing ≃ with =, we obtain

Z 1 T Φ ( t ) = b t , x 0 + Φ T ( t ) K 1 Z 1 ~ P Φ ( t ) + Φ T ( t ) K 2 Z 2 ~ P s Φ ( t ) , Z 2 T Φ ( t ) = σ t , x 0 + Φ T ( t ) K 1 Z 1 ~ P Φ ( t ) + Φ T ( t ) K 2 Z 2 ~ P s Φ ( t ) .
(18)

Now, we collocate Equation 18 in m nodes t j = j m + 1 ,j=1,,m, as

Z 1 T Φ ( t j ) = b t j , x 0 + Φ T ( t j ) K 1 Z 1 ~ P Φ ( t j ) + Φ T ( t j ) K 2 Z 2 ~ P s Φ ( t j ) , Z 2 T Φ ( t j ) = σ t j , x 0 + Φ T ( t j ) K 1 Z 1 ~ P Φ ( t j ) + Φ T ( t j ) K 2 Z 2 ~ P s Φ ( t j ) .
(19)

After solving nonlinear system (19), we obtain Z1 and Z2. Then, we can approximate the solution of Equation 11 as follows:

x(t) x m (t)= x 0 + Φ T (t) K 1 Z 1 ~ PΦ(t)+ Φ T (t) K 2 Z 2 ~ P s Φ(t).
(20)

Error analysis

In the following theorems, suppose that the functions b(x,y),σ(x,y) satisfy the Lipschitz and linear growth conditions such that

|b(t, x 1 (t))-b(t, x 2 (t))|+|σ(t, x 1 (t))-σ(t, x 2 (t))|L| x 1 - x 2 |
(21)

and

|b(t,x(t))|+|σ(t,x(t))|L(1+|x|).
(22)

Theorem 1

Let f (t) be an arbitrary real bounded function, which is square integrable in the interval [0,1), ande(t)=f(t)- f ̂ m (t), t ∈ [0,1), where f ̂ m (t)= i = 1 m f i ϕ i (t), is the block pulse series of f(t). Then,

e ( t ) 2 O ( h 2 ) .

Proof

See [8]. □

Theorem 2

Suppose that f(t,s) ∈ [0,1) × [0,1), ande(t,s)=f(t,s)- f ̂ m (t,s), (t,s) ∈ J, where f ̂ m (t,s)= i = 1 m j = 1 m f ij ψ i (t) ϕ j (s), is the block pulse series of f(t,s) Then,

e ( t , s ) 2 O ( h 2 ) .

Proof

See [8]. □

Theorem 3

Let x(t) and x m (t) be the exact solution and approximate solution of (1), respectively; furthermore, let conditions (21), (22), and (i)x(t) ∥ ≤ M, t ∈ I = [0,1), (ii) ∥ k i (t,s) ∥ ≤ M i , (t,s) ∈ I × I, i = 1,2, hold; then,

x ( t ) - x m ( t ) 0 ,

where

x ( t ) 2 = E | x ( t ) | 2 .

Proof

Let e i (t)= z i (t)- z ̂ i (t) be the error function, where z i (t) is defined in (10) and z ̂ i (t),i=1,2 is the approximated form of z i (t) by BPFs, i.e.,

z ̂ 1 ( s ) = b ̂ s , x m ( s ) , z ̂ 2 ( s ) = σ ̂ s , x m ( s ) ,

and

z 1 m ( s ) = b s , x m ( s ) , z 2 m ( s ) = σ s , x m ( s ) .

From Lipschitz condition and Theorem 2, we get

z i ( t ) - z ̂ i ( t ) z i ( t ) - z i m ( t ) + z ̂ i ( t ) - z i m ( t ) L x ( t ) - x m ( t ) + c i h ,
(23)

where i = 1,2. Let e m (t) = x(t) - x m (t). We can write

e m (t) I 1 + I 2 ,
(24)

where

I 1 = 0 t [ k 1 ( t , s ) z 1 ( s ) - k ̂ 1 ( t , s ) z ̂ 1 ( s ) ] ds , I 2 = 0 t [ k 2 ( t , s ) z 2 ( s ) - k ̂ 2 ( t , s ) z ̂ 2 ( s ) ] dB ( s ) .
(25)

For I1, we get

I 1 0 t ( k 1 ( t , s ) z 1 ( s ) - z ̂ 1 ( s ) ) ds + 0 t ( z ̂ 1 ( s ) k 1 ( t , s ) - k ̂ 1 ( t , s ) ) ds , M 1 L 0 t e m ( s ) ds + c 1 h + c 3 h 0 t z 1 ( s ) - z ̂ 1 ( s ) ds + 0 t z 1 ( s ) ds L ( M 1 + c 3 h ) 0 t e m ( s ) ds + O ( h ) .
(26)

From Itô isometry, we can write

I 2 0 t [ k 2 ( t , s ) z 2 ( s ) - k ̂ 2 ( t , s ) z ̂ 2 ( s ) ] dB ( s ) 0 t k 2 ( t , s ) z 2 ( s ) - k ̂ 2 ( t , s ) z ̂ 2 ( s ) ds 0 t ( k 2 ( t , s ) z 2 ( s ) - z ̂ 2 ( s ) ) ds + 0 t ( z ̂ 2 ( s ) k 2 ( t , s ) - k ̂ 2 ( t , s ) ) ds , M 2 L 0 t e m ( s ) ds + c 2 h + c 4 h 0 t z 2 ( s ) - z ̂ 2 ( s ) ds + 0 t z 2 ( s ) ds L ( M 2 + c 4 h ) 0 t e m ( s ) ds + O ( h ) .
(27)

Equations 26, 27, and 24 conclude that

e m (t)α 0 t e m (s)ds+O(h),
(28)

where α = L(M1 + c3h) + L(M2 + c4h). Hence, from (28) and Gronwall inequality, we get

e m ( t ) O ( h ) ( 1 + α 0 t e α ( t - s ) ds ) , t [ 0 , 1 )

and then we get h= 1 m ; by increasing m, it implies ∥e m (t) ∥ → 0 as m → . □

Numerical examples

To illustrate efficiency and accuracy of presented method, we solve some real-world problems.

Example 1

A simple model for the size x of a population at time t is the model of exponential growth

dx(t)=ax(t)dt,
(29)

where a is the growth coefficient. An appropriate modification of Equation 29 is given as a linear quadratic Verhulst equation:

dx(t)=x(t)(λ-x(t))dt,
(30)

where the population growth a is replaced by λ - x. By randomizing the parameter λ in Equation 30 to λ + σξ (t), where ξ(t)= dB ( t ) dt is a white noise of zero mean, we have the usual stochastic Verhulst equation describing more precisely the population dynamics

dx(t)=x(t)(λ-x(t))dt+σx(t)dB(t),
(31)

in which λ and σ are positive constants [1315]. The exact solution of Equation 31 is given as follows [1]:

x ( t ) = x 0 e ( λ - 1 2 σ 2 ) t + σ B ( t ) 1 + x 0 0 t e ( λ - 1 2 σ 2 ) s + σ B ( s ) ds .

Let X i  denote the block pulse coefficient of exact solution and Y i  be the block pulse coefficient of computed solutions by the presented method. The error is defined as

E = max 1 i m | X i - Y i | .

In Table 1, x ¯ E is the error mean and s E  is the standard deviation of errors in k iteration. In addition, we consider x0 = 0.5, λ = 1,and σ = 0.25.

Table 1 Mean, standard deviation, and confidence interval for error mean ( m = 32, k = 500)

Example 2

In finance, the Vasicek model is a mathematical model describing the evolution of interest rates. This model can be used for interest rate derivative valuation and also adapted for credit market. Vasicek’s pioneering work (1977), which is based on the Ornstein-Uhlenbeck process, is the first account of a bond pricing model that incorporates stochastic interest rate and can be also seen as a stochastic investment model. The short-term interest rate process ( r ( t ) ) t R + solves the equation

dr(t)=a(b-r(t))dt+σdB(t),
(32)

where B(t),t ≥ 0 is a standard Brownian motion, d r(t) is the change in the short-term interest rate, a is the speed of mean reversion, b is the average interest rate, and σ is the volatility of the short rate. The main disadvantage is that, under Vasicek’s model, it is theoretically possible for the interest rate to become negative, which is an undesirable feature. This shortcoming was fixed in the Cox-Ingersoll-Ross (CIR) model. The CIR process is a Markov process with continuous paths defined by the following SDE:

dr(t)=β(α-r(t))dt+σ r ( t ) dB(t).
(33)

The parameter β corresponds to the speed of adjustment, α to the mean and σ to volatility. Equation 33 has no analytical solution. This process is widely used in finance to model short-term interest rate. The approximated solution by the presented method is shown in Figure 1.

Figure 1
figure 1

Numerical results for β = 0 . 05, α = 0 . 3, σ = 0 . 002, and r (0) = 0 . 03.

Conclusion

The aim of the presented paper is to apply a method for solving nonlinear stochastic differential equations. The properties of the BPFs with the collocation method are used to reduce the problem to a system of nonlinear algebraic equations. The advantage of this method is the low cost of setting up the equations due to the properties of BPFs. For showing efficiency, the method is applied to some practical problems. The results show accuracy of the method.