Saturday, June 3, 2017

HP 20S and HP 21S: Simple Logistic Regression

HP 20S and HP 21S:  Simple Logistic Regression

For the HP Prime and TI-84 Plus CE versions, please click here:  http://edspi31415.blogspot.com/2017/04/hp-prime-and-ti-84-plus-ce-simple.html

This program attempts to fit a simple logistic curve of data (X, Y) to the equation:

y = 1/(A + B*e^(-x))

By the following transformations:

X’ = e^(-X)  
Y’ = 1/Y

And performing linear regression analysis on X’ and Y’.   Note that the data point which includes Y = 0 is not allowed. 

The keystrokes for the HP 20S and HP 21S are slightly different.  Each program will be shown separately.

Input:
Initialize the data:  XEQ A
For each data point:  x, [INPUT], y, XEQ B
Calculate the parameters:  XEQ C.  B is shown first, then A.

HP 20S Program: Simple Logistic Regression

STEP
CODE
KEY
01
61, 41, A
LBL A
02
61, 75
CLRΣ
03
61, 26
RTN
04
61, 41, B
LBL B
05
15
1/X
06
51, 31
SWAP
07
32
+/-
08
12
e^x
09
51, 31
SWAP
10
16
Σ+
11
61, 26
RTN
12
61, 41, C
LBL C
13
61, 16
m, b
14
26
R/S
15
51, 31
SWAP
16
61, 26
RTN

HP 21S Program: Simple Logistic Regression


STEP
CODE
KEY
01
61, 41, A
LBL A
02
61, 75
CLRΣ
03
61, 26
RTN
04
61, 41, B
LBL B
05
15
1/X
06
51, 31
SWAP
07
32
+/-
08
12
e^x
09
51, 31
SWAP
10
16
Σ+
11
61, 26
RTN
12
61, 41, C
LBL C
13
51, 14
m, b
14
26
R/S
15
51, 31
SWAP
16
61, 26
RTN

Like the last post (minimum and maximum), this is one of my favorite programs I have done this year.  I think the Wheatstone circuit would also make the list.

Eddie


This blog is property of Edward Shore, 2017

2 comments:


  1. Thankyou for wonderful article. It has more Information in Your Website
    SAP Simple Logistics Online Access

    ReplyDelete
  2. The info you have given is the best. You covered all sap modules info thats great. I am very thankfull to you for the info you provided.If you have any details about Sap Online Access

    ReplyDelete

HP Prime and TI-84 Plus CE: Double Integral by Monte Carlo Method

HP Prime and TI-84 Plus CE:  Double Integral by Monte Carlo Method Introduction There are several ways to calculate integrals.  The mos...