Saturday, August 15, 2020

TI 84 Plus CE: Cauchy Fit Regression

TI 84 Plus CE: Cauchy Fit Regression

Note, in this blog capital and lower case letter variables are not assumed to be the same,  hence A ≠ a, B ≠ b, C ≠ c.

Derivation

General Equation:

Y = 1 / (A * (x + B)^2 + C)

We can set the equation in a general quadratic equation format by:

Y = 1 / (A * (x + B)^2 + C)
1/Y = A * (x + B)^2 + C
1/Y = A * (x^2 + 2*B*x + B^2) + C
1/Y = A*x^2 + 2*A*B*x + A*B^2 + C
1/Y = A*x^2 + 2*A*B*x + [A*B^2 + C]

Let:
y = 1/Y
a = A
b = 2*A*B
c = A*B^2 + C

Then:
y = a*x^2 + b*x + c

This form can be used when using a graphing or scientific calculator to calculate quadratic regression. 

We can solve for A, B, C:

A = a

b = 2*A*B
B = b / (2*A)

c = A*B^2 + C
C = c - A*B^2

To find a Cauchy regression fit:

1.  Enter the x data.
2.  Enter the y data but take the reciprocal of each y data point. 
3.  Run the Quadratic Regression:  y = a*x^2 + b*x + c
4.  Solve for the Cauchy regression to get the coefficients:

A = a
B = b / (2*A)
C = c - A*B^2

TI-84 Plus CE Program:  CAUCHFIT
Size:  200 Bytes

"2020-07-31 EWS"
Disp "CAUCHY FIT"
Input "X DATA? ", L1
Input "Y DATA? ", L3
1 / L3 → L2
QuadReg L1, L2
a → A
b / (2 A) → B
c - A B^2 → C
ClrHome
Output(3,1,"Y=1/(A(X+B)^2+C)"
Output(4,1,"A=")
Output(4,3,A)
Output(5,1,"B=")
Output(5,3,B)
Output(6,1,"C=")
Output(6,3,C)
Pause

Notes:

1.  The variables a, b, and c are from the VARS, Statistics, EQ menu.

2.  x data is stored in L1, 1/y data is stored in L2, and y data is stored in L3.  To call lists L1, L2, and L3, press [ 2nd ] [ 1 ], [ 2nd ] [ 2 ], and [ 2nd ] [ 3 ], respectively. 

3.  The use of Output should allow this code to be programmed on earlier TI-83 Plus and TI-84 Plus calculators. 

Example

X = { 1, 1.5, 2, 2.5 , 3}
Y = { 0.0774, 0.0577, 0.0442, 0.0347, 0.0278}

Results:

A = 1.823972632
B = 1.157397925
C = 4.437539736

y ≈ 1 / ( 1.823972632 * (x + 1.157397925)^2 + 4.437539736 )

Source:

Kolb, William M.  Curve Fitting For Programmable Calculators IMTEC.  Bowie, MD 20716.  1982.  ISBN-10:  0-943494-00-01


Stay safe and sane everyone.  Blessings,

Eddie

All original content copyright, © 2011-2020.  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...