| 1 |
# Discriminant.praat |
| 2 |
# Paul Boersma 2016-01-01 |
| 3 |
|
| 4 |
# |
| 5 |
# This test follows the Praat manual page on "Discriminant analysis" |
| 6 |
# |
| 7 |
writeInfoLine: "test discriminant analysis" |
| 8 |
|
| 9 |
table = Create TableOfReal (Pols 1973): "no" |
| 10 |
Formula: ~ if col <= 3 then log10 (self) else self fi |
| 11 |
Standardize columns |
| 12 |
Set column label (index): 1, "standardized log (%F__1_)" |
| 13 |
Set column label (index): 2, "standardized log (%F__2_)" |
| 14 |
Set column label (index): 3, "standardized log (%F__3_)" |
| 15 |
;Set column label (index): 4, "standardized %L__1_" |
| 16 |
;Set column label (index): 5, "standardized %L__2_" |
| 17 |
;Set column label (index): 6, "standardized %L__3_" |
| 18 |
|
| 19 |
Erase all |
| 20 |
Select outer viewport: 0.0, 5.0, 0.0, 5.0 |
| 21 |
Draw scatter plot: 1, 2, 0, 0, -2.9, 2.9, -2.9, 2.9, 10, "yes", "+", "yes" |
| 22 |
|
| 23 |
discriminant = To Discriminant |
| 24 |
test1 = Read from file: "Pols.text.Discriminant" |
| 25 |
test2 = Read from file: "Pols.binary.Discriminant" |
| 26 |
assert objectsAreIdentical (test1, test2) |
| 27 |
|
| 28 |
plusObject: table |
| 29 |
configuration = To Configuration: 0 |
| 30 |
Erase all |
| 31 |
Draw: 1, 2, -2.9, 2.9, -2.9, 2.9, 12, "yes", "+", "yes" |
| 32 |
|
| 33 |
removeObject: table, discriminant, test1, test2, configuration |
| 34 |
|
| 35 |
appendInfoLine: "OK" |