Linear regression applied to a fraction

53 Views Asked by At

Let's say I have two parameters to measure in an experiment: $A$ and $B$. Now I compose some hypothetical formula to calculate a parameter of interest ($C$) based on these parameters with assigned weights. However, I need to use more peculiar formula rather than a simple linear one $C=\frac{w_{1}*A+w_{2}*B}{w_{1}*A-w_{2}*B}$. As usually, I have some trained data (measured $A$ and $B$ and corresponding known labels $C$ for a decent number of samples) and would like to train weights $w_{1},w_{2}$ to be able to predict parameter $C$ for a new testing data based on measured $A$ and $B$. Is it possible to apply linear regression to the fracture?

1

There are 1 best solutions below

1
On BEST ANSWER

You can rewrite that as $\frac {w_1} {w_2} A (C-1) = B (C+1)$, so yes, you can use linear regression to the pairs $(A(C-1), B(C+1))$ to estimate $w_1/w_2$.

Whether you really want this expression, however, depends upon your model. As you can see, there is only one parameter to the regression, not two.
The fact that you say you want to "train weights" calls an analogy with neural networks. Where there is usually a bias added to the linear weighted sum, and that bias is learned too. Don't you want a bias in your expression?