praat_MDS_init.cpp 76 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537
  1. /* praat_MDS_init.cpp
  2. *
  3. * Copyright (C) 1992-2018 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 2 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. djmw 20020408 GPL
  20. djmw 20020408 Added MDS-tutorial
  21. djmw 20020603 Changes due to TableOfReal dynamic menu changes.
  22. djmw 20040415 Forms texts.
  23. djmw 20040513 More forms text changes
  24. djmw 20041027 Orhogonal transform parameter for Configurations_to_Procrustes
  25. djmw 20050406 classProcrustus -> classProcrustes.
  26. djmw 20050426 Removed "Procrustus.h"
  27. djmw 20050630 Better name of Procrustes object after Configurations_to_Procrustes.
  28. djmw 20061218 Introduction of Melder_information<12...9>
  29. djmw 20070902 Melder_new<1...>
  30. djmw 20071011 REQUIRE requires U"".
  31. djmw 20090818 Thing_recognizeClassesByName: added classAffineTransform, classScalarProduct, classWeight
  32. */
  33. #include <math.h>
  34. #include "NUM2.h"
  35. #include "praat.h"
  36. #include "MDS.h"
  37. #include "ContingencyTable.h"
  38. #include "TableOfReal_extensions.h"
  39. #include "Configuration_and_Procrustes.h"
  40. #include "Configuration_AffineTransform.h"
  41. #include "Proximity_and_Distance.h"
  42. #include "Confusion.h"
  43. #include "Formula.h"
  44. void praat_TableOfReal_init2 (ClassInfo klas);
  45. static const conststring32 QUERY_BUTTON = U"Query -";
  46. static const conststring32 DRAW_BUTTON = U"Draw -";
  47. static const conststring32 ANALYSE_BUTTON = U"Analyse -";
  48. static const conststring32 CONFIGURATION_BUTTON = U"To Configuration -";
  49. /* Tests */
  50. #undef iam
  51. #define iam iam_LOOP
  52. /************************* examples ***************************************/
  53. FORM (NEW1_Dissimilarity_createLetterRExample, U"Create letter R example", U"Create letter R example...") {
  54. LABEL (U"For the monotone transformation on the distances")
  55. REAL (noiseRange, U"Noise range", U"32.5")
  56. OK
  57. DO
  58. CREATE_ONE
  59. autoDissimilarity result = Dissimilarity_createLetterRExample (noiseRange);
  60. CREATE_ONE_END (U"R")
  61. }
  62. FORM (NEWMANY_INDSCAL_createCarrollWishExample, U"Create INDSCAL Carroll & Wish example...", U"Create INDSCAL Carroll & Wish example...") {
  63. REAL (noiseStandardDeviation, U"Noise standard deviation", U"0.0")
  64. OK
  65. DO
  66. praat_new (INDSCAL_createCarrollWishExample (noiseStandardDeviation), U"");
  67. END }
  68. FORM (NEW1_Configuration_create, U"Create Configuration", U"Create Configuration...") {
  69. WORD (name, U"Name", U"uniform")
  70. NATURAL (numberOfPoints, U"Number of points", U"10")
  71. NATURAL (numberOfDimensions, U"Number of dimensions", U"2")
  72. TEXTFIELD (formula, U"Formula:", U"randomUniform(-1.5, 1.5)")
  73. OK
  74. DO
  75. CREATE_ONE
  76. autoConfiguration result = Configuration_create (numberOfPoints, numberOfDimensions);
  77. TableOfReal_formula (result.get(), formula, interpreter, nullptr);
  78. CREATE_ONE_END (name)
  79. }
  80. FORM (GRAPHICS_drawSplines, U"Draw splines", U"spline") {
  81. REAL (xmin, U"left Horizontal range", U"0.0")
  82. REAL (xmax, U"right Horizontal range", U"1.0")
  83. REAL (ymin, U"left Vertical range", U"0.0")
  84. REAL (ymax, U"right Vertical range", U"20.0")
  85. RADIO (splineType, U"Spline type", 1)
  86. RADIOBUTTON (U"M-spline")
  87. RADIOBUTTON (U"I-spline")
  88. INTEGER (order, U"Order", U"3")
  89. SENTENCE (interiorKnots_string, U"Interior knots", U"0.3 0.5 0.6")
  90. BOOLEAN (garnish, U"Garnish", true)
  91. OK
  92. DO
  93. if (xmax <= xmin or ymax <= ymin) {
  94. Melder_throw (U"Required: xmin < xmax and ymin < ymax.");
  95. }
  96. GRAPHICS_NONE
  97. drawSplines (GRAPHICS, xmin, xmax, ymin, ymax, splineType,order, interiorKnots_string, garnish);
  98. GRAPHICS_NONE_END
  99. }
  100. DIRECT (GRAPHICS_drawMDSClassRelations) {
  101. GRAPHICS_NONE
  102. drawMDSClassRelations (GRAPHICS);
  103. GRAPHICS_NONE_END
  104. }
  105. /***************** AffineTransform ***************************************/
  106. DIRECT (HELP_AffineTransform_help) {
  107. HELP (U"AffineTransform");
  108. }
  109. DIRECT (NEW_AffineTransform_invert) {
  110. CONVERT_EACH (AffineTransform)
  111. autoAffineTransform result = AffineTransform_invert (me);
  112. CONVERT_EACH_END (my name.get(), U"_inv")
  113. }
  114. FORM (REAL_AffineTransform_getTransformationElement, U"AffineTransform: Get transformation element", U"Procrustes") {
  115. NATURAL (irow, U"Row number", U"1")
  116. NATURAL (icol, U"Column number", U"1")
  117. OK
  118. DO
  119. NUMBER_ONE (AffineTransform)
  120. Melder_require (irow <= my dimension, U"Row number should not exceed the dimension of the transform.");
  121. Melder_require (icol <= my dimension, U"Column number should not exceed the dimension of the transform.");
  122. double result = my r [irow] [icol];
  123. NUMBER_ONE_END (U" r [", irow, U"] [", icol, U"]")
  124. }
  125. FORM (REAL_AffineTransform_getTranslationElement, U"AffineTransform: Get translation element", U"Procrustes") {
  126. NATURAL (index, U"Index", U"1")
  127. OK
  128. DO
  129. NUMBER_ONE (AffineTransform)
  130. Melder_require (index <= my dimension, U"Index should not exceed the dimension of the transform.");
  131. double result = my t [index];
  132. NUMBER_ONE_END (U"")
  133. }
  134. DIRECT (NEW_AffineTransform_extractMatrix) {
  135. CONVERT_EACH (AffineTransform)
  136. autoTableOfReal result = AffineTransform_extractMatrix (me);
  137. CONVERT_EACH_END (my name.get())
  138. }
  139. DIRECT (NEW_AffineTransform_extractTranslationVector) {
  140. CONVERT_EACH (AffineTransform)
  141. autoTableOfReal result = AffineTransform_extractTranslationVector (me);
  142. CONVERT_EACH_END (my name.get())
  143. }
  144. /***************** Configuration ***************************************/
  145. DIRECT (HELP_Configuration_help) {
  146. HELP (U"Configuration")
  147. }
  148. #define praat_Configuration_draw_commonFields(horizontalDimension,verticalDimension,xmin,xmax,ymin,ymax) \
  149. NATURAL (horizontalDimension, U"Horizontal dimension", U"1") \
  150. NATURAL (verticalDimension, U"Vertical dimension", U"2") \
  151. REAL (xmin, U"left Horizontal range", U"0.0") \
  152. REAL (xmax, U"right Horizontal range", U"0.0") \
  153. REAL (ymin, U"left Vertical range", U"0.0") \
  154. REAL (ymax, U"right Vertical range", U"0.0")
  155. FORM (GRAPHICS_Configuration_draw, U"Configuration: Draw", U"Configuration: Draw...") {
  156. praat_Configuration_draw_commonFields(horizontalDimension,verticalDimension,xmin,xmax,ymin,ymax)
  157. NATURAL (labelSize, U"Label size", U"12")
  158. BOOLEAN (useRowLables, U"Use row labels", false)
  159. WORD (label, U"Label", U"+")
  160. BOOLEAN (garnish, U"Garnish", true)
  161. OK
  162. DO
  163. GRAPHICS_EACH (Configuration)
  164. Configuration_draw (me, GRAPHICS, horizontalDimension, verticalDimension, xmin, xmax, ymin, ymax, labelSize, useRowLables, label, garnish);
  165. GRAPHICS_EACH_END
  166. }
  167. FORM (GRAPHICS_Configuration_drawSigmaEllipses, U"Configuration: Draw sigma ellipses", U"Configuration: Draw sigma ellipses...") {
  168. POSITIVE (numberOfSigmas, U"Number of sigmas", U"1.0")
  169. praat_Configuration_draw_commonFields(horizontalDimension,verticalDimension,xmin,xmax,ymin,ymax)
  170. INTEGER (labelSize, U"Label size", U"12")
  171. BOOLEAN (garnish, U"Garnish", true)
  172. OK
  173. DO
  174. GRAPHICS_EACH (Configuration)
  175. Configuration_drawConcentrationEllipses (me, GRAPHICS, numberOfSigmas, false, nullptr, horizontalDimension, verticalDimension, xmin, xmax, ymin, ymax, labelSize, garnish);
  176. GRAPHICS_EACH_END
  177. }
  178. FORM (GRAPHICS_Configuration_drawOneSigmaEllipse, U"Configuration: Draw one sigma ellipse", U"Configuration: Draw sigma ellipses...") {
  179. SENTENCE (label, U"Label", U"")
  180. POSITIVE (numberOfSigmas, U"Number of sigmas", U"1.0")
  181. praat_Configuration_draw_commonFields(horizontalDimension,verticalDimension,xmin,xmax,ymin,ymax)
  182. INTEGER (labelSize, U"Label size", U"12")
  183. BOOLEAN (garnish, U"Garnish", true)
  184. OK
  185. DO
  186. GRAPHICS_EACH (Configuration)
  187. Configuration_drawConcentrationEllipses (me, GRAPHICS, numberOfSigmas,false, label, horizontalDimension, verticalDimension, xmin, xmax, ymin, ymax, labelSize, garnish);
  188. GRAPHICS_EACH_END
  189. }
  190. FORM (GRAPHICS_Configuration_drawConfidenceEllipses, U"Configuration: Draw confidence ellipses", nullptr) {
  191. POSITIVE (confidenceLevel, U"Confidence level (0-1)", U"0.95")
  192. praat_Configuration_draw_commonFields(horizontalDimension,verticalDimension,xmin,xmax,ymin,ymax)
  193. INTEGER (labelSize, U"Label size", U"12")
  194. BOOLEAN (garnish, U"Garnish", true)
  195. OK
  196. DO
  197. GRAPHICS_EACH (Configuration)
  198. Configuration_drawConcentrationEllipses (me, GRAPHICS, confidenceLevel, true /* confidence */, nullptr, horizontalDimension, verticalDimension, xmin, xmax, ymin, ymax, labelSize, garnish);
  199. GRAPHICS_EACH_END
  200. }
  201. FORM (GRAPHICS_Configuration_drawOneConfidenceEllipse, U"Configuration: Draw one confidence ellipse", nullptr) {
  202. SENTENCE (label, U"Label", U"")
  203. POSITIVE (confidenceLevel, U"Confidence level (0-1)", U"0.95")
  204. praat_Configuration_draw_commonFields(horizontalDimension,verticalDimension,xmin,xmax,ymin,ymax)
  205. INTEGER (labelSize, U"Label size", U"12")
  206. BOOLEAN (garnish, U"Garnish", true)
  207. OK
  208. DO
  209. GRAPHICS_EACH (Configuration)
  210. Configuration_drawConcentrationEllipses (me, GRAPHICS, confidenceLevel, true, label, horizontalDimension, verticalDimension, xmin, xmax, ymin, ymax, labelSize, garnish);
  211. GRAPHICS_EACH_END
  212. }
  213. DIRECT (MODIFY_Configuration_randomize) {
  214. MODIFY_EACH (Configuration)
  215. Configuration_randomize (me);
  216. MODIFY_EACH_END
  217. }
  218. FORM (MODIFY_Configuration_normalize, U"Configuration: Normalize", U"Configuration: Normalize...") {
  219. REAL (sumOfSquares, U"Sum of squares", U"0.0")
  220. LABEL (U"On (INDSCAL), Off (Kruskal)")
  221. BOOLEAN (separateDimensions, U"Each dimension separately", true)
  222. OK
  223. DO
  224. MODIFY_EACH (Configuration)
  225. Configuration_normalize (me, sumOfSquares, separateDimensions);
  226. MODIFY_EACH_END
  227. }
  228. DIRECT (MODIFY_Configuration_centralize) {
  229. MODIFY_EACH (Configuration)
  230. TableOfReal_centreColumns (me);
  231. MODIFY_EACH_END
  232. }
  233. FORM (MODIFY_Configuration_rotate, U"Configuration: Rotate", U"Configuration: Rotate...") {
  234. NATURAL (dimension1, U"Dimension 1", U"1")
  235. NATURAL (dimension2, U"Dimension 2", U"2")
  236. REAL (angle_degrees, U"Angle (degrees)", U"60.0")
  237. OK
  238. DO
  239. MODIFY_EACH (Configuration)
  240. Configuration_rotate (me, dimension1, dimension2, angle_degrees);
  241. MODIFY_EACH_END
  242. }
  243. DIRECT (MODIFY_Configuration_rotateToPrincipalDirections) {
  244. MODIFY_EACH (Configuration)
  245. Configuration_rotateToPrincipalDirections (me);
  246. MODIFY_EACH_END
  247. }
  248. FORM (MODIFY_Configuration_invertDimension, U"Configuration: Invert dimension", U"Configuration: Invert dimension...") {
  249. NATURAL (dimension, U"Dimension", U"1")
  250. OK
  251. DO
  252. MODIFY_EACH (Configuration)
  253. Configuration_invertDimension (me, dimension);
  254. MODIFY_EACH_END
  255. }
  256. DIRECT (NEW_Configuration_to_Distance) {
  257. CONVERT_EACH (Configuration)
  258. autoDistance result = Configuration_to_Distance (me);
  259. CONVERT_EACH_END (my name.get())
  260. }
  261. FORM (NEW_Configuration_varimax, U"Configuration: To Configuration (varimax)", U"Configuration: To Configuration (varimax)...") {
  262. BOOLEAN (normalizeRows, U"Normalize rows", true)
  263. BOOLEAN (useQuartimax, U"Quartimax", false)
  264. NATURAL (maximumNumberOfIterations, U"Maximum number of iterations", U"50")
  265. POSITIVE (tolerance, U"Tolerance", U"1e-6")
  266. OK
  267. DO
  268. CONVERT_EACH (Configuration)
  269. autoConfiguration result = Configuration_varimax (me, normalizeRows, useQuartimax, maximumNumberOfIterations, tolerance);
  270. CONVERT_EACH_END (my name.get(), U"_varimax")
  271. }
  272. DIRECT (NEW1_Configurations_to_Similarity_cc) {
  273. CONVERT_TYPED_LIST (Configuration, ConfigurationList)
  274. autoSimilarity result = ConfigurationList_to_Similarity_cc (list.get(), nullptr);
  275. CONVERT_TYPED_LIST_END (U"congruence")
  276. }
  277. FORM (NEW1_Configurations_to_Procrustes, U"Configuration & Configuration: To Procrustes", U"Configuration & Configuration: To Procrustes...") {
  278. BOOLEAN (useOrthogonalTransform, U"Use orthogonal transform", false)
  279. OK
  280. DO
  281. CONVERT_COUPLE (Configuration)
  282. autoProcrustes result = Configurations_to_Procrustes (me, you, useOrthogonalTransform);
  283. CONVERT_COUPLE_END (your name.get(), U"_to_", my name.get())
  284. }
  285. FORM (NEW1_Configurations_to_AffineTransform_congruence, U"Configurations: To AffineTransform (congruence)", U"Configurations: To AffineTransform (congruence)...") {
  286. NATURAL (maximumNumberOfIterations, U"Maximum number of iterations", U"50")
  287. POSITIVE (tolerance, U"Tolerance", U"1e-6")
  288. OK
  289. DO
  290. CONVERT_COUPLE (Configuration)
  291. autoAffineTransform result = Configurations_to_AffineTransform_congruence (me, you, maximumNumberOfIterations, tolerance);
  292. CONVERT_COUPLE_END (your name.get(), U"_to_", my name.get())
  293. }
  294. DIRECT (NEW1_Configuration_Weight_to_Similarity_cc) {
  295. CONVERT_ONE_AND_TYPED_LIST (Weight, Configuration, ConfigurationList)
  296. autoSimilarity result = ConfigurationList_to_Similarity_cc (list.get(), me);
  297. CONVERT_ONE_AND_TYPED_LIST_END (U"congruence")
  298. }
  299. DIRECT (NEW1_Configuration_AffineTransform_to_Configuration) {
  300. CONVERT_TWO (Configuration, AffineTransform)
  301. autoConfiguration result = Configuration_AffineTransform_to_Configuration (me, you);
  302. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  303. }
  304. DIRECT (NEW1_Configuration_Procrustes_to_Configuration) {
  305. CONVERT_TWO (Configuration, Procrustes)
  306. autoConfiguration result = Configuration_AffineTransform_to_Configuration (me, you);
  307. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  308. }
  309. /*************** Confusion *********************************/
  310. FORM (NEW_Confusion_to_Dissimilarity_pdf, U"Confusion: To Dissimilarity (pdf)", U"Confusion: To Dissimilarity (pdf)...") {
  311. POSITIVE (minimumConfusionLevel, U"Minimum confusion level", U"0.5")
  312. OK
  313. DO
  314. CONVERT_EACH (Confusion)
  315. autoDissimilarity result = Confusion_to_Dissimilarity_pdf (me, minimumConfusionLevel);
  316. CONVERT_EACH_END (my name.get(), U"_pdf")
  317. }
  318. FORM (NEW_Confusion_to_Similarity, U"Confusion: To Similarity", U"Confusion: To Similarity...") {
  319. BOOLEAN (normalize, U"Normalize", true)
  320. RADIO (symmetrizeMethod, U"Symmetrization", 1)
  321. RADIOBUTTON (U"No symmetrization")
  322. RADIOBUTTON (U"Average (s[i][j] = (c[i][j]+c[j][i])/2)")
  323. RADIOBUTTON (U"Houtgast (s[i][j]= sum (min(c[i][k],c[j][k])))")
  324. OK
  325. DO
  326. CONVERT_EACH (Confusion)
  327. autoSimilarity result = Confusion_to_Similarity (me, normalize, symmetrizeMethod);
  328. CONVERT_EACH_END (my name.get())
  329. }
  330. DIRECT (NEW1_Confusions_sum) {
  331. CONVERT_TYPED_LIST (Confusion, ConfusionList)
  332. autoConfusion result = ConfusionList_sum (list.get());
  333. CONVERT_TYPED_LIST_END (U"sum")
  334. }
  335. DIRECT (NEW_Confusion_to_ContingencyTable) {
  336. CONVERT_EACH (Confusion)
  337. autoContingencyTable result = Confusion_to_ContingencyTable (me);
  338. CONVERT_EACH_END (my name.get())
  339. }
  340. /*************** ContingencyTable *********************************/
  341. FORM (NEW_ContingencyTable_to_Configuration_ca, U"ContingencyTable: To Configuration (ca)", U"ContingencyTable: To Configuration (ca)...") {
  342. NATURAL (numberOfDimensions, U"Number of dimensions", U"2")
  343. RADIO (scalingType, U"Scaling of final configuration", 3)
  344. RADIOBUTTON (U"Row points in centre of gravity of column points")
  345. RADIOBUTTON (U"Column points in centre of gravity of row points")
  346. RADIOBUTTON (U"Row points and column points symmetric")
  347. OK
  348. DO
  349. CONVERT_EACH (ContingencyTable)
  350. autoConfiguration result = ContingencyTable_to_Configuration_ca (me, numberOfDimensions, scalingType);
  351. CONVERT_EACH_END (my name.get())
  352. }
  353. DIRECT (REAL_ContingencyTable_chisqProbability) {
  354. NUMBER_ONE (ContingencyTable)
  355. double result = ContingencyTable_chisqProbability (me);
  356. NUMBER_ONE_END (U"(probability)")
  357. }
  358. DIRECT (REAL_ContingencyTable_cramersStatistic) {
  359. NUMBER_ONE (ContingencyTable)
  360. double result = ContingencyTable_cramersStatistic (me);
  361. NUMBER_ONE_END (U"(cramer)")
  362. }
  363. DIRECT (REAL_ContingencyTable_contingencyCoefficient) {
  364. NUMBER_ONE (ContingencyTable)
  365. double result = ContingencyTable_contingencyCoefficient (me);
  366. NUMBER_ONE_END (U"(contingency coefficient)")
  367. }
  368. /************************* Correlation ***********************************/
  369. FORM (NEW_Correlation_to_Configuration, U"Correlation: To Configuration", nullptr) {
  370. NATURAL (numberOfDimensions, U"Number of dimensions", U"2")
  371. OK
  372. DO
  373. CONVERT_EACH (Correlation)
  374. autoConfiguration result = Correlation_to_Configuration (me, numberOfDimensions);
  375. CONVERT_EACH_END (my name.get())
  376. }
  377. /************************* Similarity ***************************************/
  378. DIRECT (HELP_Similarity_help) {
  379. HELP (U"Similarity")
  380. }
  381. FORM (NEW_Similarity_to_Dissimilarity, U"Similarity: To Dissimilarity", U"Similarity: To Dissimilarity...") {
  382. REAL (maximumDissimilarity, U"Maximum dissimilarity", U"0.0 (= from data)")
  383. OK
  384. DO
  385. CONVERT_EACH (Similarity)
  386. autoDissimilarity result = Similarity_to_Dissimilarity (me, maximumDissimilarity);
  387. CONVERT_EACH_END (my name.get())
  388. }
  389. /**************** Dissimilarity ***************************************/
  390. #define praat_Dissimilarity_to_Configuration_commonFields(tolerance,maximumNumberOfIterations,numberOfRepetitions) \
  391. LABEL (U"Minimization parameters") \
  392. REAL (tolerance, U"Tolerance", U"1e-5") \
  393. NATURAL (maximumNumberOfIterations, U"Maximum number of iterations", U"50 (= each repetition)") \
  394. NATURAL (numberOfRepetitions, U"Number of repetitions", U"1")
  395. #define Dissimilarity_Configuration_getStress_addCommonFields(stressMeasure) \
  396. RADIO (stressMeasure, U"Stress measure", 1) \
  397. RADIOBUTTON (U"Normalized") \
  398. RADIOBUTTON (U"Kruskal's stress-1") \
  399. RADIOBUTTON (U"Kruskal's stress-2") \
  400. RADIOBUTTON (U"Raw")
  401. #define praat_Dissimilarity_Configuration_drawing_commonFields(fromProximity,toProximity,fromDistance,toDistance,markSize,markString,garnish) \
  402. REAL (fromProximity, U"left Proximity range", U"0.0") \
  403. REAL (toProximity, U"right Proximity range", U"0.0") \
  404. REAL (fromDistance, U"left Distance range", U"0.0") \
  405. REAL (toDistance, U"right Distance range", U"0.0") \
  406. POSITIVE (markSize, U"Mark size (mm)", U"1.0") \
  407. SENTENCE (markString, U"Mark string (+xo.)", U"+") \
  408. BOOLEAN (garnish, U"Garnish", true)
  409. DIRECT (HELP_Dissimilarity_help) {
  410. HELP (U"Dissimilarity")
  411. }
  412. DIRECT (REAL_Dissimilarity_getAdditiveConstant) {
  413. LOOP {
  414. iam (Dissimilarity);
  415. double c = Dissimilarity_getAdditiveConstant (me);
  416. Melder_information (c);
  417. }
  418. END }
  419. FORM (NEW1_Dissimilarity_Configuration_kruskal, U"Dissimilarity & Configuration: To Configuration (kruskal)", U"Dissimilarity & Configuration: To Configuration (kruskal)...") {
  420. RADIO (tiesHandling, U"Handling of ties", 1)
  421. RADIOBUTTON (U"Primary approach")
  422. RADIOBUTTON (U"Secondary approach")
  423. RADIO (stressFormula, U"Stress calculation", 1)
  424. RADIOBUTTON (U"Formula1")
  425. RADIOBUTTON (U"Formula2")
  426. praat_Dissimilarity_to_Configuration_commonFields (tolerance,maximumNumberOfIterations,numberOfRepetitions)
  427. OK
  428. DO
  429. CONVERT_TWO (Dissimilarity, Configuration)
  430. autoConfiguration result = Dissimilarity_Configuration_kruskal (me, you, tiesHandling, stressFormula, tolerance, maximumNumberOfIterations, numberOfRepetitions);
  431. CONVERT_TWO_END (my name.get(), U"_kruskal")
  432. }
  433. FORM (NEW1_Dissimilarity_Configuration_absolute_mds, U"Dissimilarity & Configuration: To Configuration (absolute mds)", U"Dissimilarity & Configuration: To Configuration (absolute mds)...") {
  434. praat_Dissimilarity_to_Configuration_commonFields (tolerance,maximumNumberOfIterations,numberOfRepetitions)
  435. OK
  436. DO
  437. CONVERT_TWO (Dissimilarity, Configuration)
  438. bool showProgress = true;
  439. autoConfiguration result = Dissimilarity_Configuration_Weight_absolute_mds (me, you, nullptr, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgress);
  440. CONVERT_TWO_END (my name.get(), U"_absolute");
  441. }
  442. FORM (NEW1_Dissimilarity_Configuration_ratio_mds, U"Dissimilarity & Configuration: To Configuration (ratio mds)", U"Dissimilarity & Configuration: To Configuration (ratio mds)...") {
  443. praat_Dissimilarity_to_Configuration_commonFields (tolerance,maximumNumberOfIterations,numberOfRepetitions)
  444. OK
  445. DO
  446. CONVERT_TWO (Dissimilarity, Configuration)
  447. bool showProgress = true;
  448. autoConfiguration result = Dissimilarity_Configuration_Weight_ratio_mds (me, you, nullptr, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgress);
  449. CONVERT_TWO_END (my name.get(), U"_ratio");
  450. }
  451. FORM (NEW1_Dissimilarity_Configuration_interval_mds, U"Dissimilarity & Configuration: To Configuration (interval mds)", U"Dissimilarity & Configuration: To Configuration (interval mds)...") {
  452. praat_Dissimilarity_to_Configuration_commonFields (tolerance,maximumNumberOfIterations,numberOfRepetitions)
  453. OK
  454. DO
  455. CONVERT_TWO (Dissimilarity, Configuration)
  456. bool showProgress = true;
  457. autoConfiguration result = Dissimilarity_Configuration_Weight_interval_mds (me, you, nullptr, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgress);
  458. CONVERT_TWO_END (my name.get(), U"_interval");
  459. }
  460. FORM (NEW1_Dissimilarity_Configuration_monotone_mds, U"Dissimilarity & Configuration: To Configuration (monotone mds)", U"Dissimilarity & Configuration: To Configuration (monotone mds)...") {
  461. RADIO (tiesHandling, U"Handling of ties", 1)
  462. RADIOBUTTON (U"Primary approach")
  463. RADIOBUTTON (U"Secondary approach")
  464. praat_Dissimilarity_to_Configuration_commonFields (tolerance,maximumNumberOfIterations,numberOfRepetitions)
  465. OK
  466. DO
  467. CONVERT_TWO (Dissimilarity, Configuration)
  468. bool showProgress = true;
  469. autoConfiguration result = Dissimilarity_Configuration_Weight_monotone_mds (me, you, nullptr, tiesHandling, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgress);
  470. CONVERT_TWO_END (my name.get(), U"_monotone");
  471. }
  472. FORM (NEW1_Dissimilarity_Configuration_ispline_mds, U"Dissimilarity & Configuration: To Configuration (i-spline mds)", U"Dissimilarity & Configuration: To Configuration (i-spline mds)...") {
  473. LABEL (U"Spline smoothing")
  474. INTEGER (numberOfInteriorKnots, U"Number of interior knots", U"1")
  475. INTEGER (order, U"Order of I-spline", U"1")
  476. praat_Dissimilarity_to_Configuration_commonFields (tolerance,maximumNumberOfIterations,numberOfRepetitions)
  477. OK
  478. DO
  479. CONVERT_TWO (Dissimilarity, Configuration)
  480. bool showProgress = true;
  481. autoConfiguration result = Dissimilarity_Configuration_Weight_ispline_mds (me, you, nullptr, numberOfInteriorKnots, order, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgress);
  482. CONVERT_TWO_END (my name.get(), U"_ispline");
  483. }
  484. FORM (NEW1_Dissimilarity_Configuration_Weight_absolute_mds, U"Dissimilarity & Configuration & Weight: To Configuration (absolute mds)", U"Dissimilarity & Configuration & Weight: To Configuration...") {
  485. praat_Dissimilarity_to_Configuration_commonFields (tolerance,maximumNumberOfIterations,numberOfRepetitions)
  486. OK
  487. DO
  488. CONVERT_THREE (Dissimilarity, Configuration, Weight)
  489. bool showProgress = true;
  490. autoConfiguration result = Dissimilarity_Configuration_Weight_absolute_mds (me, you, him, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgress);
  491. CONVERT_THREE_END (my name.get(), U"_w_absolute")
  492. }
  493. FORM (NEW1_Dissimilarity_Configuration_Weight_ratio_mds, U"Dissimilarity & Configuration & Weight: To Configuration (ratio mds)", U"Dissimilarity & Configuration & Weight: To Configuration...") {
  494. praat_Dissimilarity_to_Configuration_commonFields (tolerance,maximumNumberOfIterations,numberOfRepetitions)
  495. OK
  496. DO
  497. CONVERT_THREE (Dissimilarity, Configuration, Weight)
  498. bool showProgress = true;
  499. autoConfiguration result = Dissimilarity_Configuration_Weight_ratio_mds (me, you, him, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgress);
  500. CONVERT_THREE_END (my name.get(), U"_w_ratio");
  501. }
  502. FORM (NEW1_Dissimilarity_Configuration_Weight_interval_mds, U"Dissimilarity & Configuration & Weight: To Configuration (interval mds)", U"Dissimilarity & Configuration & Weight: To Configuration...") {
  503. praat_Dissimilarity_to_Configuration_commonFields (tolerance,maximumNumberOfIterations,numberOfRepetitions)
  504. OK
  505. DO
  506. CONVERT_THREE (Dissimilarity, Configuration, Weight)
  507. bool showProgress = true;
  508. autoConfiguration result = Dissimilarity_Configuration_Weight_interval_mds (me, you, him, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgress);
  509. CONVERT_THREE_END (my name.get(), U"_w_interval")
  510. }
  511. FORM (NEW1_Dissimilarity_Configuration_Weight_monotone_mds, U"Dissimilarity & Configuration & Weight: To Configuration (monotone mds)", U"Dissimilarity & Configuration & Weight: To Configuration...") {
  512. RADIO (tiesHandling, U"Handling of ties", 1)
  513. RADIOBUTTON (U"Primary approach")
  514. RADIOBUTTON (U"Secondary approach")
  515. praat_Dissimilarity_to_Configuration_commonFields (tolerance,maximumNumberOfIterations,numberOfRepetitions)
  516. OK
  517. DO
  518. CONVERT_THREE (Dissimilarity, Configuration, Weight)
  519. bool showProgress = true;
  520. autoConfiguration result = Dissimilarity_Configuration_Weight_monotone_mds (me, you, him, tiesHandling, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgress);
  521. CONVERT_THREE_END (my name.get(), U"_sw_monotone")
  522. }
  523. FORM (NEW1_Dissimilarity_Configuration_Weight_ispline_mds, U"Dissimilarity & Configuration & Weight: To Configuration (i-spline mds)", U"Dissimilarity & Configuration & Weight: To Configuration...") {
  524. LABEL (U"Spline smoothing")
  525. INTEGER (numberOfInteriorKnots, U"Number of interior knots", U"1")
  526. INTEGER (order, U"Order of I-spline", U"1")
  527. praat_Dissimilarity_to_Configuration_commonFields (tolerance,maximumNumberOfIterations,numberOfRepetitions)
  528. OK
  529. DO
  530. CONVERT_THREE (Dissimilarity, Configuration, Weight)
  531. bool showProgress = true;
  532. autoConfiguration result = Dissimilarity_Configuration_Weight_ispline_mds (me, you, him, numberOfInteriorKnots, order, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgress);
  533. CONVERT_THREE_END (my name.get(), U"_sw_ispline");
  534. }
  535. FORM (REAL_Dissimilarity_Configuration_getStress, U"Dissimilarity & Configuration: Get stress", U"Dissimilarity & Configuration: get stress") {
  536. RADIO (tiesHandling, U"Handling of ties", 1)
  537. RADIOBUTTON (U"Primary approach")
  538. RADIOBUTTON (U"Secondary approach")
  539. RADIO (stressFormula, U"Stress calculation", 1)
  540. RADIOBUTTON (U"Formula1")
  541. RADIOBUTTON (U"Formula2")
  542. OK
  543. DO
  544. NUMBER_TWO (Dissimilarity, Configuration)
  545. double result = Dissimilarity_Configuration_getStress (me, you, tiesHandling, stressFormula);
  546. NUMBER_TWO_END (U" (stress)")
  547. }
  548. FORM (REAL_Dissimilarity_Configuration_absolute_stress, U"Dissimilarity & Configuration: Get stress (absolute mds)", U"Dissimilarity & Configuration: Get stress (absolute mds)...") {
  549. Dissimilarity_Configuration_getStress_addCommonFields (stressMeasure);
  550. OK
  551. DO
  552. NUMBER_TWO (Dissimilarity, Configuration)
  553. double result = Dissimilarity_Configuration_Weight_absolute_stress (me, you, nullptr,stressMeasure);
  554. NUMBER_TWO_END (U" (absolute mds stress)")
  555. }
  556. FORM (REAL_Dissimilarity_Configuration_ratio_stress, U"Dissimilarity & Configuration: Get stress (ratio mds)", U"Dissimilarity & Configuration: Get stress (ratio mds)...") {
  557. Dissimilarity_Configuration_getStress_addCommonFields (stressMeasure);
  558. OK
  559. DO
  560. NUMBER_TWO (Dissimilarity, Configuration)
  561. double result = Dissimilarity_Configuration_Weight_ratio_stress (me, you, nullptr, stressMeasure);
  562. NUMBER_TWO_END (U" (ratio mds stress)")
  563. }
  564. FORM (REAL_Dissimilarity_Configuration_interval_stress, U"Dissimilarity & Configuration: Get stress (interval mds)", U"Dissimilarity & Configuration: Get stress (interval mds)...") {
  565. Dissimilarity_Configuration_getStress_addCommonFields (stressMeasure);
  566. OK
  567. DO
  568. NUMBER_TWO (Dissimilarity, Configuration)
  569. double result = Dissimilarity_Configuration_Weight_interval_stress (me, you, nullptr, stressMeasure);
  570. NUMBER_TWO_END (U" (interval mds stress)")
  571. }
  572. FORM (REAL_Dissimilarity_Configuration_monotone_stress, U"Dissimilarity & Configuration: Get stress (monotone mds)", U"Dissimilarity & Configuration: Get stress (monotone mds)...") {
  573. RADIO (tiesHandling, U"Handling of ties", 1)
  574. RADIOBUTTON (U"Primary approach")
  575. RADIOBUTTON (U"Secondary approach")
  576. Dissimilarity_Configuration_getStress_addCommonFields (stressMeasure);
  577. OK
  578. DO
  579. NUMBER_TWO (Dissimilarity, Configuration)
  580. double result = Dissimilarity_Configuration_Weight_monotone_stress (me, you, nullptr, tiesHandling,stressMeasure);
  581. NUMBER_TWO_END (U" (monotone mds stress)")
  582. }
  583. FORM (REAL_Dissimilarity_Configuration_ispline_stress, U"Dissimilarity & Configuration: Get stress (i-spline mds)", U"Dissimilarity & Configuration: Get stress (i-spline mds)...") {
  584. INTEGER (numberOfInteriorKnots, U"Number of interior knots", U"1")
  585. INTEGER (order, U"Order of I-spline", U"3")
  586. Dissimilarity_Configuration_getStress_addCommonFields (stressMeasure);
  587. OK
  588. DO
  589. NUMBER_TWO (Dissimilarity, Configuration)
  590. double result = Dissimilarity_Configuration_Weight_ispline_stress (me, you, nullptr, numberOfInteriorKnots, order, stressMeasure);
  591. NUMBER_TWO_END (U" (i-spline mds stress)")
  592. }
  593. FORM (REAL_Dissimilarity_Configuration_Weight_absolute_stress, U"Dissimilarity & Configuration & Weight: Get stress (absolute mds)", U"Dissimilarity & Configuration & Weight: Get stress (absolute mds)...") {
  594. Dissimilarity_Configuration_getStress_addCommonFields (stressMeasure);
  595. OK
  596. DO
  597. NUMBER_THREE (Dissimilarity, Configuration, Weight)
  598. double result = Dissimilarity_Configuration_Weight_absolute_stress (me, you, him, stressMeasure);
  599. NUMBER_THREE_END (U" (absolute mds stress)")
  600. }
  601. FORM (REAL_Dissimilarity_Configuration_Weight_ratio_stress, U"Dissimilarity & Configuration & Weight: Get stress (ratio mds)", U"Dissimilarity & Configuration & Weight: Get stress (ratio mds)...") {
  602. Dissimilarity_Configuration_getStress_addCommonFields (stressMeasure);
  603. OK
  604. DO
  605. NUMBER_THREE (Dissimilarity, Configuration, Weight)
  606. double result = Dissimilarity_Configuration_Weight_ratio_stress (me, you, him, stressMeasure);
  607. NUMBER_THREE_END (U" (ratio mds stress)")
  608. }
  609. FORM (REAL_Dissimilarity_Configuration_Weight_interval_stress, U"Dissimilarity & Configuration & Weight: Get stress (interval mds)", U"Dissimilarity & Configuration & Weight: Get stress (interval mds)...") {
  610. Dissimilarity_Configuration_getStress_addCommonFields (stressMeasure);
  611. OK
  612. DO
  613. NUMBER_THREE (Dissimilarity, Configuration, Weight)
  614. double result = Dissimilarity_Configuration_Weight_interval_stress (me, you, him, stressMeasure);
  615. NUMBER_THREE_END (U" (interval mds stress)")
  616. }
  617. FORM (REAL_Dissimilarity_Configuration_Weight_monotone_stress, U"Dissimilarity & Configuration & Weight: Get stress (monotone mds)", U"Dissimilarity & Configuration & Weight: Get stress (monotone mds)...") {
  618. RADIO (tiesHandling, U"Handling of ties", 1)
  619. RADIOBUTTON (U"Primary approach)")
  620. RADIOBUTTON (U"Secondary approach")
  621. Dissimilarity_Configuration_getStress_addCommonFields (stressMeasure);
  622. OK
  623. DO
  624. NUMBER_THREE (Dissimilarity, Configuration, Weight)
  625. double result = Dissimilarity_Configuration_Weight_monotone_stress (me, you, him, tiesHandling, stressMeasure);
  626. NUMBER_THREE_END (U" (monotone mds stress)")
  627. }
  628. FORM (REAL_Dissimilarity_Configuration_Weight_ispline_stress, U"Dissimilarity & Configuration & Weight: Get stress (i-spline mds)", U"Dissimilarity & Configuration & Weight: Get stress (i-spline mds)...") {
  629. INTEGER (numberOfInteriorKnots, U"Number of interior knots", U"1")
  630. INTEGER (order, U"Order of I-spline", U"3")
  631. Dissimilarity_Configuration_getStress_addCommonFields (stressMeasure);
  632. OK
  633. DO
  634. NUMBER_THREE (Dissimilarity, Configuration, Weight)
  635. double result = Dissimilarity_Configuration_Weight_ispline_stress (me, you, him, numberOfInteriorKnots, order, stressMeasure);
  636. NUMBER_THREE_END (U" (i-spline mds stress)")
  637. }
  638. FORM (GRAPHICS_Dissimilarity_Configuration_drawShepardDiagram, U"Dissimilarity & Configuration: Draw Shepard diagram", U"Dissimilarity & Configuration: Draw Shepard diagram...") {
  639. praat_Dissimilarity_Configuration_drawing_commonFields(fromProximity,toProximity,fromDistance,toDistance,markSize,markString,garnish) OK
  640. DO
  641. GRAPHICS_TWO (Dissimilarity, Configuration)
  642. Dissimilarity_Configuration_drawShepardDiagram (me, you, GRAPHICS, fromProximity, toProximity, fromDistance, toDistance, markSize, markString, garnish);
  643. GRAPHICS_TWO_END
  644. }
  645. FORM (GRAPHICS_Dissimilarity_Configuration_drawAbsoluteRegression, U"Dissimilarity & Configuration: Draw regression (absolute mds)", U"Dissimilarity & Configuration: Draw regression (absolute mds)...") {
  646. praat_Dissimilarity_Configuration_drawing_commonFields(fromProximity,toProximity,fromDistance,toDistance,markSize,markString,garnish) OK
  647. DO
  648. GRAPHICS_TWO (Dissimilarity, Configuration)
  649. Dissimilarity_Configuration_Weight_drawAbsoluteRegression (me, you, nullptr, GRAPHICS, fromProximity, toProximity, fromDistance, toDistance, markSize, markString, garnish);
  650. GRAPHICS_TWO_END
  651. }
  652. FORM (GRAPHICS_Dissimilarity_Configuration_drawRatioRegression, U"Dissimilarity & Configuration: Draw regression (ratio mds)", U"Dissimilarity & Configuration: Draw regression (ratio mds)...") {
  653. praat_Dissimilarity_Configuration_drawing_commonFields(fromProximity,toProximity,fromDistance,toDistance,markSize,markString,garnish) OK
  654. DO
  655. GRAPHICS_TWO (Dissimilarity, Configuration)
  656. Dissimilarity_Configuration_Weight_drawRatioRegression (me, you, nullptr, GRAPHICS, fromProximity, toProximity, fromDistance, toDistance, markSize, markString, garnish);
  657. GRAPHICS_TWO_END
  658. }
  659. FORM (GRAPHICS_Dissimilarity_Configuration_drawIntervalRegression, U"Dissimilarity & Configuration: Draw regression (interval mds)", U"Dissimilarity & Configuration: Draw regression (interval mds)...") {
  660. praat_Dissimilarity_Configuration_drawing_commonFields(fromProximity,toProximity,fromDistance,toDistance,markSize,markString,garnish) OK
  661. DO
  662. GRAPHICS_TWO (Dissimilarity, Configuration)
  663. Dissimilarity_Configuration_Weight_drawIntervalRegression (me, you, nullptr, GRAPHICS, fromProximity, toProximity, fromDistance, toDistance, markSize, markString, garnish);
  664. GRAPHICS_TWO_END
  665. }
  666. FORM (GRAPHICS_Dissimilarity_Configuration_drawMonotoneRegression, U"Dissimilarity & Configuration: Draw regression (monotone mds)", U"Dissimilarity & Configuration: Draw regression (monotone mds)...") {
  667. RADIO (tiesHandling, U"Handling of ties", 1)
  668. RADIOBUTTON (U"Primary approach)")
  669. RADIOBUTTON (U"Secondary approach")
  670. praat_Dissimilarity_Configuration_drawing_commonFields(fromProximity,toProximity,fromDistance,toDistance,markSize,markString,garnish) OK
  671. DO
  672. GRAPHICS_TWO (Dissimilarity, Configuration)
  673. Dissimilarity_Configuration_Weight_drawMonotoneRegression (me, you, nullptr, GRAPHICS, tiesHandling, fromProximity, toProximity, fromDistance, toDistance, markSize, markString, garnish);
  674. GRAPHICS_TWO_END
  675. }
  676. FORM (GRAPHICS_Dissimilarity_Configuration_drawISplineRegression, U"Dissimilarity & Configuration: Draw regression (i-spline mds)", U"Dissimilarity & Configuration: Draw regression (i-spline mds)...") {
  677. INTEGER (numberOfInteriorKnots, U"Number of interior knots", U"1")
  678. INTEGER (order, U"Order of I-spline", U"3")
  679. praat_Dissimilarity_Configuration_drawing_commonFields(fromProximity,toProximity,fromDistance,toDistance,markSize,markString,garnish) OK
  680. DO
  681. GRAPHICS_TWO (Dissimilarity, Configuration)
  682. Dissimilarity_Configuration_Weight_drawISplineRegression (me, you, nullptr, GRAPHICS, numberOfInteriorKnots, order,fromProximity, toProximity, fromDistance, toDistance, markSize, markString, garnish);
  683. GRAPHICS_TWO_END
  684. }
  685. FORM (NEW_Dissimilarity_to_Configuration_kruskal, U"Dissimilarity: To Configuration (kruskal)", U"Dissimilarity: To Configuration (kruskal)...") {
  686. LABEL (U"Configuration")
  687. NATURAL (numberOfDimensions, U"Number of dimensions", U"2")
  688. NATURAL (distanceMetric, U"Distance metric", U"2 (= Euclidean)")
  689. RADIO (tiesHandling, U"Handling of ties", 1)
  690. RADIOBUTTON (U"Primary approach")
  691. RADIOBUTTON (U"Secondary approach")
  692. RADIO (stressFormula, U"Stress calculation", 1)
  693. RADIOBUTTON (U"Formula1")
  694. RADIOBUTTON (U"Formula2")
  695. praat_Dissimilarity_to_Configuration_commonFields(tolerance,maximumNumberOfIterations,numberOfRepetitions)
  696. OK
  697. DO
  698. CONVERT_EACH (Dissimilarity)
  699. autoConfiguration result = Dissimilarity_to_Configuration_kruskal (me, numberOfDimensions, distanceMetric, tiesHandling, stressFormula, tolerance, maximumNumberOfIterations, numberOfRepetitions);
  700. CONVERT_EACH_END (my name.get())
  701. }
  702. FORM (NEW_Dissimilarity_to_Configuration_absolute_mds, U"Dissimilarity: To Configuration (absolute mds)", U"Dissimilarity: To Configuration (absolute mds)...") {
  703. LABEL (U"Configuration")
  704. NATURAL (numberOfDimensions, U"Number of dimensions", U"2")
  705. praat_Dissimilarity_to_Configuration_commonFields(tolerance,maximumNumberOfIterations,numberOfRepetitions)
  706. OK
  707. DO
  708. CONVERT_EACH (Dissimilarity)
  709. int showProgress = 1;
  710. autoConfiguration result = Dissimilarity_Weight_absolute_mds (me, nullptr, numberOfDimensions, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgress);
  711. CONVERT_EACH_END (my name.get(), U"_absolute")
  712. }
  713. FORM (NEW_Dissimilarity_to_Configuration_ratio_mds, U"Dissimilarity: To Configuration (ratio mds)", U"Dissimilarity: To Configuration (ratio mds)...") {
  714. LABEL (U"Configuration")
  715. NATURAL (numberOfDimensions, U"Number of dimensions", U"2")
  716. praat_Dissimilarity_to_Configuration_commonFields(tolerance,maximumNumberOfIterations,numberOfRepetitions)
  717. OK
  718. DO
  719. CONVERT_EACH (Dissimilarity)
  720. int showProgress = 1;
  721. autoConfiguration result = Dissimilarity_Weight_ratio_mds (me, nullptr, numberOfDimensions, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgress);
  722. CONVERT_EACH_END (my name.get(), U"_ratio")
  723. }
  724. FORM (NEW_Dissimilarity_to_Configuration_interval_mds, U"Dissimilarity: To Configuration (interval mds)", U"Dissimilarity: To Configuration (interval mds)...") {
  725. LABEL (U"Configuration")
  726. NATURAL (numberOfDimensions, U"Number of dimensions", U"2")
  727. praat_Dissimilarity_to_Configuration_commonFields(tolerance,maximumNumberOfIterations,numberOfRepetitions)
  728. OK
  729. DO
  730. CONVERT_EACH (Dissimilarity)
  731. int showProgress = 1;
  732. autoConfiguration result = Dissimilarity_Weight_interval_mds (me, nullptr, numberOfDimensions, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgress);
  733. CONVERT_EACH_END (my name.get(), U"_interval")
  734. }
  735. FORM (NEW_Dissimilarity_to_Configuration_monotone_mds, U"Dissimilarity: To Configuration (monotone mds)", U"Dissimilarity: To Configuration (monotone mds)...") {
  736. LABEL (U"Configuration")
  737. NATURAL (numberOfDimensions, U"Number of dimensions", U"2")
  738. RADIO (tiesHandling, U"Handling of ties", 1)
  739. RADIOBUTTON (U"Primary approach")
  740. RADIOBUTTON (U"Secondary approach")
  741. praat_Dissimilarity_to_Configuration_commonFields (tolerance, maximumNumberOfIterations, numberOfRepetitions)
  742. OK
  743. DO
  744. CONVERT_EACH (Dissimilarity)
  745. int showProgress = 1;
  746. autoConfiguration result = Dissimilarity_Weight_monotone_mds (me, nullptr, numberOfDimensions, tiesHandling, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgress);
  747. CONVERT_EACH_END (my name.get(), U"_monotone");
  748. }
  749. FORM (NEW_Dissimilarity_to_Configuration_ispline_mds, U"Dissimilarity: To Configuration (i-spline mds)", U"Dissimilarity: To Configuration (i-spline mds)...") {
  750. LABEL (U"Configuration")
  751. NATURAL (numberOfDimensions, U"Number of dimensions", U"2")
  752. LABEL (U"Spline smoothing")
  753. INTEGER (numberOfInteriorKnots, U"Number of interior knots", U"1")
  754. INTEGER (order, U"Order of I-spline", U"1")
  755. praat_Dissimilarity_to_Configuration_commonFields(tolerance,maximumNumberOfIterations,numberOfRepetitions)
  756. OK
  757. DO
  758. if (not (order > 0 || numberOfInteriorKnots > 0)) {
  759. Melder_throw (U"Order-zero spline must at least have 1 interior knot.");
  760. }
  761. CONVERT_EACH (Dissimilarity)
  762. int showProgress = 1;
  763. autoConfiguration result = Dissimilarity_Weight_ispline_mds (me, nullptr, numberOfDimensions, numberOfInteriorKnots, order, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgress);
  764. CONVERT_EACH_END (my name.get(), U"_ispline");
  765. }
  766. FORM (NEW1_Dissimilarity_Weight_ispline_mds, U"Dissimilarity & Weight: To Configuration (i-spline mds)", U"Dissimilarity & Weight: To Configuration (i-spline mds)...") {
  767. LABEL (U"Configuration")
  768. NATURAL (numberOfDimensions, U"Number of dimensions", U"2")
  769. LABEL (U"Spline smoothing")
  770. INTEGER (numberOfInteriorKnots, U"Number of interior knots", U"1")
  771. INTEGER (order, U"Order of I-spline", U"1")
  772. praat_Dissimilarity_to_Configuration_commonFields(tolerance,maximumNumberOfIterations,numberOfRepetitions)
  773. OK
  774. DO
  775. CONVERT_TWO (Dissimilarity, Weight)
  776. int showProgress = 1;
  777. if (not (order > 0 || numberOfInteriorKnots > 0)) {
  778. Melder_throw (U"Order-zero spline must at least have 1 interior knot.");
  779. }
  780. autoConfiguration result = Dissimilarity_Weight_ispline_mds (me, you, numberOfDimensions, numberOfInteriorKnots, order, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgress);
  781. CONVERT_TWO_END (my name.get(), U"_ispline")
  782. }
  783. FORM (NEW1_Dissimilarity_Weight_absolute_mds, U"Dissimilarity & Weight: To Configuration (absolute mds)", U"Dissimilarity & Weight: To Configuration (absolute mds)...") {
  784. LABEL (U"Configuration")
  785. NATURAL (numberOfDimensions, U"Number of dimensions", U"2")
  786. praat_Dissimilarity_to_Configuration_commonFields(tolerance,maximumNumberOfIterations,numberOfRepetitions)
  787. OK
  788. DO
  789. CONVERT_TWO (Dissimilarity, Weight)
  790. int showProgress = 1;
  791. autoConfiguration result = Dissimilarity_Weight_absolute_mds (me, you, numberOfDimensions, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgress);
  792. CONVERT_TWO_END (my name.get(), U"_absolute")
  793. }
  794. FORM (NEW1_Dissimilarity_Weight_ratio_mds, U"Dissimilarity & Weight: To Configuration (ratio mds)", U"Dissimilarity & Weight: To Configuration (ratio mds)...") {
  795. LABEL (U"Configuration")
  796. NATURAL (numberOfDimensions, U"Number of dimensions", U"2")
  797. praat_Dissimilarity_to_Configuration_commonFields(tolerance,maximumNumberOfIterations,numberOfRepetitions)
  798. OK
  799. DO
  800. CONVERT_TWO (Dissimilarity, Weight)
  801. int showProgress = 1;
  802. autoConfiguration result = Dissimilarity_Weight_ratio_mds (me, you, numberOfDimensions, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgress);
  803. CONVERT_TWO_END (my name.get(), U"_absolute")
  804. }
  805. FORM (NEW1_Dissimilarity_Weight_interval_mds, U"Dissimilarity & Weight: To Configuration (interval mds)", U"Dissimilarity & Weight: To Configuration (interval mds)...") {
  806. LABEL (U"Configuration")
  807. NATURAL (numberOfDimensions, U"Number of dimensions", U"2")
  808. praat_Dissimilarity_to_Configuration_commonFields(tolerance,maximumNumberOfIterations,numberOfRepetitions)
  809. OK
  810. DO
  811. CONVERT_TWO (Dissimilarity, Weight)
  812. int showProgress = 1;
  813. autoConfiguration result = Dissimilarity_Weight_interval_mds (me, you, numberOfDimensions, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgress);
  814. CONVERT_TWO_END (my name.get(), U"_absolute")
  815. }
  816. FORM (NEW1_Dissimilarity_Weight_monotone_mds, U"Dissimilarity & Weight: To Configuration (monotone mds)", U"Dissimilarity & Weight: To Configuration (monotone mds)...") {
  817. LABEL (U"Configuration")
  818. NATURAL (numberOfDimensions, U"Number of dimensions", U"2")
  819. RADIO (tiesHandling, U"Handling of ties", 1)
  820. RADIOBUTTON (U"Primary approach")
  821. RADIOBUTTON (U"Secondary approach")
  822. praat_Dissimilarity_to_Configuration_commonFields(tolerance,maximumNumberOfIterations,numberOfRepetitions)
  823. OK
  824. DO
  825. CONVERT_TWO (Dissimilarity, Weight)
  826. int showProgress = 1;
  827. autoConfiguration result = Dissimilarity_Weight_monotone_mds (me, you, numberOfDimensions, tiesHandling, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgress);
  828. CONVERT_TWO_END (my name.get(), U"_monotone")
  829. }
  830. FORM (NEW_Dissimilarity_to_Distance, U"Dissimilarity: To Distance", U"Dissimilarity: To Distance...") {
  831. BOOLEAN (scale, U"Scale (additive constant)", true)
  832. OK
  833. DO
  834. CONVERT_EACH (Dissimilarity)
  835. autoDistance result = Dissimilarity_to_Distance (me, scale ? kMDS_AnalysisScale::Ordinal : kMDS_AnalysisScale::Absolute);
  836. CONVERT_EACH_END (my name.get())
  837. }
  838. DIRECT (NEW_Dissimilarity_to_Weight) {
  839. CONVERT_EACH (Dissimilarity)
  840. autoWeight result = Dissimilarity_to_Weight (me);
  841. CONVERT_EACH_END (my name.get())
  842. }
  843. DIRECT (NEW_Dissimilarity_to_MDSVec) {
  844. CONVERT_EACH (Dissimilarity)
  845. autoMDSVec result = Dissimilarity_to_MDSVec (me);
  846. CONVERT_EACH_END (my name.get())
  847. }
  848. /************************* Distance(s) ***************************************/
  849. FORM (NEW_Distance_to_ScalarProduct, U"Distance: To ScalarProduct", U"Distance: To ScalarProduct...") {
  850. BOOLEAN (scaleSumOfSquares, U"Make sum of squares equal 1.0", true)
  851. OK
  852. DO
  853. CONVERT_EACH (Distance)
  854. autoScalarProduct result = Distance_to_ScalarProduct (me, scaleSumOfSquares);
  855. CONVERT_EACH_END (my name.get())
  856. }
  857. DIRECT (NEW_Distance_to_Dissimilarity) {
  858. CONVERT_EACH (Distance)
  859. autoDissimilarity result = Distance_to_Dissimilarity (me);
  860. CONVERT_EACH_END (my name.get())
  861. }
  862. FORM (NEWMANY_old_Distances_to_Configuration_indscal, U"Distance: To Configuration (indscal)", U"Distance: To Configuration (indscal)...") {
  863. NATURAL (numberOfDimensions, U"Number of dimensions", U"2")
  864. BOOLEAN (normalizeScalarProducts, U"Normalize scalar products", true)
  865. LABEL (U"Minimization parameters")
  866. REAL (tolerance, U"Tolerance", U"1e-5")
  867. NATURAL (maximumNumberOfIterations, U"Maximum number of iterations", U"100 (= each repetition)")
  868. NATURAL (numberOfRepetitions, U"Number of repetitions", U"1")
  869. OK
  870. DO
  871. FIND_LIST (Distance)
  872. autoConfiguration configurationResult;
  873. autoSalience salienceResult;
  874. DistanceList_to_Configuration_indscal ((DistanceList) & list, numberOfDimensions, normalizeScalarProducts, tolerance, maximumNumberOfIterations, numberOfRepetitions,true /* showProgress */, & configurationResult, & salienceResult);
  875. praat_new (configurationResult.move(), U"indscal");
  876. praat_new (salienceResult.move(), U"indscal");
  877. END
  878. }
  879. FORM (NEWMANY_Distances_to_Configuration_indscal, U"Distance: To Configuration (indscal)", U"Distance: To Configuration (indscal)...") {
  880. NATURAL (numberOfDimensions, U"Number of dimensions", U"2")
  881. BOOLEAN (normalizeScalarProducts, U"Normalize scalar products", true)
  882. LABEL (U"Minimization parameters")
  883. REAL (tolerance, U"Tolerance", U"1e-5")
  884. NATURAL (maximumNumberOfIterations, U"Maximum number of iterations", U"100 (= each repetition)")
  885. NATURAL (numberOfRepetitions, U"Number of repetitions", U"1")
  886. BOOLEAN (wantSalience, U"Want Salience", true)
  887. BOOLEAN (showProgressInfo, U"Show progress info", false)
  888. OK
  889. DO_ALTERNATIVE (NEWMANY_old_Distances_to_Configuration_indscal)
  890. FIND_LIST (Distance)
  891. autoConfiguration configurationResult;
  892. autoSalience salienceResult;
  893. DistanceList_to_Configuration_indscal ((DistanceList) & list, numberOfDimensions, normalizeScalarProducts, tolerance, maximumNumberOfIterations, numberOfRepetitions, showProgressInfo, & configurationResult, (wantSalience ? & salienceResult: nullptr));
  894. praat_new (configurationResult.move(), U"indscal");
  895. if (wantSalience) {
  896. praat_new (salienceResult.move(), U"indscal");
  897. }
  898. END
  899. }
  900. FORM (GRAPHICS_Distance_Configuration_drawScatterDiagram, U"Distance & Configuration: Draw scatter diagram", U"Distance & Configuration: Draw scatter diagram...") {
  901. REAL (xmin, U"Minimum x-distance", U"0.0")
  902. REAL (xmax, U"Maximum x-distance", U"0.0")
  903. REAL (ymin, U"Minimum y-distance", U"0.0")
  904. REAL (ymax, U"Maximum y-distance", U"0.0")
  905. POSITIVE (markSize, U"Mark size (mm)", U"1.0")
  906. SENTENCE (markString, U"Mark string (+xo.)", U"+")
  907. BOOLEAN (garnish, U"Garnish", true)
  908. OK
  909. DO
  910. GRAPHICS_TWO (Distance, Configuration)
  911. Distance_Configuration_drawScatterDiagram (me, you, GRAPHICS, xmin, xmax, ymin, ymax, markSize, markString, garnish);
  912. GRAPHICS_TWO_END
  913. }
  914. FORM (NEWMANY_Distance_Configuration_indscal, U"Distance & Configuration: To Configuration (indscal)", U"Distance & Configuration: To Configuration (indscal)...") {
  915. BOOLEAN (normalizeScalarProducts, U"Normalize scalar products", true)
  916. LABEL (U"Minimization parameters")
  917. REAL (tolerance, U"Tolerance", U"1e-5")
  918. NATURAL (maximumNumberOfIterations, U"Maximum number of iterations", U"100 (= each repetition)")
  919. OK
  920. DO
  921. FIND_ONE_AND_LIST (Configuration, Distance)
  922. autoConfiguration configurationResult;
  923. autoSalience salienceResult;
  924. DistanceList_Configuration_indscal ((DistanceList) & list, me, normalizeScalarProducts, tolerance, maximumNumberOfIterations, true, & configurationResult, & salienceResult);
  925. praat_new (configurationResult.move(), U"indscal");
  926. praat_new (salienceResult.move(), U"indscal");
  927. END
  928. }
  929. FORM (REAL_Distance_Configuration_vaf, U"Distance & Configuration: Get VAF", U"Distance & Configuration: Get VAF...") {
  930. BOOLEAN (normalizeScalarProducts, U"Normalize scalar products", true)
  931. OK
  932. DO
  933. NUMBER_ONE_AND_LIST (Configuration, Distance)
  934. double result;
  935. DistanceList_Configuration_vaf ((DistanceList) & list, me, normalizeScalarProducts, & result);
  936. NUMBER_ONE_AND_LIST_END (U" (variance accounted for)")
  937. }
  938. FORM (REAL_Distance_Configuration_Salience_vaf, U"Distance & Configuration & Salience: Get VAF", U"Distance & Configuration & Salience: Get VAF...") {
  939. BOOLEAN (normalizeScalarProducts, U"Normalize scalar products", true)
  940. OK
  941. DO
  942. NUMBER_TWO_AND_LIST (Configuration, Salience, Distance)
  943. double result;
  944. DistanceList_Configuration_Salience_vaf ((DistanceList) & list, me, you, normalizeScalarProducts, & result);
  945. NUMBER_TWO_AND_LIST_END (U" (variance accounted for)")
  946. }
  947. FORM (REAL_Dissimilarity_Configuration_Salience_vaf, U"Dissimilarity & Configuration & Salience: Get VAF", U"Dissimilarity & Configuration & Salience: Get VAF...") {
  948. RADIO (tiesHandling, U"Handling of ties", 1)
  949. RADIOBUTTON (U"Primary approach")
  950. RADIOBUTTON (U"Secondary approach")
  951. BOOLEAN (normalizeScalarProducts, U"Normalize scalar products", true)
  952. OK
  953. DO
  954. NUMBER_TWO_AND_LIST (Configuration, Salience, Dissimilarity)
  955. double result;
  956. DissimilarityList_Configuration_Salience_vaf ((DissimilarityList) & list, me, you ,tiesHandling, normalizeScalarProducts, & result);
  957. NUMBER_TWO_AND_LIST_END (U" (variance accounted for)");
  958. }
  959. FORM (NEWMANY_Distance_Configuration_Salience_indscal, U"Distance & Configuration & Salience: To Configuration (indscal)", U"Distance & Configuration & Salience: To Configuration (indscal)...") {
  960. BOOLEAN (normalizeScalarProducts, U"Normalize scalar products", true)
  961. LABEL (U"Minimization parameters")
  962. REAL (tolerance, U"Tolerance", U"1e-5")
  963. NATURAL (maximumNumberOfIterations, U"Maximum number of iterations", U"100")
  964. OK
  965. DO
  966. FIND_TWO_AND_LIST (Configuration, Salience, Distance)
  967. autoConfiguration configurationResult;
  968. autoSalience salienceResult;
  969. DistanceList_Configuration_Salience_indscal ((DistanceList) & list, me, you, normalizeScalarProducts, tolerance, maximumNumberOfIterations, true, & configurationResult, & salienceResult, nullptr);
  970. praat_new (configurationResult.move(), U"indscal");
  971. praat_new (salienceResult.move(), U"indscal");
  972. END
  973. }
  974. FORM (NEWMANY_Distances_to_Configuration_ytl, U"Distance: To Configuration (ytl)", U"Distance: To Configuration (ytl)...") {
  975. NATURAL (numberOfDimensions, U"Number of dimensions", U"2")
  976. BOOLEAN (normalizeScalarProducts, U"Normalize scalar products", true)
  977. BOOLEAN (wantSalienceObject, U"Salience object", false)
  978. OK
  979. DO
  980. FIND_LIST (Distance)
  981. autoConfiguration configurationResult;
  982. autoSalience salienceResult;
  983. Melder_require (list.size > 1, U"There should me more than one Distance selected.");
  984. DistanceList_to_Configuration_ytl ((DistanceList) & list, numberOfDimensions, normalizeScalarProducts, & configurationResult, & salienceResult);
  985. praat_new (configurationResult.move(), U"ytl");
  986. if (wantSalienceObject) {
  987. praat_new (salienceResult.move(), U"ytl");
  988. }
  989. END
  990. }
  991. FORM (NEW1_Dissimilarity_Distance_monotoneRegression, U"Dissimilarity & Distance: Monotone regression", nullptr) {
  992. RADIO (tiesHandling, U"Handling of ties", 1)
  993. RADIOBUTTON (U"Primary approach")
  994. RADIOBUTTON (U"Secondary approach")
  995. OK
  996. DO
  997. CONVERT_TWO (Dissimilarity, Distance)
  998. autoDistance result = Dissimilarity_Distance_monotoneRegression (me, you, tiesHandling);
  999. CONVERT_TWO_END (my name.get())
  1000. }
  1001. FORM (GRAPHICS_Distance_Dissimilarity_drawShepardDiagram, U"Distance & Dissimilarity: Draw Shepard diagram", nullptr) {
  1002. REAL (fromDissimilarity, U"left dissimilarity range", U"0.0")
  1003. REAL (toDissimilarity, U"right dissimilarity range", U"0.0")
  1004. REAL (fromDistance, U"left Distance range", U"0.0")
  1005. REAL (toDistance, U"right Distance range", U"0.0")
  1006. POSITIVE (markSize, U"Mark size (mm)", U"1.0")
  1007. SENTENCE (markString, U"Mark string (+xo.)", U"+")
  1008. BOOLEAN (garnish, U"Garnish", true)
  1009. OK
  1010. DO
  1011. GRAPHICS_TWO (Dissimilarity, Distance)
  1012. Proximity_Distance_drawScatterDiagram (me, you, GRAPHICS, fromDissimilarity, toDissimilarity, fromDistance, toDistance, markSize, markString, garnish);
  1013. GRAPHICS_TWO_END
  1014. }
  1015. DIRECT (HELP_MDS_help) {
  1016. HELP (U"Multidimensional scaling")
  1017. }
  1018. /************************* Salience ***************************************/
  1019. FORM (GRAPHICS_Salience_draw, U"Salience: Draw", nullptr) {
  1020. NATURAL (horizontalDimension, U"Horizontal dimension", U"1")
  1021. NATURAL (verticalDimension, U"Vertical dimension", U"2")
  1022. BOOLEAN (garnish, U"Garnish", true)
  1023. OK
  1024. DO
  1025. GRAPHICS_EACH (Salience)
  1026. Salience_draw (me, GRAPHICS, horizontalDimension, verticalDimension, garnish);
  1027. GRAPHICS_EACH_END
  1028. }
  1029. /************************* COVARIANCE & CONFIGURATION ********************/
  1030. FORM (NEW_Covariance_to_Configuration, U"Covariance: To Configuration", nullptr) {
  1031. NATURAL (numberOfDimensions, U"Number of dimensions", U"2")
  1032. OK
  1033. DO
  1034. CONVERT_EACH (Covariance)
  1035. autoConfiguration result = Covariance_to_Configuration (me, numberOfDimensions);
  1036. CONVERT_EACH_END (my name.get())
  1037. }
  1038. /********* Procrustes ***************************/
  1039. DIRECT (HELP_Procrustes_help) {
  1040. HELP (U"Procrustes")
  1041. }
  1042. DIRECT (REAL_Procrustes_getScale) {
  1043. NUMBER_ONE (Procrustes)
  1044. double result = my s;
  1045. NUMBER_ONE_END (U"(scale)")
  1046. }
  1047. /********* Casts from & to TableOfReal ***************************/
  1048. DIRECT (NEW_TableOfReal_to_Dissimilarity) {
  1049. CONVERT_EACH (TableOfReal)
  1050. autoDissimilarity result = TableOfReal_to_Dissimilarity (me);
  1051. CONVERT_EACH_END (my name.get())
  1052. }
  1053. DIRECT (NEW_TableOfReal_to_Similarity) {
  1054. CONVERT_EACH (TableOfReal)
  1055. autoSimilarity result = TableOfReal_to_Similarity (me);
  1056. CONVERT_EACH_END (my name.get())
  1057. }
  1058. DIRECT (NEW_TableOfReal_to_Distance) {
  1059. CONVERT_EACH (TableOfReal)
  1060. autoTableOfReal result = TableOfReal_to_Distance (me);
  1061. CONVERT_EACH_END (my name.get())
  1062. }
  1063. DIRECT (NEW_TableOfReal_to_Salience) {
  1064. CONVERT_EACH (TableOfReal)
  1065. autoSalience result = TableOfReal_to_Salience (me);
  1066. CONVERT_EACH_END (my name.get())
  1067. }
  1068. DIRECT (NEW_TableOfReal_to_Weight) {
  1069. CONVERT_EACH (TableOfReal)
  1070. autoWeight result = TableOfReal_to_Weight (me);
  1071. CONVERT_EACH_END (my name.get())
  1072. }
  1073. DIRECT (NEW_TableOfReal_to_ScalarProduct) {
  1074. CONVERT_EACH (TableOfReal)
  1075. autoScalarProduct result = TableOfReal_to_ScalarProduct (me);
  1076. CONVERT_EACH_END (my name.get())
  1077. }
  1078. DIRECT (NEW_TableOfReal_to_Configuration) {
  1079. CONVERT_EACH (TableOfReal)
  1080. autoConfiguration result = TableOfReal_to_Configuration (me);
  1081. CONVERT_EACH_END (my name.get())
  1082. }
  1083. DIRECT (NEW_TableOfReal_to_ContingencyTable) {
  1084. CONVERT_EACH (TableOfReal)
  1085. autoContingencyTable result = TableOfReal_to_ContingencyTable (me);
  1086. CONVERT_EACH_END (my name.get())
  1087. }
  1088. /********************** TableOfReal ***************************************/
  1089. DIRECT (REAL_TableOfReal_getTableNorm) {
  1090. NUMBER_ONE (TableOfReal)
  1091. double result = TableOfReal_getTableNorm (me);
  1092. NUMBER_ONE_END (U"(norm)")
  1093. }
  1094. FORM (MODIFY_TableOfReal_normalizeTable, U"TableOfReal: Normalize table", U"TableOfReal: Normalize table...") {
  1095. POSITIVE (norm, U"Norm", U"1.0")
  1096. OK
  1097. DO
  1098. MODIFY_EACH (TableOfReal)
  1099. TableOfReal_normalizeTable (me, norm);
  1100. MODIFY_EACH_END
  1101. }
  1102. FORM (MODIFY_TableOfReal_normalizeRows, U"TableOfReal: Normalize rows", U"TableOfReal: Normalize rows...") {
  1103. POSITIVE (norm, U"Norm", U"1.0")
  1104. OK
  1105. DO
  1106. MODIFY_EACH (TableOfReal)
  1107. TableOfReal_normalizeRows (me, norm);
  1108. MODIFY_EACH_END
  1109. }
  1110. FORM (MODIFY_TableOfReal_normalizeColumns, U"TableOfReal: Normalize columns", U"TableOfReal: Normalize columns...") {
  1111. POSITIVE (norm, U"Norm", U"1.0")
  1112. OK
  1113. DO
  1114. MODIFY_EACH (TableOfReal)
  1115. TableOfReal_normalizeColumns (me, norm);
  1116. MODIFY_EACH_END
  1117. }
  1118. DIRECT (MODIFY_TableOfReal_centreRows) {
  1119. MODIFY_EACH (TableOfReal)
  1120. TableOfReal_centreRows (me);
  1121. MODIFY_EACH_END
  1122. }
  1123. DIRECT (MODIFY_TableOfReal_centreColumns) {
  1124. MODIFY_EACH (TableOfReal)
  1125. TableOfReal_centreColumns (me);
  1126. MODIFY_EACH_END
  1127. }
  1128. DIRECT (MODIFY_TableOfReal_doubleCentre) {
  1129. MODIFY_EACH (TableOfReal)
  1130. TableOfReal_doubleCentre (me);
  1131. MODIFY_EACH_END
  1132. }
  1133. DIRECT (MODIFY_TableOfReal_standardizeRows) {
  1134. MODIFY_EACH (TableOfReal)
  1135. TableOfReal_standardizeRows (me);
  1136. MODIFY_EACH_END
  1137. }
  1138. DIRECT (MODIFY_TableOfReal_standardizeColumns) {
  1139. MODIFY_EACH (TableOfReal)
  1140. TableOfReal_standardizeColumns (me);
  1141. MODIFY_EACH_END
  1142. }
  1143. DIRECT (NEW_TableOfReal_to_Confusion) {
  1144. CONVERT_EACH (TableOfReal)
  1145. autoConfusion result = TableOfReal_to_Confusion (me);
  1146. CONVERT_EACH_END (my name.get())
  1147. }
  1148. static void praat_AffineTransform_init (ClassInfo klas) {
  1149. praat_addAction1 (klas, 0, QUERY_BUTTON, nullptr, 0, nullptr);
  1150. praat_addAction1 (klas, 1, U"Get transformation element...", QUERY_BUTTON, 1, REAL_AffineTransform_getTransformationElement);
  1151. praat_addAction1 (klas, 1, U"Get translation element...", QUERY_BUTTON, 1, REAL_AffineTransform_getTranslationElement);
  1152. praat_addAction1 (klas, 0, U"Invert", nullptr, 0, NEW_AffineTransform_invert);
  1153. }
  1154. void praat_TableOfReal_extras (ClassInfo klas);
  1155. void praat_TableOfReal_extras (ClassInfo klas) {
  1156. praat_addAction1 (klas, 1, U"-- get additional --", U"Get value...", 1, nullptr);
  1157. praat_addAction1 (klas, 1, U"Get table norm", U"-- get additional --", 1, REAL_TableOfReal_getTableNorm);
  1158. praat_addAction1 (klas, 0, U"-- set additional --", U"Set column label (label)...", 1, nullptr);
  1159. praat_addAction1 (klas, 0, U"Normalize rows...", U"-- set additional --", 1, MODIFY_TableOfReal_normalizeRows);
  1160. praat_addAction1 (klas, 0, U"Normalize columns...", U"Normalize rows...", 1, MODIFY_TableOfReal_normalizeColumns);
  1161. praat_addAction1 (klas, 0, U"Normalize table...", U"Normalize columns...", 1, MODIFY_TableOfReal_normalizeTable);
  1162. praat_addAction1 (klas, 0, U"Standardize rows", U"Normalize table...", 1, MODIFY_TableOfReal_standardizeRows);
  1163. praat_addAction1 (klas, 0, U"Standardize columns", U"Standardize rows", 1, MODIFY_TableOfReal_standardizeColumns);
  1164. }
  1165. void praat_uvafon_MDS_init ();
  1166. void praat_uvafon_MDS_init () {
  1167. Thing_recognizeClassesByName (classAffineTransform, classProcrustes, classContingencyTable, classDissimilarity, classMDSVec,
  1168. classSimilarity, classConfiguration, classDistance, classSalience, classScalarProduct, classWeight, nullptr);
  1169. Thing_recognizeClassByOtherName (classProcrustes, U"Procrustus");
  1170. praat_addMenuCommand (U"Objects", U"New", U"Multidimensional scaling", nullptr, 0, nullptr);
  1171. praat_addMenuCommand (U"Objects", U"New", U"MDS tutorial", nullptr, praat_DEPTH_1 | praat_NO_API, HELP_MDS_help);
  1172. praat_addMenuCommand (U"Objects", U"New", U"-- MDS --", nullptr, 1, nullptr);
  1173. praat_addMenuCommand (U"Objects", U"New", U"Create letter R example...", nullptr, 1, NEW1_Dissimilarity_createLetterRExample);
  1174. praat_addMenuCommand (U"Objects", U"New", U"Create INDSCAL Carroll Wish example...", nullptr, 1, NEWMANY_INDSCAL_createCarrollWishExample);
  1175. praat_addMenuCommand (U"Objects", U"New", U"Create Configuration...", nullptr, 1, NEW1_Configuration_create);
  1176. praat_addMenuCommand (U"Objects", U"New", U"Draw splines...", nullptr, 1, GRAPHICS_drawSplines);
  1177. praat_addMenuCommand (U"Objects", U"New", U"Draw MDS class relations", nullptr, 1, GRAPHICS_drawMDSClassRelations);
  1178. /****** 1 class ********************************************************/
  1179. praat_addAction1 (classAffineTransform, 0, U"AffineTransform help", nullptr, 0, HELP_AffineTransform_help);
  1180. praat_AffineTransform_init (classAffineTransform);
  1181. praat_addAction1 (classConfiguration, 0, U"Configuration help", nullptr, 0, HELP_Configuration_help);
  1182. praat_TableOfReal_init2 (classConfiguration);
  1183. praat_TableOfReal_extras (classConfiguration);
  1184. (void) praat_removeAction (classConfiguration, nullptr, nullptr, U"Insert column (index)...");
  1185. (void) praat_removeAction (classConfiguration, nullptr, nullptr, U"Remove column (index)...");
  1186. (void) praat_removeAction (classConfiguration, nullptr, nullptr, U"Append");
  1187. praat_addAction1 (classConfiguration, 0, U"Draw...", DRAW_BUTTON, 1, GRAPHICS_Configuration_draw);
  1188. praat_addAction1 (classConfiguration, 0, U"Draw sigma ellipses...", U"Draw...", 1, GRAPHICS_Configuration_drawSigmaEllipses);
  1189. praat_addAction1 (classConfiguration, 0, U"Draw one sigma ellipse...", U"Draw...", 1, GRAPHICS_Configuration_drawOneSigmaEllipse);
  1190. praat_addAction1 (classConfiguration, 0, U"Draw confidence ellipses...", U"Draw sigma ellipses...", 1, GRAPHICS_Configuration_drawConfidenceEllipses);
  1191. praat_addAction1 (classConfiguration, 0, U"Draw one confidence ellipse...", U"Draw sigma ellipses...", 1, GRAPHICS_Configuration_drawOneConfidenceEllipse);
  1192. praat_addAction1 (classConfiguration, 0, U"Randomize", U"Normalize table...", 1, MODIFY_Configuration_randomize);
  1193. praat_addAction1 (classConfiguration, 0, U"Normalize...", U"Randomize", 1, MODIFY_Configuration_normalize);
  1194. praat_addAction1 (classConfiguration, 0, U"Centralize", U"Randomize", 1, MODIFY_Configuration_centralize);
  1195. praat_addAction1 (classConfiguration, 1, U"-- set rotations & reflections --", U"Centralize", 1, nullptr);
  1196. praat_addAction1 (classConfiguration, 0, U"Rotate...", U"-- set rotations & reflections --", 1, MODIFY_Configuration_rotate);
  1197. praat_addAction1 (classConfiguration, 0, U"Rotate (pc)", U"Rotate...", 1, MODIFY_Configuration_rotateToPrincipalDirections);
  1198. praat_addAction1 (classConfiguration, 0, U"Invert dimension...", U"Rotate (pc)", 1, MODIFY_Configuration_invertDimension);
  1199. praat_addAction1 (classConfiguration, 0, U"Analyse", nullptr, 0, nullptr);
  1200. praat_addAction1 (classConfiguration, 0, U"To Distance", nullptr, 0, NEW_Configuration_to_Distance);
  1201. praat_addAction1 (classConfiguration, 0, U"To Configuration (varimax)...", nullptr, 0, NEW_Configuration_varimax);
  1202. praat_addAction1 (classConfiguration, 0, U"To Similarity (cc)", nullptr, 0, NEW1_Configurations_to_Similarity_cc);
  1203. praat_addAction1 (classConfiguration, 0, U"Match configurations -", nullptr, 0, nullptr);
  1204. praat_addAction1 (classConfiguration, 2, U"To Procrustes...", nullptr, 1, NEW1_Configurations_to_Procrustes);
  1205. praat_addAction1 (classConfiguration, 2, U"To AffineTransform (congruence)...", nullptr, 1, NEW1_Configurations_to_AffineTransform_congruence);
  1206. praat_addAction1 (classConfusion, 0, U"To ContingencyTable", U"To Matrix", 0, NEW_Confusion_to_ContingencyTable);
  1207. praat_addAction1 (classConfusion, 0, U"To Proximity -", U"Analyse", 0, nullptr);
  1208. praat_addAction1 (classConfusion, 0, U"To Dissimilarity (pdf)...", U"To Proximity -", 1, NEW_Confusion_to_Dissimilarity_pdf);
  1209. praat_addAction1 (classConfusion, 0, U"To Similarity...", U"To Proximity -", 1, NEW_Confusion_to_Similarity);
  1210. praat_addAction1 (classConfusion, 0, U"Sum", U"Synthesize -", 1, NEW1_Confusions_sum);
  1211. praat_TableOfReal_init2 (classContingencyTable);
  1212. praat_addAction1 (classContingencyTable, 1, U"-- statistics --", U"Get value...", 1, nullptr);
  1213. praat_addAction1 (classContingencyTable, 1, U"Get chi squared probability", U"-- statistics --", 1, REAL_ContingencyTable_chisqProbability);
  1214. praat_addAction1 (classContingencyTable, 1, U"Get Cramer's statistic", U"Get chi squared probability", 1, REAL_ContingencyTable_cramersStatistic);
  1215. praat_addAction1 (classContingencyTable, 1, U"Get contingency coefficient", U"Get Cramer's statistic", 1, REAL_ContingencyTable_contingencyCoefficient);
  1216. praat_addAction1 (classContingencyTable, 0, U"Analyse", nullptr, 0, nullptr);
  1217. praat_addAction1 (classContingencyTable, 1, U"To Configuration (ca)...", nullptr, 0, NEW_ContingencyTable_to_Configuration_ca);
  1218. praat_addAction1 (classCorrelation, 0, U"To Configuration...", nullptr, 0, NEW_Correlation_to_Configuration);
  1219. praat_addAction1 (classDissimilarity, 0, U"Dissimilarity help", nullptr, 0, HELP_Dissimilarity_help);
  1220. praat_TableOfReal_init2 (classDissimilarity);
  1221. praat_TableOfReal_extras (classDissimilarity);
  1222. praat_addAction1 (classDissimilarity, 0, U"Get additive constant", U"Get table norm", 1, REAL_Dissimilarity_getAdditiveConstant);
  1223. praat_addAction1 (classDissimilarity, 0, CONFIGURATION_BUTTON, nullptr, 0, nullptr);
  1224. praat_addAction1 (classDissimilarity, 1, U"To Configuration (monotone mds)...", nullptr, 1, NEW_Dissimilarity_to_Configuration_monotone_mds);
  1225. praat_addAction1 (classDissimilarity, 1, U"To Configuration (i-spline mds)...", nullptr, 1, NEW_Dissimilarity_to_Configuration_ispline_mds);
  1226. praat_addAction1 (classDissimilarity, 1, U"To Configuration (interval mds)...", nullptr, 1, NEW_Dissimilarity_to_Configuration_interval_mds);
  1227. praat_addAction1 (classDissimilarity, 1, U"To Configuration (ratio mds)...", nullptr, 1, NEW_Dissimilarity_to_Configuration_ratio_mds);
  1228. praat_addAction1 (classDissimilarity, 1, U"To Configuration (absolute mds)...", nullptr, 1, NEW_Dissimilarity_to_Configuration_absolute_mds);
  1229. praat_addAction1 (classDissimilarity, 1, U"To Configuration (kruskal)...", nullptr, 1, NEW_Dissimilarity_to_Configuration_kruskal);
  1230. praat_addAction1 (classDissimilarity, 0, U"To Distance...", nullptr, 0, NEW_Dissimilarity_to_Distance);
  1231. praat_addAction1 (classDissimilarity, 0, U"To Weight", nullptr, 0, NEW_Dissimilarity_to_Weight);
  1232. praat_addAction1 (classDissimilarity, 0, U"To MDSVec", nullptr, praat_HIDDEN, NEW_Dissimilarity_to_MDSVec);
  1233. praat_addAction1 (classCovariance, 0, U"To Configuration...", nullptr, 0, NEW_Covariance_to_Configuration);
  1234. praat_TableOfReal_init2 (classDistance);
  1235. praat_TableOfReal_extras (classDistance);
  1236. praat_addAction1 (classDistance, 0, U"Analyse -", nullptr, 0, nullptr);
  1237. praat_addAction1 (classDistance, 0, CONFIGURATION_BUTTON, nullptr, 0, nullptr);
  1238. praat_addAction1 (classDistance, 0, U"To Configuration (indscal)...", nullptr, 1, NEWMANY_Distances_to_Configuration_indscal);
  1239. praat_addAction1 (classDistance, 0, U"-- linear scaling --", nullptr, 1, nullptr);
  1240. praat_addAction1 (classDistance, 0, U"To Configuration (ytl)...", nullptr, 1, NEWMANY_Distances_to_Configuration_ytl);
  1241. praat_addAction1 (classDistance, 0, U"To Dissimilarity", nullptr, 0, NEW_Distance_to_Dissimilarity);
  1242. praat_addAction1 (classDistance, 0, U"To ScalarProduct...", nullptr, 0, NEW_Distance_to_ScalarProduct);
  1243. praat_addAction1 (classProcrustes, 0, U"Procrustes help", nullptr, 0, HELP_Procrustes_help);
  1244. praat_AffineTransform_init (classProcrustes);
  1245. praat_addAction1 (classProcrustes, 1, U"Get scale", QUERY_BUTTON, 1, REAL_Procrustes_getScale);
  1246. praat_addAction1 (classProcrustes, 0, U"Extract transformation matrix", nullptr, 0, NEW_AffineTransform_extractMatrix);
  1247. praat_addAction1 (classProcrustes, 0, U"Extract translation vector", nullptr, 0, NEW_AffineTransform_extractTranslationVector);
  1248. praat_TableOfReal_init2 (classSalience);
  1249. praat_TableOfReal_extras (classSalience);
  1250. praat_addAction1 (classSalience, 0, U"Draw...", DRAW_BUTTON, 1, GRAPHICS_Salience_draw);
  1251. praat_addAction1 (classSimilarity, 0, U"Similarity help", nullptr, 0, HELP_Similarity_help);
  1252. praat_TableOfReal_init2 (classSimilarity);
  1253. praat_TableOfReal_extras (classSimilarity);
  1254. praat_addAction1 (classSimilarity, 0, U"Analyse -", nullptr, 0, nullptr);
  1255. praat_addAction1 (classSimilarity, 0, U"To Dissimilarity...", nullptr, 0, NEW_Similarity_to_Dissimilarity);
  1256. praat_TableOfReal_init2 (classScalarProduct);
  1257. praat_TableOfReal_extras (classScalarProduct);
  1258. praat_TableOfReal_extras (classTableOfReal);
  1259. praat_addAction1 (classTableOfReal, 1, U"Centre rows", U"Normalize table...", 1, MODIFY_TableOfReal_centreRows);
  1260. praat_addAction1 (classTableOfReal, 1, U"Centre columns", U"Centre rows", 1, MODIFY_TableOfReal_centreColumns);
  1261. praat_addAction1 (classTableOfReal, 1, U"Double centre", U"Centre columns", 1, MODIFY_TableOfReal_doubleCentre);
  1262. praat_addAction1 (classTableOfReal, 0, U"Cast -", nullptr, 0, nullptr);
  1263. praat_addAction1 (classTableOfReal, 0, U"To Confusion", nullptr, 1, NEW_TableOfReal_to_Confusion);
  1264. praat_addAction1 (classTableOfReal, 0, U"To Dissimilarity", nullptr, 1, NEW_TableOfReal_to_Dissimilarity);
  1265. praat_addAction1 (classTableOfReal, 0, U"To Similarity", nullptr, 1, NEW_TableOfReal_to_Similarity);
  1266. praat_addAction1 (classTableOfReal, 0, U"To Distance", nullptr, 1, NEW_TableOfReal_to_Distance);
  1267. praat_addAction1 (classTableOfReal, 0, U"To Salience", nullptr, 1, NEW_TableOfReal_to_Salience);
  1268. praat_addAction1 (classTableOfReal, 0, U"To Weight", nullptr, 1, NEW_TableOfReal_to_Weight);
  1269. praat_addAction1 (classTableOfReal, 0, U"To ScalarProduct", nullptr, 1, NEW_TableOfReal_to_ScalarProduct);
  1270. praat_addAction1 (classTableOfReal, 0, U"To Configuration", nullptr, 1, NEW_TableOfReal_to_Configuration);
  1271. praat_addAction1 (classTableOfReal, 0, U"To ContingencyTable", nullptr, 1, NEW_TableOfReal_to_ContingencyTable);
  1272. praat_TableOfReal_init2 (classWeight);
  1273. /****** 2 classes ********************************************************/
  1274. praat_addAction2 (classConfiguration, 1, classAffineTransform, 1, U"To Configuration", nullptr, 0, NEW1_Configuration_AffineTransform_to_Configuration);
  1275. praat_addAction2 (classConfiguration, 1, classProcrustes, 1, U"To Configuration", nullptr, 0, NEW1_Configuration_Procrustes_to_Configuration);
  1276. //praat_Configuration_AffineTransform_init (classAffineTransform);
  1277. //praat_Configuration_AffineTransform_init (classProcrustes);
  1278. praat_addAction2 (classConfiguration, 0, classWeight, 1, U"Analyse", nullptr, 0, nullptr);
  1279. praat_addAction2 (classConfiguration, 0, classWeight, 1, U"To Similarity (cc)", nullptr, 0, NEW1_Configuration_Weight_to_Similarity_cc);
  1280. praat_addAction2 (classDissimilarity, 1, classWeight, 1, ANALYSE_BUTTON, nullptr, 0, nullptr);
  1281. praat_addAction2 (classDissimilarity, 1, classWeight, 1, U"To Configuration (monotone mds)...", nullptr, 1, NEW1_Dissimilarity_Weight_monotone_mds);
  1282. praat_addAction2 (classDissimilarity, 1, classWeight, 1, U"To Configuration (i-spline mds)...", nullptr, 1, NEW1_Dissimilarity_Weight_ispline_mds);
  1283. praat_addAction2 (classDissimilarity, 1, classWeight, 1, U"To Configuration (interval mds)...", nullptr, 1, NEW1_Dissimilarity_Weight_interval_mds);
  1284. praat_addAction2 (classDissimilarity, 1, classWeight, 1, U"To Configuration (ratio mds)...", nullptr, 1, NEW1_Dissimilarity_Weight_ratio_mds);
  1285. praat_addAction2 (classDissimilarity, 1, classWeight, 1, U"To Configuration (absolute mds)...", nullptr, 1, NEW1_Dissimilarity_Weight_absolute_mds);
  1286. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, DRAW_BUTTON, nullptr, 0, nullptr);
  1287. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, U"Draw Shepard diagram...", nullptr, 1, GRAPHICS_Dissimilarity_Configuration_drawShepardDiagram);
  1288. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, U"-- draw regressions --", nullptr, 1, nullptr);
  1289. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, U"Draw monotone regression...", nullptr, 1, GRAPHICS_Dissimilarity_Configuration_drawMonotoneRegression);
  1290. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, U"Draw i-spline regression...", nullptr, 1, GRAPHICS_Dissimilarity_Configuration_drawISplineRegression);
  1291. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, U"Draw interval regression...", nullptr, 1, GRAPHICS_Dissimilarity_Configuration_drawIntervalRegression);
  1292. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, U"Draw ratio regression...", nullptr, 1, GRAPHICS_Dissimilarity_Configuration_drawRatioRegression);
  1293. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, U"Draw absolute regression...", nullptr, 1, GRAPHICS_Dissimilarity_Configuration_drawAbsoluteRegression);
  1294. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, QUERY_BUTTON, nullptr, 0, nullptr);
  1295. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, U"Get stress (monotone mds)...", nullptr, 1, REAL_Dissimilarity_Configuration_monotone_stress);
  1296. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, U"Get stress (i-spline mds)...", nullptr, 1, REAL_Dissimilarity_Configuration_ispline_stress);
  1297. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, U"Get stress (interval mds)...", nullptr, 1, REAL_Dissimilarity_Configuration_interval_stress);
  1298. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, U"Get stress (ratio mds)...", nullptr, 1, REAL_Dissimilarity_Configuration_ratio_stress);
  1299. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, U"Get stress (absolute mds)...", nullptr, 1, REAL_Dissimilarity_Configuration_absolute_stress);
  1300. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, U"Get stress...", nullptr, 1, REAL_Dissimilarity_Configuration_getStress);
  1301. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, ANALYSE_BUTTON, nullptr, 0, nullptr);
  1302. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, U"To Configuration (monotone mds)...", nullptr, 1, NEW1_Dissimilarity_Configuration_monotone_mds);
  1303. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, U"To Configuration (i-spline mds)...", nullptr, 1, NEW1_Dissimilarity_Configuration_ispline_mds);
  1304. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, U"To Configuration (interval mds)...", nullptr, 1, NEW1_Dissimilarity_Configuration_interval_mds);
  1305. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, U"To Configuration (ratio mds)...", nullptr, 1, NEW1_Dissimilarity_Configuration_ratio_mds);
  1306. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, U"To Configuration (absolute mds)...", nullptr, 1, NEW1_Dissimilarity_Configuration_absolute_mds);
  1307. praat_addAction2 (classDissimilarity, 1, classConfiguration, 1, U"To Configuration (kruskal)...", nullptr, 1, NEW1_Dissimilarity_Configuration_kruskal);
  1308. praat_addAction2 (classDistance, 1, classConfiguration, 1, DRAW_BUTTON, nullptr, 0, nullptr);
  1309. praat_addAction2 (classDistance, 1, classConfiguration, 1, U"Draw scatter diagram...", nullptr, 0, GRAPHICS_Distance_Configuration_drawScatterDiagram);
  1310. praat_addAction2 (classDistance, 1, classConfiguration, 1, QUERY_BUTTON, nullptr, 0, nullptr);
  1311. praat_addAction2 (classDistance, 0, classConfiguration, 1, U"Get VAF...", nullptr, 0, REAL_Distance_Configuration_vaf);
  1312. praat_addAction2 (classDistance, 1, classConfiguration, 1, ANALYSE_BUTTON, nullptr, 0, nullptr);
  1313. praat_addAction2 (classDistance, 0, classConfiguration, 1, U"To Configuration (indscal)...", nullptr, 1, NEWMANY_Distance_Configuration_indscal);
  1314. praat_addAction2 (classDistance, 1, classDissimilarity, 1, U"Draw Shepard diagram...", nullptr, 0, GRAPHICS_Distance_Dissimilarity_drawShepardDiagram);
  1315. praat_addAction2 (classDissimilarity, 1, classDistance, 1, U"Monotone regression...", nullptr, 0, NEW1_Dissimilarity_Distance_monotoneRegression);
  1316. /****** 3 classes ********************************************************/
  1317. praat_addAction3 (classDissimilarity, 0, classConfiguration, 1, classSalience, 1, QUERY_BUTTON, nullptr, 0, nullptr);
  1318. praat_addAction3 (classDissimilarity, 0, classConfiguration, 1, classSalience, 1, U"Get VAF...", nullptr, 1, REAL_Dissimilarity_Configuration_Salience_vaf);
  1319. praat_addAction3 (classDissimilarity, 1, classConfiguration, 1, classWeight, 1, QUERY_BUTTON, nullptr, 0, nullptr);
  1320. praat_addAction3 (classDissimilarity, 1, classConfiguration, 1, classWeight, 1, U"Get stress (monotone mds)...", nullptr, 1, REAL_Dissimilarity_Configuration_Weight_monotone_stress);
  1321. praat_addAction3 (classDissimilarity, 1, classConfiguration, 1, classWeight, 1, U"Get stress (i-spline mds)...", nullptr, 1, REAL_Dissimilarity_Configuration_Weight_ispline_stress);
  1322. praat_addAction3 (classDissimilarity, 1, classConfiguration, 1, classWeight, 1, U"Get stress (interval mds)...", nullptr, 1, REAL_Dissimilarity_Configuration_Weight_interval_stress);
  1323. praat_addAction3 (classDissimilarity, 1, classConfiguration, 1, classWeight, 1, U"Get stress (ratio mds)...", nullptr, 1, REAL_Dissimilarity_Configuration_Weight_ratio_stress);
  1324. praat_addAction3 (classDissimilarity, 1, classConfiguration, 1, classWeight, 1, U"Get stress (absolute mds)...", nullptr, 1, REAL_Dissimilarity_Configuration_Weight_absolute_stress);
  1325. praat_addAction3 (classDissimilarity, 1, classConfiguration, 1, classWeight, 1, ANALYSE_BUTTON, nullptr, 0, nullptr);
  1326. praat_addAction3 (classDissimilarity, 1, classConfiguration, 1, classWeight, 1, U"To Configuration (monotone mds)...", nullptr, 1, NEW1_Dissimilarity_Configuration_Weight_monotone_mds);
  1327. praat_addAction3 (classDissimilarity, 1, classConfiguration, 1, classWeight, 1, U"To Configuration (i-spline mds)...", nullptr, 1, NEW1_Dissimilarity_Configuration_Weight_ispline_mds);
  1328. praat_addAction3 (classDissimilarity, 1, classConfiguration, 1, classWeight, 1, U"To Configuration (interval mds)...", nullptr, 1, NEW1_Dissimilarity_Configuration_Weight_interval_mds);
  1329. praat_addAction3 (classDissimilarity, 1, classConfiguration, 1, classWeight, 1, U"To Configuration (ratio mds)...", nullptr, 1, NEW1_Dissimilarity_Configuration_Weight_ratio_mds);
  1330. praat_addAction3 (classDissimilarity, 1, classConfiguration, 1, classWeight, 1, U"To Configuration (absolute mds)...", nullptr, 1, NEW1_Dissimilarity_Configuration_Weight_absolute_mds);
  1331. praat_addAction3 (classDistance, 0, classConfiguration, 1, classSalience, 1, QUERY_BUTTON, nullptr, 0, nullptr);
  1332. praat_addAction3 (classDistance, 0, classConfiguration, 1, classSalience, 1, U"Get VAF...", nullptr, 1, REAL_Distance_Configuration_Salience_vaf);
  1333. praat_addAction3 (classDistance, 0, classConfiguration, 1, classSalience, 1, U"Analyse", nullptr, 0, nullptr);
  1334. praat_addAction3 (classDistance, 0, classConfiguration, 1, classSalience, 1, U"To Configuration (indscal)...", nullptr, 0, NEWMANY_Distance_Configuration_Salience_indscal);
  1335. INCLUDE_MANPAGES (manual_MDS_init)
  1336. }
  1337. /* End of file praat_MDS_init.c 2010*/