1

I have two variables and a single output for example:
$$x_1=\{0.2,0.4,0.6\} , x_2=\{0.2,0.6,1.9\} , y=\{10, 18, 30\}$$

I want to find an equation to obtain y from both $x_1$ and $x_2$: $y=f(x_1,x_2)$

What kind of equation is suitable for this problem and how to find the coefficients? I am not sure but some equations by googling is:
$$y=x_1^{\alpha}\cdot x_2^{\beta}$$

Find best alpha beta using dataset or maybe bivariate normal distribution
Thanks for your help in advance

callculus42
  • 30,550
saeed
  • 21

1 Answers1

2

The function $y=e^{\gamma}\cdot x_1^{\alpha}\cdot x_2^{\beta}$ fits the data quite well. $e^{\gamma}$ is a constant

To apply linear regression, you have to linearize the equation.

$ln(y)=ln(e^{\gamma}\cdot x_1^{\alpha}\cdot x_2^{\beta})$

$ln(y)=\gamma+\alpha \cdot ln(x_1)+\beta \cdot ln(x_2)$

First you have to transform the values of $y, x_1$ and $x_2$ in ln-values. I inserted the values in a table:

enter image description here

After applying linear regression the equation is:

$y = 0.3290563948\cdot x_1 + 0.327415062\cdot x_2 + 3.359135209$

And the regression line is $y_i=e^{3.359135209}\cdot x_{1i}^{0.3290563948}\cdot x_{2i}^{0.327415062}$

Inserting the values for i=1

$e^{3.359135209}\cdot 0.2^{0.3290563948}\cdot 0.2^{0.327415062}=10$

Inserting the values for i=2

$e^{3.359135209}\cdot 0.4^{0.3290563948}\cdot 0.6^{0.327415062}=18$

Thus there is more or less no difference between $y_i$ and the estimated $y_i$.

callculus42
  • 30,550
  • Don't you think that this is normal with $3$ parameters and $3$ data points ? – Claude Leibovici Jun 16 '15 at 05:49
  • @ClaudeLeibovici Yes, it is not surprisingly. – callculus42 Jun 16 '15 at 05:59
  • Thanks for your answer. The function seems very useful. could you please explain the reason for using this function with exponential constant? what is the advantage compared to simple linear regression. Is there any reference for this function or Does this fitting function has a special name in mathematics that I can study more? – saeed Jun 16 '15 at 07:10
  • @saeed Linear regression deals with linear functions. Linear functions have, in general, a constant. $y=a_0+a_1x_1+a_2x_2+a_3x_3+...+a_nx_n$. The móre parameters a function has, the better is the fitting. Thus it is useful to calculate with a constant. It is a exponential regression. By transforming the values you can apply the linear regression. – callculus42 Jun 16 '15 at 07:33