Moment-Based Invariants for Probabilistic Loops with Non-polynomial Assignments

  • Conference paper
  • First Online:
Quantitative Evaluation of Systems (QEST 2022)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 13479))

Included in the following conference series:

  • 583 Accesses

Abstract

We present a method to automatically approximate moment-based invariants of probabilistic programs with non-polynomial updates of continuous state variables to accommodate more complex dynamics. Our approach leverages polynomial chaos expansion to approximate non-linear functional updates as sums of orthogonal polynomials. We exploit this result to automatically estimate state-variable moments of all orders in Prob-solvable loops with non-polynomial updates. We showcase the accuracy of our estimation approach in several examples, such as the turning vehicle model and the Taylor rule in monetary policy.

Supported by the Vienna Science and Technology Fund (WWTF ICT19-018), the TU Wien Doctoral College (SecInt), the FWF research projects LogiCS W1255-N23 and P 30690-N35, and the ERC Consolidator Grant ARTIST 101002685.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or Ebook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
EUR 29.95
Price includes VAT (France)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
EUR 42.79
Price includes VAT (France)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
EUR 52.74
Price includes VAT (France)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free ship** worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    \(\varOmega \) is dropped from the notation as the sample space is not important in our formulation.

  2. 2.

    Conditions that ascertain this are given in Theorem 3.4 of [8].

  3. 3.

    Generalized PCE typically entails using orthogonal basis polynomials specific to the distribution of the basic variables, according to the Askey scheme of [32, 33]. We opted for the most general procedure that can be used for any basic variable distribution.

  4. 4.

    We provide further details about PCE computation in Appendix 2 and 3.

  5. 5.

    It was proposed by the American economist John B. Taylor as a technique to stabilize economic activity by setting an interest rate [29].

  6. 6.

    https://data.worldbank.org/indicator/NY.GDP.MKTP.KD.ZG?locations=US.

References

  1. Atkeson, A., Ohanian, L.E.: Are Phillips curves useful for forecasting inflation? Q. Rev. 25(Win), 2–11 (2001). https://ideas.repec.org/a/fip/fedmqr/y2001iwinp2-11nv.25no.1.html

  2. Bartocci, E., Kovács, L., Stankovič, M.: Automatic generation of moment-based invariants for prob-solvable loops. In: Chen, Y.-F., Cheng, C.-H., Esparza, J. (eds.) ATVA 2019. LNCS, vol. 11781, pp. 255–276. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-31784-3_15

    Chapter  MATH  Google Scholar 

  3. Bartocci, E., Kovács, L., Stankovič, M.: Mora - automatic generation of moment-based invariants. In: TACAS 2020. LNCS, vol. 12078, pp. 492–498. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-45190-5_28

    Chapter  Google Scholar 

  4. Bouissou, O., Goubault, E., Putot, S., Chakarov, A., Sankaranarayanan, S.: Uncertainty propagation using probabilistic affine forms and concentration of measure inequalities. In: Chechik, M., Raskin, J.-F. (eds.) TACAS 2016. LNCS, vol. 9636, pp. 225–243. Springer, Heidelberg (2016). https://doi.org/10.1007/978-3-662-49674-9_13

    Chapter  MATH  Google Scholar 

  5. Chen, X., Ábrahám, E., Sankaranarayanan, S.: Taylor model flowpipe construction for non-linear hybrid systems. In: Proceedings of RTSS 2012: the 33rd IEEE Real-Time Systems Symposium, pp. 183–192. IEEE Computer Society (2012). https://doi.org/10.1109/RTSS.2012.70

  6. Chorin, A.J.: Gaussian fields and random flow. J. Fluid Mech. 63(1), 21–32 (1974). https://doi.org/10.1017/S0022112074000991

    Article  MathSciNet  MATH  Google Scholar 

  7. Denamiel, C., Huan, X., Šepić, J., Vilibić, I.: Uncertainty propagation using polynomial chaos expansions for extreme sea level hazard assessment: the case of the eastern adriatic meteotsunamis. J. Phys. Oceanogr. 50(4), 1005–1021 (2020). https://doi.org/10.1175/JPO-D-19-0147.1

    Article  Google Scholar 

  8. Ernst, O.G., Mugler, A., Starkloff, H.J., Ullmann, E.: On the convergence of generalized polynomial chaos expansions. ESAIM: M2AN 46(2), 317–339 (2012). https://doi.org/10.1051/m2an/2011045

  9. Foo, J., Yosibash, Z., Karniadakis, G.E.: Stochastic simulation of riser-sections with uncertain measured pressure loads and/or uncertain material properties. Comput. Methods Appl. Mech. Eng. 196, 4250–4271 (2007). https://doi.org/10.1016/j.cma.2007.04.005

    Article  MATH  Google Scholar 

  10. Formaggia, L., et al.: Global sensitivity analysis through polynomial chaos expansion of a basin-scale geochemical compaction model. Comput. Geosci. 17, 25–42 (2013). https://doi.org/10.1007/s10596-012-9311-5

    Article  MathSciNet  MATH  Google Scholar 

  11. Ghanem, R., Dham, S.: Stochastic finite element analysis for multiphase flow in heterogeneous porous media. Transp. Porous Medias 32, 239–262 (1998). https://doi.org/10.1023/A:1006514109327

    Article  MathSciNet  Google Scholar 

  12. Ghanem, R.: Probabilistic characterization of transport in heterogeneous media. Comput. Methods Appl. Mech. Eng. 158, 199–220 (1998). https://doi.org/10.1016/s0045-7825(97)00250-8

    Article  MATH  Google Scholar 

  13. Ghanem, R.G., Spanos, P.D.: Stochastic Finite Elements: A Spectral Approach. Springer, New York (1991). https://doi.org/10.1007/978-1-4612-3094-6

    Book  MATH  Google Scholar 

  14. Giraldi, L., Le Maître, O.P., Mandli, K.T., Dawson, C.N., Hoteit, I., Knio, O.M.: Bayesian inference of earthquake parameters from buoy data using a polynomial chaos-based surrogate. Comput. Geosci. 21(4), 683–699 (2017). https://doi.org/10.1007/s10596-017-9646-z

    Article  MathSciNet  MATH  Google Scholar 

  15. Hien, T.D., Kleiber, M.: Stochastic finite element modelling in linear transient heat transfer. Comput. Methods Appl. Mech. Eng. 144(1), 111–124 (1997). https://doi.org/10.1016/S0045-7825(96)01168-1

    Article  MATH  Google Scholar 

  16. Hou, T.Y., Luo, W., Rozovskii, B., Zhou, H.M.: Wiener chaos expansions and numerical solutions of randomly forced equations of fluid mechanics. J. Comput. Phys. 216, 687–706 (2006). https://doi.org/10.1016/j.jcp.2006.01.008

    Article  MathSciNet  MATH  Google Scholar 

  17. Jasour, A., Wang, A., Williams, B.C.: Moment-based exact uncertainty propagation through nonlinear stochastic autonomous systems. CoRR abs/2101.12490 (2021). https://arxiv.org/abs/2101.12490

  18. Knio, O.M., Maître, O.P.L.: Uncertainty propagation in CFD using polynomial chaos decomposition. Fluid Dyn. Res. 38(9), 616–640 (2006). https://doi.org/10.1016/j.fluiddyn.2005.12.003

  19. Makino, K., Berz, M.: Taylor models and other validated functional inclusion methods. Int. J. Pure Appl. Math. 6, 239–316 (2003)

    MathSciNet  MATH  Google Scholar 

  20. Meecham, W.C., Jeng, D.T.: Use of the Wiener-Hermite expansion for nearly normal turbulence. J. Fluid Mech. 32(2), 225–249 (1968). https://doi.org/10.1017/S0022112068000698

    Article  MATH  Google Scholar 

  21. Moosbrugger, M., Stankovič, M., Bartocci, E., Kovács, L.: This is the Moment for Probabilistic Loops. ar**v (2022). https://doi.org/10.48550/ar**v.2204.07185

  22. Mühlpfordt, T., Findeisen, R., Hagenmeyer, V., Faulwasser, T.: Comments on truncation errors for polynomial chaos expansions. IEEE Control Syst. Lett. 2(1), 169–174 (2018). https://doi.org/10.1109/LCSYS.2017.2778138

    Article  MathSciNet  Google Scholar 

  23. Neher, M., Jackson, K.R., Nedialkov, N.S.: On taylor model based integration of ODEs. SIAM J. Numer. Anal. 45, 236–262 (2007). https://doi.org/10.1137/050638448

    Article  MathSciNet  MATH  Google Scholar 

  24. Sankaranarayanan, S.: Quantitative analysis of programs with probabilities and concentration of measure inequalities. Found. Probab. Program. 259 (2020). https://doi.org/10.1017/9781108770750.009

  25. Sankaranarayanan, S., Chou, Y., Goubault, E., Putot, S.: Reasoning about uncertainties in discrete-time dynamical systems using polynomial forms. In: Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M.F., Lin, H. (eds.) Advances in Neural Information Processing Systems, vol. 33, pp. 17502–17513. Curran Associates, Inc. (2020). https://proceedings.neurips.cc/paper/2020/file/ca886eb9edb61a42256192745c72cd79-Paper.pdf

  26. Son, J., Du, Y.: Probabilistic surrogate models for uncertainty analysis: dimension reduction-based polynomial chaos expansion. Int. J. Numer. Meth. Eng. 121(6), 1198–1217 (2020). https://doi.org/10.1002/nme.6262

    Article  MathSciNet  Google Scholar 

  27. Stanković, B.: Taylor expansion for generalized functions. J. Math. Anal. Appl. 203, 31–37 (1996). https://doi.org/10.1006/jmaa.1996.0365

    Article  MathSciNet  MATH  Google Scholar 

  28. Steinhardt, J., Tedrake, R.: Finite-time regional verification of stochastic non-linear systems. Int. J. Robot. Res. 31(7), 901–923 (2012). https://doi.org/10.1177/0278364912444146

    Article  Google Scholar 

  29. Taylor, J.B.: Discretion versus policy rules in practice. In: Carnegie-Rochester Conference Series on Public Policy, vol. 39, no. 1, pp. 195–214 (1993). https://ideas.repec.org/a/eee/crcspp/v39y1993ip195-214.html

  30. Triebel, H.: Taylor expansions of distributions. In: The Structure of Functions. Birkhäuser Basel (2001). https://doi.org/10.1007/978-3-0348-8257-6_8

  31. Wan, X., Karniadakis, G.E.: An adaptive multi-element generalized polynomial chaos method for stochastic differential equations. J. Comput. Phys. 209, 617–642 (2005). https://doi.org/10.1016/j.jcp.2005.03.023

    Article  MathSciNet  MATH  Google Scholar 

  32. **u, D.: Numerical Methods for Stochastic Computations: A Spectral Method Approach. Princeton University Press, Princeton (2010). http://www.jstor.org/stable/j.ctv7h0skv

  33. **u, D., Karniadakis, G.E.: The Wiener-Askey polynomial chaos for stochastic differential equations. SIAM J. Sci. Comput. 24(2), 619–644 (2002). https://doi.org/10.1137/S1064827501387826

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Andrey Kofnov .

Editor information

Editors and Affiliations

Appendices

Appendix 1. Proof of Theorem 1

Proof

(Theorem 1). Since \(f(z) = 0\) \(\forall z\notin \left[ a, b\right] \),

$$\begin{aligned} \begin{array}{c} \left\| g(z) - \sum \limits _{i=0}^{T}c_{i}p_{i}(z)\right\| _{f}^{2} = \int \limits _{a}^{b}\left( g(z) - \sum \limits _{i=0}^{T}c_{i}p_{i}(z)\right) ^{2}f(z)dz \quad \\ =\int \limits _{-\infty }^{\infty }\left( g(z) - \sum \limits _{i=0}^{T}c_{i}p_{i}(z)\right) ^{2}f(z)dz \\ = \int \limits _{-\infty }^{a}\left( g(z) - \sum \limits _{i=0}^{T}c_{i}p_{i}(z)\right) ^{2}f(z)dz + \int \limits _{b}^{\infty }\left( g(z) - \sum \limits _{i=0}^{T}c_{i}p_{i}(z)\right) ^{2}f(z)dz \\ + \int \limits _{a}^{b}\left( g(z) - \sum \limits _{i=0}^{T}c_{i}p_{i}(z)\right) ^{2}f(z)dz \\ \le \int \limits _{-\infty }^{a}\left( g(z) - \sum \limits _{i=0}^{T}c_{i}p_{i}(z)\right) ^{2}\phi (z)dz + \int \limits _{b}^{\infty }\left( g(z) - \sum \limits _{i=0}^{T}c_{i}p_{i}(z)\right) ^{2}\phi (z)dz \\ + \int \limits _{a}^{b}\left( g(z) - \sum \limits _{i=0}^{T}c_{i}p_{i}(z)\right) ^{2}\phi (z)dz + \int _{a}^{b}\left( g(z) - \sum \limits _{i=0}^{T}c_{i}p_{i}(z)\right) ^{2}(f(z)-\phi (z))dz \\ = A + B + C + D \end{array} \end{aligned}$$
(20)

Since \( f(z) -\phi (z) \le \phi (z) + f(z)\), D satisfies

$$\begin{aligned}\begin{gathered} \int \limits _{a}^{b}\left( g(z) - \sum \limits _{i=0}^{T}c_{i}p_{i}(z)\right) ^{2}(f(z)-\phi (z))dz \\ \le \int \limits _{a}^{b}\left( g(z) - \sum \limits _{i=0}^{T}c_{i}p_{i}(z)\right) ^{2}dz\int \limits _{a}^{b}(\phi (z) + f(z))dz \\ = (1 + \varPhi (b) - \varPhi (a)) \times \int \limits _{a}^{b}\left( g(z) - \sum \limits _{i=0}^{T}c_{i}p_{i}(z)\right) ^{2}dz, \end{gathered}\end{aligned}$$

with \((1 + \varPhi (b) - \varPhi (a)) < 2.\) Now,

$$\begin{aligned} 1 \le \frac{\phi (z)}{\min {(\phi (a), \phi (b))}} \quad \forall z \in \left[ a, b\right] , \end{aligned}$$

and hence

$$\begin{aligned} \begin{array}{c} \int \limits _{a}^{b}\left( g(z) - \sum \limits _{i=0}^{T}c_{i}p_{i}(z)\right) ^{2}dz \\ \le \min {(\phi (a), \phi (b))}^{-1}\int \limits _{a}^{b}\left( g(z) - \sum \limits _{i=0}^{T}c_{i}p_{i}(z)\right) ^{2}\phi (x)dz \\ \le \min {(\phi (a), \phi (b))}^{-1} C. \end{array} \end{aligned}$$
(21)

By (21) and (15), (20) satisfies

$$\begin{aligned}\begin{gathered} A+B+C+D \le \left( \frac{2}{\min {(\phi (a), \phi (b))}} + 1 \right) \Bigg \{ \int \limits _{-\infty }^{a} \left( g(z) - \sum \limits _{i=0}^{T}c_{i}p_{i}(z)\right) ^{2}\phi (z)dz \\ + \int \limits _{b}^{\infty }\left( g(z) - \sum \limits _{i=0}^{T}c_{i}p_{i}(z)\right) ^{2}\phi (z)dz + \int \limits _{a}^{b}\left( g(z) - \sum \limits _{i=0}^{T}c_{i}p_{i}(z)\right) ^{2}\phi (z)dz \Bigg \} \\ = \left( \frac{2}{\min {(\phi (a), \phi (b))}} + 1 \right) \int \limits _{-\infty }^{\infty }\left( g(z) - \sum \limits _{i=0}^{T}c_{i}p_{i}(z)\right) ^{2}\phi (z)dz \\ = \left( \frac{2}{\min {(\phi (a), \phi (b))}} + 1 \right) \sum \limits _{i=T+1}^{\infty }c_{i}^{2} \le \left( \frac{2}{\min {(\phi (a), \phi (b))}} + 1 \right) \mathbb {V}\textrm{ar}_{\phi }\left[ g(Z)\right] \end{gathered}\end{aligned}$$

since \(\mathbb {V}\textrm{ar}_\phi (g(Z))=\sum _{i=1}^\infty c_i^2\). In consequence, the error (16) can be upper bounded by (18).

Appendix 2. Computation Algorithm in Detail

We let \({\textbf{D}}\in \mathbb {Z}^{L \times k}\) be the matrix with each row \(j=1, \ldots , L\) containing the degrees of \(Z_i\) (in column i) of the corresponding polynomial in (9). For example, the first row corresponds to the constant polynomial (1), and the last row to \(\bar{p}_{1}^{\bar{d}_1}(z_1) \ldots \bar{p}_{k}^{\bar{d}_k}(z_k)\). That is,

figure a

The computer implementation of the algorithm computes \(c_j\) in (10) for each j combination (row) of degrees of the corresponding polynomials.

We apply the above described computation to the following example. Suppose that X has a truncated normal distribution with parameters \(\mu = 2\), \(\sigma = 0.1\), and is supported over \(\left[ 1, 3\right] \), and that Y is uniformly distributed over \(\left[ 1, 2\right] \). We expand \(g(x, y) = \log (x + y)\) along X and Y, as follows. We choose the relevant highest degrees of expansion to be \(\bar{d}_{X} = 2\) and \(\bar{d}_{Y} = 2\). The pdf of Y is \(f_{Y}(y) \equiv 1\), and of X is \(f_{X}(x) = e^{-\frac{(x-2)^{2}}{0.02}}/0.1\alpha \sqrt{2\pi }\), where the truncation multiplier \(\alpha \) equals \(\int \limits _{1}^{3}e^{-\frac{(x-2)^{2}}{0.02}}dx/0.1\sqrt{2\pi }\).

The two sets of polynomials, \(\{p_{i}\} = \{1, x, x^{2}\}\) and \(\{q_{i}\} = \{1, y, y^{2}\}\), are linearly independent. Applying the Gram-Schmidt procedure to orthogonalize and normalize them, we obtain \(\bar{p}_{0}(x) = 1\), \(\bar{p}_{1}(x) = 10x - 20\), \(\bar{p}_{2}(x) = 70.71067x^{2} -282.84271x + 282.13561\), and \(\bar{q}_{0}(y) = 1\), \(\bar{q}_{1}(y) = 3.4641y - 5.19615\), \(\bar{q}_{2}(y) = 13.41641y^{2} - 40.24922y + 29.06888\). In this case, \(L = (1 + \bar{d}_{X}) * (1 + \bar{d}_{Y}) = 9\), and \({\textbf{D}}\) has 9 rows and 2 columns,

figure b

Iterating through the rows of matrix \({\textbf{D}}\) and choosing the relevant combination of degrees of polynomials for each variable, we calculate the Fourier coefficients

$$c_{j} = \int _{1}^{3}\int _{1}^{2}log(x + y)\bar{p}_{d_{j1}}(x)\bar{q}_{d_{j2}}(y)f_{X}(x)f_{Y}(y)dydx.$$

The final estimator can be derived by summing up the products of each coefficient and the relevant combination of polynomials:

$$\begin{aligned}\begin{gathered} \log (x + y) \approx \hat{g}(x, y) = \sum _{j=1}^{9}c_{j}\bar{p}_{d_{j1}}(x)\bar{q}_{d_{j2}}(y) \approx \\ -\,0.01038x^{2}y^{2} + 0.05517x^{2}y- 0.10031x^{2} \\ +\, 0.06538xy^{2} - 0.37513xy + 0.86515x \\ -\, 0.13042y^{2} + 0.93998y - 0.59927. \end{gathered}\end{aligned}$$

The estimation error is

$$\begin{aligned} se(\hat{g}) = \sqrt{\int \limits _{1}^{3}\int \limits _{1}^{2}\left( \log (x+y)) - \hat{g}(x, y)\right) ^{2}f_{X}(x)f_{Y}(y)dydx} \approx 0.000151895 \end{aligned}$$

Appendix 3. PCEs of Exponential and Trigonometric Functions

Table 2 lists examples of functions of up to three random arguments approximated by PCE’s of different degrees and, correspondingly, number of coefficients. We use \(TruncNormal \left( \mu , \sigma ^{2}, \left[ a, b\right] \right) \) to denote the truncated normal distribution with expectation \(\mu \) and standard deviation \(\sigma \) on the (finite or infinite) interval \(\left[ a, b\right] \), and \(TruncGamma\left( \theta , k, \left[ a, b\right] \right) \) for the truncated gamma distribution on the (finite or infinite) interval \(\left[ a, b\right] \), \(a,b>0\), with shape parameter k and scale parameter \(\theta \). The approximation error in (13) is reported in the last column. The results confirm (8) in practice: the error decreases as the degree or, equivalently, the number of components in the approximation of the polynomial increases.

Table 2. Approximations of 5 non-linear functions using PCE.

Rights and permissions

Reprints and permissions

Copyright information

© 2022 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Kofnov, A., Moosbrugger, M., Stankovič, M., Bartocci, E., Bura, E. (2022). Moment-Based Invariants for Probabilistic Loops with Non-polynomial Assignments. In: Ábrahám, E., Paolieri, M. (eds) Quantitative Evaluation of Systems. QEST 2022. Lecture Notes in Computer Science, vol 13479. Springer, Cham. https://doi.org/10.1007/978-3-031-16336-4_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-16336-4_1

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-16335-7

  • Online ISBN: 978-3-031-16336-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics

Navigation