Calculate power regression

1.9k Views Asked by At

I've searched for quite a while, but google has very little on what I actually need.
I have a series of points that form a power function.
How do I calculate the what the power function is?
I can calculate as many x and y pairs as needed.

EDIT: I have not taken either calculus or statistics, so please provide an example that you put through the steps and a basic explanation.

1

There are 1 best solutions below

1
On BEST ANSWER

You want a function of the form $y = a\cdot x^b$, I suppose. First and foremost: to some extent this can be done online. Go to wolframalpha.com, write power fit and your data in brackets {,}, and hit enter. An example
power fit {{1.0, 12.}, {1.9, 10.}, {2.6, 8.2}, {3.4, 6.9}, {5.0, 5.9}}
is calculated here. However, the length of the input is restricted (at least for free users).

For a more detailed solution, we will have to use logarithms and exponential, so for the time being I assume you can do that (sorry if it sounds offensive, but you wanted basic explanation).

Some theory: Let's take the (natural, base $e$) logarithm of the equality (I denote it here "$\log$", some use "$\ln$" or "$\log_e$"): \begin{align} y&= a x^b \qquad /\log(\cdot)\\ \log(y) &= \log(a x^b) = \log(a) + b\log(x)\\ \log(y) &= A + b\log(x) \qquad\text{with } A= \log(a) \end{align} That is, $\log(y)$ is depends linearly on $\log(x)$. To get the relationship for $(x,y)$, just exponentialize: \begin{align} e^{\log(y)} &= e^{(A + b\log(x))} = e^A \cdot x^b\\ y &= e^A \cdot x^b = a \cdot x^b \end{align}

What you actually have to do:

  1. Given your $(x,y)$ pairs, compute their logarithms $(\log(x), \log(y)) \stackrel{\text{denote}}{==} (x', y')$.
  2. Find the best-approximating linear relationship (ie, perform the linear regression) for the pairs $(x', y')$.
  3. You will get some relationship, let's denote it $y' = A + bx'$. Then for the $(x,y)$ data the relationship you want is $$ y = e^A \cdot x^b = \exp(A)\cdot x^b. $$

Remarks:

  1. You can use logarithm of any base, but then you have to change $e$ for the base. So for the decimal logarithm $\text{lg}(\cdot) = \log_{10}(\cdot)$ use $a = 10^A$, and for the binary logarithm $\text{lb}(\cdot) = \log_{2}(\cdot)$, use $a = 2^A$.
  2. If you don't know logarithms and exponentiation, that's little problem, provided you've got sufficient tools: a sophisticated calculator, MS Excel (or OpenOffice Calc), or a mathematical software like Mathematica, Maple or Maxima. To some extent, this can be done online, eg Wolfram|Alpha. Usually logarithm is denoted by "$\log$", and exponentiation by "$\exp$" or $e^x$.
  3. Same goes with the linear regression, only that this depends heavily on the tool you use, so if you'd like help with that, you better say, what you can use. Also, some of them can do the power regression straight away, so you only give data and the software produces the best
    $a$ and $b$.