• No results found

Reliable sequential testing for statistical model checking

N/A
N/A
Protected

Academic year: 2021

Share "Reliable sequential testing for statistical model checking"

Copied!
4
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Submitted to:

SMC 2013 © D. Reijsbergen, P.T. de Boer, W. Scheinhardt, B.R. Haverkort

Reliable Sequential Testing for Statistical Model Checking

Dani¨el Reijsbergen1,2 Pieter-Tjerk de Boer1 Werner Scheinhardt1 Boudewijn Haverkort1 1University of Twente, Enschede, The Netherlands

2University of Edinburgh, United Kingdom

{d.p.reijsbergen,p.t.deboer,w.r.w.scheinhardt,b.r.h.m.haverkort}@utwente.nl

— Extended abstract for SMC 2013 —

We introduce a framework for comparing statistical model checking (SMC) techniques and propose a new, more reliable, SMC technique. Statistical model checking has recently been implemented in tools like UPPAAL and PRISM to be able to handle models which are too complex for numerical analysis. However, these techniques turn out to have shortcomings, most notably that the validity of their outcomes depends on parameters that must be chosen a priori. Our new technique does not have this problem; we prove its correctness, and numerically compare its performance to existing techniques.

1

Introduction

Statistical model checking (SMC) [6] is increasingly seen as a powerful alternative to classical (numeri-cal) model checking, as witnessed by the recent implementation of statistical model checking techniques in tools such as UPPAAL [1] and PRISM [5]. Typically, SMC is used to check whether the probability pof some event in a stochastic model, is larger or smaller than some threshold p0. This is done by

gen-erating a large number N of independent random samples of the model evolution, counting the number of occurrences S of the event of interest, and comparing the ratio S/N, which is an estimate of p, to the threshold p0. Only statistical guarantees can be given, like “the probability of drawing the right

conclu-sion is at least 95%”. In this work, we compare statistical tests from the SMC literature, and introduce two new tests which have some advantages.

N ZN U I L N C

(a) Fixed sample size test

N ZN U L N C (b) Sequential test

Figure 1: Graphical representation of the test decision areas. Grey areas are unreachable. Despite their differences, all tests can be described

in terms of a single so-called test statistic, namely ZN

def

= S − N p0. Clearly, a positive value of ZN hints

that p > p0, and vice versa. The tests only differ

in which conclusion they draw for different values of (N, ZN). This is illustrated in Figure 1(a) for a test in

which the number of samples N is chosen in advance, and (b) for a sequential test, i.e., a test where the de-cision whether or not to draw more samples is based on the samples drawn so far. In the area markedU (for “upper”), the hypothesis p > p0is accepted; inL

(“lower”), the hypothesis p < p0is accepted; inN C (“non-critical” – a term from hypothesis testing)

simulation continues to larger N, and inI (“inconclusive”) the conclusion is that neither hypothesis can be accepted with sufficient confidence. The borders between the regions depend on the type of test, and on parameters related to the test, including the desired confidence level.

(2)

2 Reliable Sequential Testing

2

Existing statistical tests

Confidence Intervals (Gauss) The idea behind this test is to use a fixed number of samples to construct a confidence interval for ZN and then draw a conclusion if N(p − p0) is outside this interval; i.e., the

boundaries betweenL , U and I are the boundaries of the confidence interval.

Sequential Probability Ratio Test (SPRT) For this test ([9, 10]), one specifies an indifference pa-rameter δ such that if |p − p0| < δ , one no longer cares about the validity of the test. The test then

sequentially compares the likelihoods of p < p0− δ and p > p0+ δ given the observed samples. In

our framework, this corresponds to a sequential test in which, informally speaking, the vertical width of N C is constant.

Approximate Model Checking (Chernoff) This test is a fixed sample size test in which the boundaries betweenL , U and I are not computed using the known distribution of ZNor its Gaussian

approxima-tion, but using the Chernoff-Hoefding bound. It is called ‘Approximate Model Checking’ in the original paper [3], ‘probability estimation’ in UPPAAL, and ‘APMC’ in PRISM.

Bayes In [4] an approach based on Bayesian likelihood ratios was proposed. In Bayesian statistics, the true parameter p is itself seen as the realisation of a random variable. To implement the method, a prior distribution G must be given on [0, 1] which describes the assumed probability distribution of p.

3

New statistical tests

ZN = X 1 +X 2 +. ..+X N -p0 N N SPRT Bayes GaussChernoff Azuma Darling -800 -600 -400 -200 0 200 400 600 800 0 5000 10000 15000 20000 25000 30000 ed ge of stat e s pac e

Figure 2: Illustration of the decision regions for p0=12, δ =1001 ,

γ = 101. Solid lines for sequential tests, dashed lines for fixed sample size tests.

We have developed two new se-quential tests; we only give an overview here, referring to [7] for details. The main idea of both new tests is that the vertical width of theN C area must increase faster than√N; otherwise, for p = p0the

probability of drawing a conclu-sion at all becomes large, and with it, the probability of drawing an in-correct conclusion if p = p0+ ε

for very small ε.

Azuma test This test has a boundary of theN C area propor-tional to a(N + k)b, for some con-stants a, k and b. We call it the Azuma test because the proof that it indeed has the desired proper-ties is based on the proof for the Generalized Azuma-Hoeffding in-equality, Proposition 6.5.1 of [8].

(3)

D. Reijsbergen, P.T. de Boer, W. Scheinhardt, B.R. Haverkort 3

Darling test This test has a boundary of theN C area proportional to ap(N + k)log(N + k), for some constants a and k. We call it the Darling test because its correctness is based on Theorem 3 of [2].

4

Comparison

Figure 2 shows a typical example of the boundaries of U and L for all six tests. The area N C is narrower for the Azuma test than for the Darling test for small values of N, but the Azuma boundaries eventually overtake those of the Darling test. This is an obvious consequence of their functional form. Both the Azuma test and the Darling test have a much wider areaN C than the other tests, which is the price to pay for not risking an inconclusive termination, and for not requiring an indifference region. We see that the Gauss and Bayes tests are quite similar, but it should be remarked that the Bayes test depends on the choice of the prior. The Chernoff test has a wider areaN C due to the looser bound it is based on. We compare the performance of the tests empirically. To do this, we generate independent Bernoulli samples to represent the outcomes of simulating the model with some true value p, and use those as input for each of the tests with some threshold p0. All tests have some parameter(s) that need to be chosen,

in particular a confidence level (set to 95% here) and a parameter γ which is the suspected difference between p and p0. In the case of the SPRT, δ is given instead, which is half the width of the indifference

region. In the other cases, the test is optimized for the chosen difference γ, but can still be expected to work if the actual difference turns out to different.

A typical set of results is shown in Table 1, for p = 0.19 and p0= 0.20. The results show that with

the correct choice of γ, all tests produce correct results (i.e., the probability of correct decision is at least equal to the chosen confidence level, namely 95%). If γ is guessed too large, however, the fixed sample size tests (Gauss and Chernoff) tend to not draw a conclusion at all, whereas the SPRT tends to draw a random conclusion; this is consistent with the notion of an indifference region, but leaves the experimenter in the dark about the correctness. The new tests (Azuma and Darling) both draw correct conclusions regardless of γ. The number of samples needed tends to be lower for the Azuma test if γ is chosen correctly, but is less sensitive to the choice of γ in case of the Darling test.

Test γ (or δ ) probability of correct conclusion probability of no conclusion average number of samples

0.1 0.036 ± 0.012 0.953 ± 0.013 1.64·102 Gauss 0.01 0.946 ± 0.014 0.054 ± 0.014 2.04·104 0.001 1.0 ± 0.0 0.0 ± 0.0 2.39·106 0.1 0.489 ± 0.031 0 (3.70 ± 0.17)·101 SPRT 0.01 0.949 ± 0.014 0 (2.19 ± 0.10)·103 0.001 1.0 ± 0.0 0 (2.39 ± 0.03)·104 0.1 0.007 ± 0.005 0.993 ± 0.005 6.67·102 Chernoff 0.01 1.0 ± 0.0 0.0 ± 0.0 6.67·104 0.001 1.0 ± 0.0 0.0 ± 0.0 6.67·106 Bayes uniform 0.599 ± 0.030 0 (5.64 ± 0.56)·102 0.1 1.0 ± 0.0 0 (1.41 ± 0.01)·106 Azuma 0.01 1.0 ± 0.0 0 (4.79 ± 0.10)·104 0.001 1.0 ± 0.0 0 (2.24 ± 0.01)·105 0.1 1.0 ± 0.0 0 (2.04 ± 0.02)·105 Darling 0.01 1.0 ± 0.0 0 (1.78 ± 0.02)·105 0.001 1.0 ± 0.0 0 (2.10 ± 0.02)·105

Table 1: Experimental results for p = 0.19 and p0 = 0.20, with confidence intervals based on 1000

(4)

4 Reliable Sequential Testing

5

Conclusion

The contribution of our work is twofold. First, we have presented a common framework that allows the methods proposed earlier in the statistical model checking literature to be compared in a mathematically solid, yet intuitive manner. Previously, when these methods (e.g., the SPRT and the Chernoff test) were built into model checking tools such as UPPAAL and PRISM, they were often implemented completely parallel to one another with little information given about the subtle differences between the methods and their parameters.

Second, we have introduced two new sequential tests for statistical model checking. The appeal of the new tests is safety: the correctness of the conclusion does not depend on (correct) prior information about the system model. Only the efficiency depends on a good guess for the true probability. We have compared the performance of these tests to the existing tests in the literature, demonstrating their correctness experimentally, and showing that they are reasonably efficient.

Acknowledgements This work is supported by the Netherlands Organisation for Scientific Research (NWO), project number 612.064.812.

References

[1] UPPAAL. http://www.uppaal.org.

[2] D.A. Darling & H. Robbins (1968): Some nonparametric sequential tests with power one. Proceedings of the National Academy of Sciences of the United States of America 61(3), pp. 804–809.

[3] T. H´erault, R. Lassaigne, F. Magniette & S. Peyronnet (2004): Approximate probabilistic model checking. Lecture notes in computer science 2937, pp. 307–329.

[4] S. Jha, E. Clarke, C. Langmead, A. Legay, A. Platzer & P. Zuliani (2009): A Bayesian approach to model checking biological systems. In: Computational Methods in Systems Biology, Springer, pp. 218–234. [5] M. Kwiatkowska, G. Norman & D. Parker (2002): PRISM: Probabilistic symbolic model checker. In:

Com-puter Performance Evaluation: Modelling Techniques and Tools, LNCS 2324, Springer, pp. 113–140. [6] Axel Legay, Benoˆıt Delahaye & Saddek Bensalem (2010): Statistical Model Checking: An Overview. In:

Runtime Verification, LNCS 6418, Springer, pp. 122–135.

[7] D. Reijsbergen, P.T. de Boer, W. Scheinhardt & B.R. Haverkort (2013): On Hypothesis Testing for Statistical Model Checking. Full paper in preparation.

[8] S.M. Ross (1996): Stochastic Processes. John Wiley & Sons New York.

[9] A. Wald (1945): Sequential tests of statistical hypotheses. The Annals of Mathematical Statistics 16(2), pp. 117–186.

[10] H.L.S. Younes & R.G. Simmons (2002): Probabilistic verification of discrete event systems using acceptance sampling. In: Proceedings of the 14th International Conference on Computer Aided Verification, pp. 223– 235.

Referenties

GERELATEERDE DOCUMENTEN

Citrus black spot, caused by Phyllosticta citricarpa in South Africa, only occurs in five of the seven citrus producing provinces (KwaZulu-Natal, Mpumalanga, Limpopo, Eastern Cape and

Future annotations are added to the program annotations to specify the correspondence between futures and the program code. To illustrate, an annotated example program is given

Onderzoek heeft aangetoond dat bij voldoende licht planten bij een hogere luchtvochtigheid en een hogere CO2 – concentratie hogere bladtemperaturen kunnen verdragen én actief

Standards development Other than the SSOs, some expert organizations exist to try to professionalize the process of standards development, including SES Standards Engineering

In the next step, we applied the framework and the resulting design requirements to the design of a wearable breathing trainer to be used for physical therapy of children

Chapter 2 Surface Modification with Control over Ligand Density for the Study of Multivalent Biological Systems In the study of multivalent interactions at interfaces, the density

So, if Pascal is able to shift a speaker’s prosodic parameters in a more charismatic direction, it is possible that women benefit more from Pascal training than men, meaning that

For several cases, formula-dependent lumping plus model checking the lumped DTMC takes significantly less time than model checking the original DTMC.... Bisimulation minimisation