This is an old revision of the document!


Hints & Tips

DM15L : Non-linear Curve Fit

Using DM15L/HP15C built-in L.R function to fit non-linear curves

Background

The idea is that the 3 different non-linear function forms can be expressed as linear expression y = m.x + c if we manipulate the x or y values before adding them to the statistics accumulator.

The different curves require different treatment of the data to linearize, and the resulting coefficients may require treatment too.

Tl;DR

Method for Exponential

Enter Accumulation data yi gLn xi ∑+
Calculate coefficients fL.R.ex
Estimate ŷ & r for a new x x fŷ.r ex

Method for Logarithmic

Enter Accumulation data yi Enter xi gLn∑+
Calculate coefficients fL.R.
Estimate ŷ & r for a new x xgLn fŷ.r

Method for Power

Enter Accumulation data yi gLn xi gLn∑+
Calculate coefficients fL.R.ex
Estimate ŷ & r for a new x x gLnfŷ.rex

Exponential

y = b.eax

This can be expressed as Ln(y) = Ln(b) + a.x

or

Ln(y) = a.x + ln(b)

compare with a linear expression y = m.x + c

Using Ln(y) and x as data points and running the L.R. function will give coefficients equal to a and ln(b)

You can obtain the actual value of b finding its antilog with ex.

Once the L.R. has run you can find estimates of ŷ by running the fŷ.r to get the estimate of Ln(y) and then finding its antilog with ex

Mechanism

To enter the data points you convert the y data to its Ln first, then accumulate as normal

yi gLn xi ∑+

Once all the data has been entered you get the Linear Regression coefficients a & b fL.R. and ex to correct the b LR coefficient.

Example Data

x0.81.11.72.1
y2.83.65.88.0

fClear ∑

2.8 gLn 0.8 ∑+

3.6 gLn 1.1 ∑+

5.8 gLn 1.7 ∑+

8.0 gLn 2.1 ∑+

All data is in the accumulator, now do the Linear Regression fL.R.

This gives a and Ln b coefficients

Y: 0.805 = a

X: 0.3897 = ln b

so we need to find b so ex

Y: 0.805 = a

X: 1.476 = b

Equation estimation is therefore y = 1.476 e 0.805x

I made the data table by using the equation y = 1.5 e 0.8x and then used approx. y values for the data table…. so the estimate looks pretty good

To do an estimation of y when x = 0.9

0.9 fŷ.r ex

Y: 0.999962 = r correlation coefficient

X: 3.047425 = ŷ estimation

Method for Exponential

Enter Accumulation data yi gLn xi ∑+
Calculate coefficients fL.R.ex
Estimate ŷ & r for a new x x fŷ.r ex

Logarithmic

y = a.ln(x) + b

Compare to a linear expression y = m.x + c shows the logarithmic curve is linear if we use Ln(x) as we accumulate data points.

The L.R. will provide the actual a and b coefficients.

To estimate ŷ first find the Ln of x then use the fŷ.r

Mechanism

yi Enter xi gLn∑+

Calculate LR Coefficients

fL.R.

Calculate estimated ŷ by finding the Ln of your x value first and then using fŷ.r

xgLnfŷ.r

Example Data

x0.81.72.64.9
y1.51.71.82.1

fClear ∑

1.5 Enter 0.8 gLn∑+

1.7 Enter 1.7 gLn∑+

1.8 Enter 2.6 gLn∑+

2.1 Enter 4.9 gLn∑+

Linear Regression Coefficients : fL.R.

X: 0.324 = a

Y: 1.544 = b

Equation y = 0.324 . Ln(x) + 1.544

Estimate ŷ for X = 3

3 gLn fŷ.r

Y: 0.985 = r, correlation coefficient

X: 1.900 = ŷ, estimation

Method for Logarithmic

Enter Accumulation data yi Enter xi gLn∑+
Calculate coefficients fL.R.
Estimate ŷ & r for a new x xgLn fŷ.r

Power

y = b.xa

This can be rearranged as Ln(y) = Ln(b) + a.Ln(x) or Ln(y) = a.Ln(x) + Ln(b)

Compare to a linear expression y = m.x + c

Our expression will be a straight line if we accumulate Ln(y) and Ln(x)

The coefficients given by the L.R. function will be a and Ln(b) - so to get the real b coefficient we find its antilog ex

We get the estimate for ŷ we first find the Ln of our chosen x and then use the ŷ.r to get Ln(ŷ) and then ex to get ŷ

Mechanism

Accumulate using

yi gLn xi gLn∑+

Calculate LR Coefficients

fL.R.ex

Calculate estimated ŷ

xgLnfŷ.rex

Example Data

x0.61.32.43.6
y1.32.23.34.4

fClear ∑

1.3 gLn 0.6 gLn∑+

2.2 gLn 1.3 gLn∑+

3.3 gLn 2.4 gLn∑+

4.4 gLn 3.6 gLn∑+

Linear Regression Coefficients : fL.R.ex

Y: 0.678 = a

X: 1.837 = b

Equation : y = 1.837x0.678

Estimate ŷ for X = 3

3 gLnfŷ.rex

Y: 1.000 = r, correlation coefficient

X: 3.869 = ŷ, estimation

Method for Power

Enter Accumulation data yi gLn xi gLn∑+
Calculate coefficients fL.R.ex
Estimate ŷ & r for a new x x gLnfŷ.rex

John Pumford-Green 01/02/26 08:42 GMT

Further Information


Navigation