Power law model fitting

Returning to the example involving power laws, we ask the question of finding the ‘‘best’’ model of the form

 y = C x_1^{a_1} ldots x_n^{a_n},

given experiments with several input vectors x^{(i)} and associated outputs y_i, i=1,ldots,m. Here the variables of our problem are C, and the vector a in mathbf{R}^n. Taking logarithms, we obtain

 tilde{y}_i = a^Ttilde{x}^{(i)} + b, ;; i=1,ldots,m.

We can write the above linear equations compactly as

 left(begin{array}{c} y_1  vdots  y_m end{array}right) = left(begin{array}{cc} tilde{x}_1^T & 1  vdots & vdots  tilde{x}_m^T & 1 end{array}right) left(begin{array}{c} a  b end{array}right).

In practice, the power law model is only an approximate model of the reality. Finding the best fit can be addressed via the optimization problem

 min_{z} : |X^Tz-y|_2,

where z = (a,b) in mathbf{R}^{n+1}, X in mathbf{R}^{(n+1) times m}, with i-th column given by (tilde{x}_1, 1).

See also: Power laws.