Page 275 -
P. 275
6.3 Syntactic Analysis 263
The string dl/, corresponding to either the first negative P wave or the following
Q wave in Figure 6.13, can be parsed by both grammars corresponding to the state-
diagrams of Figure 6.14.
The probabilities of generating this string are:
P- grammar: P(x I P-) = 0.8x0.3 = 0.24;
Q grammar: P(x I Q) = 0.4x0.8 = 0.32.
When a string can be accepted by multiple grammars we apply the Bayes rule,
used already in statistical classification, in order to arrive at a decision. For this
purpose, assume that x can be produced by c grammars G, with probabilities
P(x ( Gi). Assume further, that the prior probabilities for the productions are P(Gi).
Application of the Bayes rule corresponds to choosing the grammar that maximizes
P(Gi I x), or equivalently:
Decide x E L(Gk) if P(Gk) P(x I GR) = max (P(Gi) P(x 1 G,), i= 1,. . .,c]. (6- 17)
In the case of the electrocardiographic signals, the distinction between negative
P waves and Q waves is usually a simple task, based on the presence of a peaked R
wave after the Q wave. However, there exist less frequent situations where Q
waves can appear isolated and there are also rare rhythmic pathologies,
characterized by multiple P waves, which may superimpose over the QRS
sequence. The signal shown in Figure 6.13 corresponds precisely to such a
pathology. Supposing that in this case the prior probabilities are:
we obtain:
P- grammar: P(P-)P(x 1 P-) = 0.144;
Q grammar: P(Q)P(x ( Q) = 0.128;
and would decide then for the presence of a negative P wave, although the
distinction is somewhat borderline.
In the case of "typical" negative P and Q waves there is a clear distinction:
Typical negative P wave, with string du:
P- grammar: P(P-)P(x 1 P-) = 0.336;
Q grammar: P(Q)P(x 1 Q) = 0.032.
Typical Q wave, with string DU:
P- grammar: P(P-)P(x ( P-) = 0.036;
Q grammar: P(Q)P(x I Q) = 0.192.