# Combining Polynomial Chaos Expansions and the Random Variable Transformation Technique to Approximate the Density Function of Stochastic Problems, Including Some Epidemiological Models

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Method

#### 2.1. gPC Expansions

#### 2.2. RVT Technique

**Theorem**

**1**

#### 2.3. Combining gPC and RVT Technique to Approximate the Density Function

## 3. Numerical Experiments

^{®}, version 11.2 (Wolfram Research, Inc.: Champaign, IL, USA, 2017) [41], installed on an Intel

^{®}Core

^{TM}i7 CPU 3.1 GHz. To compute the roots of ${g}^{\prime}\left(\zeta \right)=0$ and $\xi =g\left(\zeta \right)$, the built-in function

`NSolve`has been utilized. The solution to deterministic systems of differential equations has been solved by means of the standard

`NDSolve`routine, with automatic method, step size, etc.

`FindFit`built-in function). Then we will introduce a small perturbation into one of the parameters (with mean value being the deterministic estimate calculated) and we will apply the methodology previously exposed. Introducing only a small amount of randomness into the model from deterministic estimates allows a more faithful representation of the time evolution of the population, see for example [8] (Example 5), [12,13,14,42]. In this article, as we are interested in testing our methodology on approximating the density function of the model output, but not in estimating probability distributions for the input parameters, we do not deal with inverse parameter estimation, see, for example, references [6] (pp. 95–99), [43,44], related with Bayesian inference and gPC expansions.

`SmoothKernelDistribution`of Mathematica

^{®}. We will check that Kernel density estimations do not approximate well when the sought density function is not smooth (see the documentation on the built-in function

`SmoothKernelDistribution`, or the theoretical reference [45]), while our method substantiated on the RVT technique is certainly able to identify discontinuities and peaks, i.e., the exact shape of the target density function. Moreover, gPC-based methods converge much faster than Monte Carlo simulations, even when there is only one random input coefficient, see the discussions from previous contributions [6,7,8]. Indeed, Monte Carlo simulations converge relatively slow (for example, the mean value converges at rate $1/\sqrt{m}$, where m is the number of realizations), whereas gPC expansions converge at spectral rate.

**Example**

**1.**

^{®}with the standard

`NIntegrate`routine. Observe that the error decreases to 0 very fast (exponentially), although convergence deteriorates when time t increases.

**Example**

**2.**

`SmoothKernelDistribution`. The densities constructed via gPC expansions show that, possibly, the limit density function ${f}_{y\left(t\right)}\left(y\right)$ has two jump discontinuities, therefore the Kernel density estimation does not approximate well those discontinuities and draws tails.

**Example**

**3.**

`SmoothKernelDistribution`. Notice that, since the sought density function ${f}_{y\left(m\right)}$ seems not smooth (there may be three peaks because of the triangular form), the Kernel density estimation might not approximate well ${f}_{y\left(m\right)}$ near the peaks.

**Example**

**4.**

`SmoothKernelDistribution`. In this case, since the density function of $y\left(m\right)$ seems smooth (with no peaks), the Kernel density estimation is correct.

**Remark**

**1.**

## 4. Conclusions

## Author Contributions

## Funding

## Acknowledgments

## Conflicts of Interest

## References

- Soong, T.T. Random Differential Equations in Science and Engineering; Academic Press: New York, NY, USA, 1973. [Google Scholar]
- Strand, J.L. Random ordinary differential equations. J. Differ. Eq.
**1970**, 7, 538–553. [Google Scholar] [CrossRef] [Green Version] - Bharucha-Reid, A.T. On the theory of random equations. Proc. Sympos. Appl. Math.
**1964**, 16, 40–69. [Google Scholar] - Smith, R.C. Uncertainty Quantification. Theory, Implementation, and Application; SIAM Computational Science & Engineering: Philadelphia, PA, USA, 2014. [Google Scholar]
- Fishman, G. Monte Carlo: Concepts, Algorithms, and Applications; Springer Science & Business Media: Berlin, Germany, 2013. [Google Scholar]
- Xiu, D. Numerical Methods for Stochastic Computations. A Spectral Method Approach; Princeton University Press: Princeton, NJ, USA, 2010. [Google Scholar]
- Xiu, D.; Karniadakis, G.E. The Wiener-Askey polynomial chaos for stochastic differential equations. SIAM J. Sci. Comp.
**2002**, 24, 619–644. [Google Scholar] [CrossRef] - Chen-Charpentier, B.M.; Cortés, J.C.; Licea, J.A.; Romero, J.V.; Roselló, M.D.; Santonja, F.J.; Villanueva, R.J. Constructing adaptive generalized polynomial chaos method to measure the uncertainty in continuous models: A computational approach. Math. Comput. Simul.
**2015**, 109, 113–129. [Google Scholar] [CrossRef] [Green Version] - Cortés, J.C.; Romero, J.V.; Roselló, M.D.; Villanueva, R.J. Improving adaptive generalized polynomial chaos method to solve nonlinear random differential equations by the random variable transformation technique. Commun. Nonlinear Sci. Numer. Simul.
**2017**, 50, 1–15. [Google Scholar] [CrossRef] - Chen-Charpentier, B.M.; Stanescu, D. Epidemic models with random coefficients. Math. Comput. Model.
**2010**, 52, 1004–1010. [Google Scholar] [CrossRef] - Lucor, D.; Su, C.H.; Karniadakis, G.E. Generalized polynomial chaos and random oscillators. Int. J. Numer. Meth. Eng.
**2004**, 60, 571–596. [Google Scholar] [CrossRef] - Santonja, F.; Chen-Charpentier, B.M. Uncertainty quantification in simulations of epidemics using polynomial chaos. Comput. Math. Method Med.
**2012**, 2012, 742086. [Google Scholar] [CrossRef] - Stanescu, D.; Chen-Charpentier, B.M. Random coefficient differential equation models for bacterial growth. Math. Comp. Model.
**2009**, 50, 885–895. [Google Scholar] [CrossRef] - Calatayud, J.; Cortés, J.C.; Jornet, M.; Villanueva, R.J. Computational uncertainty quantification for random time-discrete epidemiological models using adaptive gPC. Math. Method Appl. Sci.
**2018**, 1–10. [Google Scholar] [CrossRef] - Villegas, M.; Augustin, F.; Gilg, A.; Hmaidi, A.; Wever, U. Application of the polynomial chaos expansion to the simulation of chemical reactors with uncertainties. Math. Comput. Simul.
**2012**, 82, 805–817. [Google Scholar] [CrossRef] - Xiu, D.; Karniadakis, G.E. Modeling uncertainty in steady state diffusion problems via generalized polynomial chaos. Comput. Method. Appl. Med.
**2002**, 191, 4927–4948. [Google Scholar] [CrossRef] [Green Version] - Shi, W.; Zhang, C. Error analysis of generalized polynomial chaos for nonlinear random ordinary differential equations. Appl. Numer. Math.
**2012**, 62, 1954–1964. [Google Scholar] [CrossRef] - Calatayud, J.; Cortés, J.C.; Jornet, M. On the convergence of adaptive gPC for non-linear random difference equations: Theoretical analysis and some practical recommendations. J. Nonlinear Sci. Appl.
**2018**, 11, 1077–1084. [Google Scholar] [CrossRef] - Casabán, M.C.; Cortés, J.C.; Romero, J.V.; Roselló, M.D. Probabilistic solution of random SI-type epidemiological models using the Random Variable Transformation technique. Commun. Nonlinear Sci. Numer. Simul.
**2015**, 24, 86–97. [Google Scholar] [CrossRef] [Green Version] - Dorini, F.A.; Cecconello, M.S.; Dorini, M.S. On the logistic equation subject to uncertainties in the environmental carrying capacity and initial population density. Commun. Nonlinear Sci. Numer. Simul.
**2016**, 33, 160–173. [Google Scholar] [CrossRef] - Calatayud, J.; Cortés, J.C.; Jornet, M.; Navarro-Quiles, A. Solving Random Ordinary and Partial Differential Equations through the Probability Density Function. Theory and Computing with Applications. In Modern Mathematics and Mechanics. Fundamentals, Problems and Challenges; Sadovnichiy, V.A., Zgurovsky, M., Eds.; Springer International Publishing AG (Springer Nature): New York, NY, USA, 2019; pp. 261–282. [Google Scholar]
- Dorini, F.A.; Cunha, M.C.C. Statistical moments of the random linear transport equation. J. Comput. Phys.
**2008**, 227, 8541–8550. [Google Scholar] [CrossRef] - Hussein, A.; Selim, M.M. Solution of the stochastic radiative transfer equation with Rayleigh scattering using RVT technique. Appl. Math. Comput.
**2012**, 218, 7193–7203. [Google Scholar] [CrossRef] - Hussein, A.; Selim, M.M. Solution of the stochastic generalized shallow-water wave equation using RVT technique. Eur. Phys. J. Plus
**2015**, 130, 249. [Google Scholar] [CrossRef] - Hussein, A.; Selim, M.M. A general analytical solution for the stochastic Milne problem using Karhunen–Loeve (K–L) expansion. J. Quant. Spectrosc. Radiat. Transf.
**2013**, 125, 84–92. [Google Scholar] [CrossRef] - Xu, Z.; Tipireddy, R.; Lin, G. Analytical approximation and numerical studies of one-dimensional elliptic equation with random coefficients. Appl. Math. Model.
**2016**, 40, 5542–5559. [Google Scholar] [CrossRef] [Green Version] - Cortés, J.C.; Navarro-Quiles, A.; Romero, J.V.; Roselló, M.D. Full solution of random autonomous first-order linear systems of difference equations. Application to construct random phase portrait for planar systems. Appl. Math. Lett.
**2017**, 68, 150–156. [Google Scholar] [CrossRef] - El-Tawil, M.A. The approximate solutions of some stochastic differential equations using transformations. Appl. Math. Comput.
**2005**, 164, 167–178. [Google Scholar] [CrossRef] - Calatayud, J.; Cortés, J.C.; Jornet, M. The damped pendulum random differential equation: A comprehensive stochastic analysis via the computation of the probability density function. Phys. A
**2018**, 512, 261–279. [Google Scholar] [CrossRef] - Calatayud, J.; Cortés, J.C.; Jornet, M. Uncertainty quantification for random parabolic equations with non-homogeneous boundary conditions on a bounded domain via the approximation of the probability density function. Math. Method Appl. Sci.
**2018**. [Google Scholar] [CrossRef] - Cortés, J.C.; Navarro-Quiles, A.; Romero, J.V.; Roselló, M.D. Solving second-order linear differential equations with random analytic coefficients about ordinary points: A full probabilistic solution by the first probability density function. Appl. Math. Comput.
**2018**, 331, 33–45. [Google Scholar] [CrossRef] - Casabán, M.C.; Cortés, J.C.; Romero, J.V.; Roselló, M.D. A comprehensive probabilistic solution of random SIS-type epidemiological models using the random variable transformation technique. Commun. Nonlinear Sci. Numer. Simul.
**2016**, 32, 199–210. [Google Scholar] [CrossRef] [Green Version] - Kegan, B.; West, R.W. Modeling the simple epidemic with deterministic differential equations and random initial conditions. Math. Biosci.
**2005**, 194, 217–231. [Google Scholar] [CrossRef] [PubMed] - Crestaux, T.; Le Maître, O.; Martínez, J.M. Polynomial chaos expansion for sensitivity analysis. Reliab. Eng. Syst. Saf.
**2009**, 94, 1161–1172. [Google Scholar] [CrossRef] - Sudret, B. Global sensitivity analysis using polynomial chaos expansions. Reliab. Eng. Syst. Saf.
**2008**, 93, 964–979. [Google Scholar] [CrossRef] - Chen-Charpentier, B.M.; Cortés, J.C.; Romero, J.V.; Roselló, M.D. Some recommendations for applying gPC (generalized polynomial chaos) to modeling: An analysis through the Airy random differential equation. Appl. Math. Comput.
**2013**, 219, 4208–4218. [Google Scholar] [CrossRef] [Green Version] - Ernst, O.G.; Mugler, A.; Starkloff, H.J.; Ullmann, E. On the convergence of generalized polynomial chaos expansions. ESAIM Math. Model. Numer. Anal.
**2012**, 46, 317–339. [Google Scholar] [CrossRef] - Kobayashi, H.; Mark, B.L.; Turin, W. Probability, Random Processes, and Statistical Analysis; Cambridge University Press: Cambridge, UK, 2011. [Google Scholar]
- Giraud, L.; Langou, J.; Rozloznik, M. The loss of orthogonality in the Gram-Schmidt orthogonalization process. Comput. Math. Appl.
**2005**, 50, 1069–1075. [Google Scholar] [CrossRef] [Green Version] - Calatayud, J.; Cortés, J.C.; Jornet, M. Improving the approximation of the first and second order statistics of the response process to the random Legendre differential equation. arXiv, 2018; arXiv:1807.03141. [Google Scholar]
- Wolfram Research, Inc. Mathematica, version 11.2; Wolfram Research, Inc.: Champaign, IL, USA, 2017. [Google Scholar]
- Stanescu, D.; Chen-Charpentier, B.M.; Jensen, B.J.; Colberg, P.J. Random coefficient differential models of growth of anaerobic photosynthetic bacteria. Electron. Trans. Numer. Anal.
**2009**, 34, 44–58. [Google Scholar] - Marzouk, Y.M.; Najm, H.N.; Rahn, L.A. Stochastic spectral methods for efficient Bayesian solution of inverse problems. J. Comput. Phys.
**2007**, 224, 560–586. [Google Scholar] [CrossRef] - Marzouk, Y.; Xiu, D. A stochastic collocation approach to Bayesian inference in inverse problems. J. Commun. Comput. Phys.
**2009**, 6, 826–847. [Google Scholar] [CrossRef] - Scott, D. On optimal and data-based histograms. Biometrika
**1979**, 66, 605–610. [Google Scholar] [CrossRef] - Malthus, T.R. An Essay on the Principal of Population; Oxford World’s Classics Paperbacks; Oxford University Press: Oxford, UK, 1999. [Google Scholar]
- Brauer, F.; Castillo-Chávez, C. Mathematical Models in Population Biology and Epidemiology; Springer Science + Business Media: Berlin, Germany, 2012. [Google Scholar]
- Murray, J.D. Mathematical Biology; Springer: Berlin, Germany, 2002. [Google Scholar]
- Cherniha, R.; Davydovych, V. Nonlinear Reaction-Diffusion Systems: Conditional Symmetry, Exact Solutions and Their Applications in Biology; Springer International Publishing: Basel, Switzerland, 2017. [Google Scholar]
- National Spanish Health Survey (Encuesta Nacional de Salud de España, ENSE). Available online: http://pestadistico.inteligenciadegestion.msssi.es/publicoSNS/comun/ArbolNodos.aspx (accessed on 28 May 2018).
- Hadeler, K. Topics in Mathematical Biology; Springer International Publishing: Basel, Switzerland, 2017. [Google Scholar]

**Figure 1.**Exact graph of ${f}_{y\left(t\right)}\left(y\right)$ for $t=0.5$ (left) and $t=1$ (right) in Example 1.

**Figure 2.**Approximation of ${f}_{y\left(t\right)}\left(y\right)$ via generalized polynomial chaos (gPC) and random variable transformation (RVT) for $t=0.5$ (up) and $t=1$ (down) in Example 1. Observe the rapid convergence to the exact density function ${f}_{y\left(t\right)}\left(y\right)$ as p grows.

**Figure 4.**Model for the R. capsulatus population with $p=4$ in Example 2. The circles represent the actual population size, the solid line shows the estimates via $\mathbb{E}\left[y\right(t\left)\right]$, and the dashed lines reflect the confidence interval.

**Figure 5.**Approximation of ${f}_{y\left(t\right)}\left(y\right)$ via gPC and RVT for $t=4$ in Example 2. Comparison with a Kernel density estimation.

**Figure 6.**Approximation of ${f}_{y\left(m\right)}\left(y\right)$ via gPC and RVT for $m=30$ in Example 3. Comparison with a Kernel density estimation. From $p\ge 5$, catastrophic numerical errors invalidate the results, so we are restricted to $p\le 4$.

**Figure 7.**Model for the percentage of nonsmokers Spanish men aged over 16 years old during the period 1995–2014 in Example 4. The circles represent the actual data, the solid line shows the estimates via $\mathbb{E}\left[y\right(m\left)\right]$, and the dashed lines reflect the confidence interval.

**Figure 8.**Approximation of ${f}_{y\left(m\right)}\left(y\right)$ via gPC and RVT for $m=15$ (up) and $m=18$ (down) in Example 4. Observe the rapid convergence to the exact density function ${f}_{y\left(m\right)}\left(y\right)$. The results agree with a Kernel density estimation.

**Figure 9.**Model for the percentage of nonsmokers Spanish men aged over 16 years old during the period 1995–2014 in Remark 1 of Example 4, with two random input parameters. The circles represent the actual data, the solid line shows the estimates via $\mathbb{E}\left[y\right(m\left)\right]$, and the dashed lines reflect the confidence interval.

**Figure 10.**Influence of the parameters a and b in the nonsmokers model prediction, Remark 1 from Example 4.

**Table 1.**Error $\parallel {f}_{y\left(t\right)}-{f}_{{\tilde{y}}^{p}\left(t\right)}{\parallel}_{{\mathrm{L}}^{1}\left(\mathbb{R}\right)}$ for $t=0.5$ and $t=1$, and $p=1,2,3,4,5,6$, in Example 1. Note the rapid convergence (exponential) to the exact density function ${f}_{y\left(t\right)}$ as p increases.

t = 0.5 | t = 1 | |
---|---|---|

$p=1$ | $0.0776146$ | $1.81093$ |

$p=2$ | $0.00599041$ | $0.0304913$ |

$p=3$ | $0.000230145$ | $0.00181233$ |

$p=4$ | $7.06091\times {10}^{-6}$ | $0.000109031$ |

$p=5$ | $1.71501\times {10}^{-7}$ | $5.29540\times {10}^{-6}$ |

$p=6$ | $1.00343\times {10}^{-8}$ | $2.15623\times {10}^{-7}$ |

**Table 2.**Bacteria population sizes of Rhodobacter capsulatus [42], Example 2.

Time (days) | Population (Cells/mL, Scale ${10}^{6}$) |
---|---|

0 | $0.583$ |

2 | $0.635$ |

4 | $1.08$ |

7 | $3.20$ |

9 | $5.23$ |

11 | $5.28$ |

14 | $5.30$ |

**Table 3.**Consecutive error $\parallel {f}_{{\tilde{y}}^{p+1}\left(t\right)}-{f}_{{\tilde{y}}^{p}\left(t\right)}{\parallel}_{{\mathrm{L}}^{1}\left(\mathbb{R}\right)}$ for $t=4$, and $p=1,2,3$, in Example 2. Notice the rapid convergence of the consecutive errors to 0 as p grows.

t = 4 | |
---|---|

$p=1$ − $p=2$ | $0.202513$ |

$p=2$ − $p=3$ | $0.0105528$ |

$p=3$ − $p=4$ | $3.52486\times {10}^{-7}$ |

**Table 4.**Percentage of nonsmokers Spanish men aged over 16 years old during the period 1995–2014. Source [50].

Year | 1995 | 1997 | 2001 | 2003 | 2006 | 2011 | 2014 |
---|---|---|---|---|---|---|---|

j | 0 | 2 | 6 | 8 | 11 | 16 | 19 |

${S}_{j}$ | $0.5298$ | $0.5514$ | $0.5783$ | $0.6244$ | $0.6467$ | $0.6863$ | $0.6957$ |

© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Calatayud Gregori, J.; Chen-Charpentier, B.M.; Cortés López, J.C.; Jornet Sanz, M.
Combining Polynomial Chaos Expansions and the Random Variable Transformation Technique to Approximate the Density Function of Stochastic Problems, Including Some Epidemiological Models. *Symmetry* **2019**, *11*, 43.
https://doi.org/10.3390/sym11010043

**AMA Style**

Calatayud Gregori J, Chen-Charpentier BM, Cortés López JC, Jornet Sanz M.
Combining Polynomial Chaos Expansions and the Random Variable Transformation Technique to Approximate the Density Function of Stochastic Problems, Including Some Epidemiological Models. *Symmetry*. 2019; 11(1):43.
https://doi.org/10.3390/sym11010043

**Chicago/Turabian Style**

Calatayud Gregori, Julia, Benito M. Chen-Charpentier, Juan Carlos Cortés López, and Marc Jornet Sanz.
2019. "Combining Polynomial Chaos Expansions and the Random Variable Transformation Technique to Approximate the Density Function of Stochastic Problems, Including Some Epidemiological Models" *Symmetry* 11, no. 1: 43.
https://doi.org/10.3390/sym11010043