# # canola - canon canola 1614p emulator # Copyright (C) 2011 Peter Miller # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 3, as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # ; ------------------ Card-Pocket-Begin ----------------------------------- ; Title: ST-3: Correlation Coefficient ; Color: green ; Style: blank ; ------------------ Card-Pocket-End ------------------------------------- ; ; How-to-Operate: ; [START] ; x1 [START] y1 [START] ; x2 [START] y2 [START] ; x3 [START] y3 [START] ; : : : : ; xn [START] yn [START] ; [START] => r ; ; Example: ; [START] ; 8.8 [START] 8.2 [START] ; 7.0 [START] 6.4 [START] ; 7.4 [START] 6.0 [START] ; [START] => 0.92690 ; r ; ; Equations: ; r = (n * sigma(x*y) - sigma(x)*sigma(y)) / ; sqrt((n*sigma(x**2) - (sigma(x)**2)) * ; (n*sigma(y) - (sigma(y)**2))) ; CM14 ; sigma(x) CM13 ; sigma(x**2) CM12 ; sigma(y) CM11 ; sigma(x*y) CM10 ; sigma(y**2) CM9 ; n ENT FJ $613 M14 * += M13 RV * ENT ; y M12 SM8 += M11 RM8 * += M10 1 M9 RM9 EJ $613 ; branch if they enter a new X RM14 * += / RM9 -= M13 RM12 * += / RM9 -= M10 RM14 * RM12 / RM9 -= M11 RM13 * RM10 += SQRT / RM11 RV ROUND 5 += PRINT ; r