Least squares with matrices (Vandermonde) — a TI-89 Titanium program
MFIT89 is a TI-89 BASIC program for the TI-89 Titanium. X and Y lists and a degree 1-3: builds the Vandermonde matrix V and solves (VᵀV)c = VᵀY — exact coefficients for exact data — with R² and a prediction.
What it asks for and what it shows
It asks for 4 values at its prompts. In the example below it shows C0, C1, C2, R², YHAT.
Example run
One of its oracle test cases: “exact parabola y = 2x²+1”. The inputs are typed in order, and the results are the values the case expects on the screen.
| Step | Value |
|---|---|
| You enter | |
| Input 1 | {0,1,2,3} |
| Input 2 | {1,3,9,19} |
| Input 3 | 2 |
| Input 4 | 4 |
| The screen shows | |
C0= | 1 |
C1= | 0 |
C2= | 2 |
R²= | 1 |
YHAT= | 33 |
How it's checked
6 test cases, each checked against an independent method. Replayed key by key on a virtual TI-89 Titanium, they make 43 checks.
How E-Code checks every program
Run it or put it on your calculator
- Open the library in the TI-89 Titanium calculator and pick “Least squares with matrices (Vandermonde)” (MFIT89).
- Put it on your own calculator with a computer and a USB cable, or type it in by hand.
Related programs
- Least-squares polynomial fit (exact)
- Linear regression with exact slope
- Markov chain: n steps and the steady state
- One-variable statistics of a list
- One-sample z test and interval (dialog)
All TI-89 Titanium statistics programs · All TI-89 Titanium programs