MathU™ RPN 2.2 for iPhone
Documentation
< [PREV CHAPTER] [HOME] [NEXT CHAPTER] >
Statistics Functions
The statistical functions accumulate sums based on the values in the x and y stack registers. These sums are used to compute the mean
and standard deviation σ or can be accessed directly via RCL. Use CL Σ to reset all the statistical registers to zero before accumulating sums. If you make a mistake keying in the x,y values and after pressing Σ+, re-key the errant values and press Σ− to remove them from the sums. The mean and standard deviation are computed as
![]()
with similar equations holding for the y component as well.
The statistical sums are strored in these registers:

RCL . n to access the sums in the secondary registers.
Linear Regression
MathU RPN includes two functions to fit linear trend lines to a set of data, y,r and x,r. The first uses the linear trend to estimate x given a value of y, the second uses the linear trend to estimate y given a value of x. Both functions rely on the statistics registers to hold information about the data points.
The functions also return a goodness of fit parameter, called the correlation coefficient r. r will be near 1.0 or -1.0 for data that is accurately described by the linear fit and values near zero for data that does not have a clear linear trend.
The figures below show two situations, one with a linear trend and another that is not very well estimated by a linear trend. The correlation coefficient for each situation is shown.

To perform a linear regression:
-
CLΣ to clear the statistics registers
-
Enter the data points via y ENTER x Σ+
- Repeat step 2 for each point in the data set.
- To estimate a y value given an x, enter the x value followed by y,r
- To estimate an x value given a y value, enter the x value followed by x,r
Determining the trend line parameters
You can use the y,r and x,r functions to determine the equation of the trend line, y = m*x + b:
- Enter the data points into the statistics registers as described above.
- 0 y,r to determine b by computing the estimated y when x is 0.0
- STO 0 to store b in register 0 (in order to remember it)
- 1 y,r to estimate value of y when x is 1.0
- RCL 0 − to compute the slope m.
< [PREV CHAPTER] [HOME] [NEXT CHAPTER] >











