Debian Codegraph @

dwtools/manual_DataModeler.cpp

raw symbols SCIP
1 /* manual_DataModeler.cpp
2 *
3 * Copyright (C) 2014-2025 David Weenink
4 *
5 * This code is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
9 *
10 * This code is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this work. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 /*
20 djmw 20101009 Initial version
21 */
22
23 #include "ManPagesM.h"cxx . . $ `<file>/sys/ManPagesM.h`/
24
25 void manual_DataModelercxx . . $ manual_DataModeler(e57bd08652fa63a5). (ManPagescxx . . $ ManPages# me);
26 void manual_DataModelercxx . . $ manual_DataModeler(e57bd08652fa63a5). (ManPagescxx . . $ ManPages# me) {
27
28 MAN_PAGES_BEGINcxx . . $ `sys/ManPagesM.h:27:9`!
29 R"~~~(
30 ################################################################################
31 "DataModeler"
32 © David Weenink, 2024
33
34 One of the @@types of objects@ in Praat. A #DataModeler tries to fit %N data points (%x_%i, %y_%i) as lying on a particular kind
35 of model function f(%x; #%p) that depends on %M %parameters #%p.
36 The parameters #%p are determined by minimizing the chi squared function
37 %\ci^^2^(#p%)=\Si ((%y__%i_ - %f(%x__%i_, #%p))/%\si__%i_)^^2^,
38 where the sum is over all %N data points.
39
40 If the individual uncertainties %\si__%i_of the data are not known before hand, the model parameter are determined by assuming that
41 all uncertainties %\si__$i_ are equal. However an independent assessment of the goodness-of-fit cannot be determined in this case.
42 A good guess for %\si^^2^ for this case could be %\si^^2^=\Si (%y__%i_ - %f(%x__%i_, #%p))^^2^.
43
44 Drawing
45 =======
46
47 ################################################################################
48 "DataModeler: Speckle..."
49 © David Weenink, 2024
50
51 Draws the data as (x_i, y_i) points.
52
53 ################################################################################
54 "DataModeler: Draw model..."
55 © David Weenink, 2024
56
57 Draws the model function as a continuous curve.
58
59
60 ################################################################################
61 "DataModeler: Draw estimated track..."
62 © David Weenink, 2024
63
64 Draws the model function as a sequence of straight line segments between the estimated values at the data %x_%i values.
65 If there are many data this curve is almost indistinguishable from a the curve drawn by @@DataModeler: Draw model...|Draw model...@.
66
67
68 ################################################################################
69 "DataModeler: Get coefficient of determination"
70 © David Weenink, 2024
71
72 Get the coefficient of determination (%R^2) of the model.
73 The %R^2 goodness of fit is a number between 0 and 1 that measures how well a model predicts the data.
74 A value of 1 means a perfect fit.
75 If all dependent data, the %y values, have the same variance the %R^2 is simply 1 - %SS__model_/%SS__total_,
76 where %SS__model_ is the sum of the squared differences between %y's predicted by the model and the actual %y values from the data,
77 and %SS__total_ the sum of the squared differences between the actual data %y values and the mean of the data.
78
79 Because our data points can have different weights we use adapted formula from @@Buse (1973)@.
80
81
82 ################################################################################
83 "DataModeler: Get residual sum of squares"
84 © David Weenink, 2024
85
86 Get the residual sum of squares which is defined as
87 EQUATION (\Si (y[i] - ))
88
89 ################################################################################
90 "DataModeler: To Table (z-scores)"
91 © David Weenink, 2024
92
93 For each data point get the difference between the model and the data as a z-score.
94
95
96 ################################################################################
97 )~~~"
98 MAN_PAGES_ENDcxx . . $ `sys/ManPagesM.h:28:9`!
99
100 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"FormantModeler: Get residual sum of squares...", U"djmw", 20140421)
101 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"Get the residual sum of squares for a formant in the selected FormantModeler.")
102 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The residual sum of squares, RSS, is defined as follows")
103 EQUATIONcxx . . $ `sys/ManPagesM.h:57:9`! (U"RSS = \\su__i=1_^^n^ (%f__%i_ - %F__%i_)^^2^,")
104 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"where %f__%i_ is the frequency value of the %i-ith data point, %F__%i_ is the frequency at the i-data point as estimated by the model and %n is the number of data points.")
105 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
106
107 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formants: Extract smoothest part (constrained)...", U"djmw", 20140424)
108 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Extracts the best matching part from the slected @@formant|Formant@s.")
109 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Settings")
110 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##Minimum F1 (Hz)")
111 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"suppresses models whose average first formant frequency, %f1, is below %%minimumF1% by a factor sqrt (%minimumF1 - %f1 + 1). You can use this constraint to disfavour models with a low average first formant. Sometimes due to the generally high frequency of the /a/ a lower harmonic of the fundamental frequency is taken as a candidate for the first formant. You can suppress these models with this constraint.")
112 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##Maximum F1 (Hz)")
113 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"suppresses models whose average first formant frequency, %f1, is above %%maximumF1% by a factor sqrt (%f1 - %%maximumF1% + 1).You can use this constraint to disfavour models in which the first formant is missing. ")
114 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##Minimum F2 (Hz)")
115 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"suppresses models whose average second formant frequency, %f2, is below %%minimumF2% by a factor sqrt (%minimumF2 - %f2 + 1). This constraint might be used for high front vowels that normally have a large distance between the first and second formant. ")
116 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##Maximum F2 (Hz)")
117 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"suppresses models whose average second formant frequency, %f2, is above %%maximumF2% by a factor sqrt (%f2 - %%maximumF2% + 1). This factor is sometimes necessary to suppress models for high back vowels where the second formant is \"missing\", i.e. where the third formant is playing the role of the second. ")
118 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##Minimum F3 (Hz)")
119 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"suppress models whose average third formant frequency, %%f3%, is below %%minimumF3% by a factor sqrt (%%minimumF3% - %%f3% + 1). This constraint might sometimes be usefull to suppress low lying third formants that can occur for /a/-like vowels.")
120 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
121
122
123 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Buse (1973)", U"djmw", 20140328)
124 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"A. Buse (1973): \"Goodness of fit in generalized least squares estimation.\", %%The American Statistician% #27: 106\\--108.")
125 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
126
127 }
128
129 /* End of file manual_HMM.cpp */