OT learning 2.9. Output distributions

To ask the grammar to produce many outputs for a specified input form, and collect them in a Strings object, you select an OTGrammar and choose Input to outputs....

For example, select the object "OTGrammar assimilation" from our place assimilation example (§2.6), and click Input to outputs.... In the resulting command window, you specify 1000 trials, a noise strength of 2.0, and "an+pa" for the input form.

After you click OK, a Strings object will appear in the list. If you click Info, you will see that it contains 1000 strings. If you click Inspect, you will see that most of the strings are "ampa", but some of them are "anpa". These are the output forms computed from 1000 evaluations for the input /an+pa/.

To count how many instances of [ampa] and [anpa] were generated, you select the Strings object and click To Distributions. You will see a new Distributions object appear in the list. If you draw this to the Picture window (with Draw as numbers...), you will see something like:


which means that our grammar, when fed with 1000 /an+pa/ inputs, produced [ampa] 815 times, and [anpa] 185 times, which is consistent with our initial guess that a ranking difference of 2.7 would cause approximately an 80% - 20% distribution of [ampa] and [anpa].

Checking the distribution hypothesis

To see whether the guess of a 2.7 ranking difference is correct, we perform 1,000,000 trials instead of 1000. The output distribution (if you have enough memory in your computer) becomes something like (set the Precision to 7 in the Draw command window):


The expected values under the 80% - 20% distribution hypothesis are:


We compute (e.g. with Calculator...) a χ2 of 300802/800000 + 300802/200000 = 5655.04, which, of course, is much too high for a distribution with a single degree of freedom. So the ranking difference must be smaller. If it is 2.4 (change the ranking of *GESTURE to 102.4), the numbers become something like


which gives a χ2 of 24.35. By using the Calculator with the formula chiSquareQ (24.35, 1), we find that values larger than this have a probability of 8·10-7 under the 80% - 20% distribution hypothesis, which must therefore be rejected again.

Rather than continuing this iterative procedure to find the correct ranking values for an 80% - 20% grammar, we will use the Gradual Learning Algorithm (§5) to determine the rankings automatically, without any memory of past events other than the memory associated with maintaining the ranking values.

Measuring all inputs

To measure the outcomes of all the possible inputs at once, you select an OTGrammar and choose To output Distributions.... As an example, try this on our place assimilation grammar. You can supply 1000000 for the number of trials, and the usual 2.0 for the standard deviation of the noise. After you click OK, a Distributions object will appear in the list. If you draw this to the Picture window, the result will look like:

/an+pa/ → anpa169855
/an+pa/ → ampa830145
/at+ma/ → atma999492
/at+ma/ → apma508

We see that the number of [apma] outputs is not zero. This is due to the difference of 9.3 between the rankings of *REPLACE (t, p) and *GESTURE. If you rank *REPLACE (t, p) at 116.0, the number of produced [apma] reduces to about one in a million, as you can easily check with some patience.

Links to this page

© ppgb, August 8, 2011