Saturday, July 13, 2024

TI-84 Plus CE and Casio fx-CG 50: Mean Squared Error

TI-84 Plus CE and Casio fx-CG 50: Mean Squared Error


Introduction


The mean square error computes the mean distance from observed (y) versus predicted (y’) values. With the n data points, the standard formula for mean squared error (MSE) is calculated as:


MSE = 1 / n * Σ((y_i – y’_i)^2 for i=1 to n)


Where:

n = number of data points

y = observed points

y’ = predicted points. Any regression can be used, but the linear regression is typically used (y = a + b * x).


When MSE is small, (as closed to zero as possible), the better the data fits the regression curve. MSE is sensitive to how much data points stray from the regression line. [see Source]



TI-84 Plus CE Program: MSE




How to retrieve the statistical variables and the apostrophe character:

a: [ vars ], 5, [ → ], [ → ], 2

b: [ vars ], 5, [ → ], [ → ], 3

n: [ vars ], ,5 ,1

‘: [ 2nd ] [ apps ] <angle>, 2


Lists used:

L1 = x data

L2 = y data

L3 = y’ (predicted y) data


Download the program here: https://drive.google.com/file/d/1toVMgznJOGdaK4uhvfrcvvb3t__D9yJD/view?usp=drive_link


Casio fx-CG 50


The Casio fx-CG 50 (and other modern Casio graphing calculators such as the fx-9750GIII/9860GIII) has a MSe variable (Mean Square Error) included in the statistics variables. However, Casio’s calculation of Mse vary depending on the regression model selected. For the linear regression mode, Mse is calculated with the following formula:


Mse = 1 / (n – 2) * Σ((y_i – y’_i)^2 for i=1 to n)


Apparently the are different approaches.

.


Examples (with the Presented Formula)


Linear Regression is assumed (y = a + b * x, a = y-intercept, b = slope). Results are shown using the MSE program (TI-84 Plus CE).


Set 1:


L1 = x

L2 = y

1

1.035

2

1.076

3

1.112

4

1.400

5

1.558

6

1.827


a: 0.7652666667

b: 0.1626857143

MSE: 0.0066101841


Set 2:


L1 = x

L2 = y

40

385

41

349

40

376

41

358

39

333

38

326

39

371

40

350


a: 22.1

b: 8.4

MSE: 306.85



Source


Encord. “Mean Square Error”. Encord Computer Vision Glossary. 2023. Retrieved May 25, 2024. https://encord.com/glossary/mean-square-error-mse/



Next post: Saturday, July 20, 2024


Eddie


All original content copyright, © 2011-2024. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Fun with the HP 30b

Fun with the HP 30 b Introduction The following programs are for the HP 30b Business Professional. Did you know that the 30b...