Saturday, September 28, 2024

TI-84 CE and TI-86: Matrix Row Statistics

TI-84 CE and TI-86: Matrix Row Statistics


Introduction


The program MROWST will take a matrix and a desired row and calculate three statistics points:


* Sum of the row

* Mean of the row

* Difference Vector: row – mean for each element


TI-84 CE Program MROWST


Matrices used: [ J ] (entry matrix), [ I ] (difference vector)


Input “MATRIX? “, [ J ]

Input “ROW? “, R

dim([ J ])

Ans(2) → D

0 → S

For(I, 1, D)

S + [ J ](R, I) → S

End

S / D → M

{1, D} → dim([ I ])

For(I, 1, D)

[ J ](R, I) – M → [ I ](1, I)

End

ClrHome

Disp “SUM: “ + toString(S)

Disp “MEAN: “ + toString(M)

Disp “DIFF VECTOR:”

Pause [ I ]


TI-86 Program MROWST


Matrices used: MJ (entry matrix), MD (difference vector), mone (vector of ones)


Input “Matrix? “, MJ

Input “Row? “, R

dim MJ

Ans(2) → D

D → dim mone

Fill(1, mone)

dot(mone, MJ(R)) → S

S / dim mone → M

MJ(R) - (M * mone) → MD

ClLCD

Disp “Sum:”, S

Disp “Mean:”, M

Disp “Diff Vector:”

Pause MD


Example


Matrix:

[ [ -9, -4, -1, -9, 4 ]

[ -9, -7, -4, -4, 9 ]

[ 7, 1, -9, -7, 8 ] ]


Row 1:

Sum: -1

Mean: -0.2

Difference Vector: [ 9.2, -3.8, -0.8, -8.8, 4.2 ]


Row 2:

Sum: -15

Mean: -3

Difference Vector: [ -6, -4, -1, -1, 12 ]


Row 3:

Sum: 0

Mean: 0

Difference Vector: [ 7, 1, -9, -7, 8 ]



Source:

Stuerke, Cecil. “Demonstration of Principal Component Analysis on TI-86” IEEE 2008



Eddie


Quick update: Starting October 5, 2024, my schedule will allow me to blog once a week. Regular posts will go live every Saturday. Thank you for your support and compliments. I wish you all well.



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.

Casio fx-CG 50: Centroid of a 2D spaces

Casio fx-CG 50: Centroid of a 2D spaces The program CENTROID calculates the center point for an area covered by: y(x) ≥ 0, x ≥ low...