Solving this system of equations.

Click For Summary

Discussion Overview

The discussion revolves around solving a system of equations related to calibrating sensor input values. Participants explore methods for finding the best fit values for parameters G, B, and C based on given sets of variables (v, r, g, b, and a), with considerations of whether the equations are linear or non-linear.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant suggests that the system of equations can be solved for G, B, and C, noting specific conditions under which the system is soluble based on the values of v.
  • Another participant proposes using a non-linear optimization tool to minimize a specific objective function related to the calibration problem, suggesting that common choices for the optimization parameter are 1 and 2.
  • A different viewpoint indicates that the problem may not be inherently non-linear and suggests a rearrangement of the equation to minimize a different objective function, potentially leading to explicit formulas through calculus.
  • Further discussion raises concerns about the optimality conditions of the proposed methods, questioning whether least squares is the appropriate approach and suggesting that the problem could also be treated probabilistically.

Areas of Agreement / Disagreement

Participants express differing opinions on whether the equations are linear or non-linear, and there is no consensus on the best method for solving the calibration problem. Multiple competing views remain regarding the appropriate optimization techniques and conditions.

Contextual Notes

Participants highlight the importance of the number of linearly independent equations and the implications for the existence of solutions. There are also discussions about the assumptions underlying different optimization approaches and the potential need for numerical methods.

jasonc
Messages
6
Reaction score
0
I have a personal project I'm working on that involves calibrating some values from a sensor input. So far I've been doing the calibrations in a very tedious manner but I'd like to write a program to solve the calibration for me. Very long story very short, this basically boils down to the following:

I have this equation:

View attachment 220

I have a set of many v, r, g, b, and a values (v is either 0 or 1, a is a known constant, r g b vary between 0 and 1), and I want to find the best fit values for G, B, and C.

Is this possible? I don't know much about linear equations but I don't think this is one. Can anybody recommend any methods for solving these?

Thanks!
J
 

Attachments

  • math_image.gif
    math_image.gif
    393 bytes · Views: 116
Physics news on Phys.org
jasonc said:
I have a personal project I'm working on that involves calibrating some values from a sensor input. So far I've been doing the calibrations in a very tedious manner but I'd like to write a program to solve the calibration for me. Very long story very short, this basically boils down to the following:

I have this equation:
I have a set of many v, r, g, b, and a values (v is either 0 or 1, a is a known constant, r g b vary between 0 and 1), and I want to find the best fit values for G, B, and C.

Is this possible? I don't know much about linear equations but I don't think this is one. Can anybody recommend any methods for solving these?

Thanks!
J

Hi jasonc, :)

What you have is a system of equations which you have to solve for \(G,\,B,\mbox{ and }C\).

Whenever, \(v=1\),

\[1=\frac{-gG-bB+r-C}{-gG-bB+r-C}\Rightarrow r=a\]

Hence the set of values that you have should meet the criteria, \(r=a\) whenever \(v=1\). Otherwise this system is not soluble.

Whenever, \(v=0\),

\[0=\frac{-gG-bB+r-C}{-gG-bB+r-C}\Rightarrow -gG-bB+r-C=0\]

When you plug in values for \(r,\,g,\,b\) you have a set of equations with three variables, \(G,\,B,\mbox{ and }C\). If you have more than three linearly independent equations then the system doesn't have a solution. If there are exactly three linearly independent equations then the system has a unique solution. If the number of linearly independent equations are less than two the system will have infinitely many solutions.

Kind Regards,
Sudharaka.
 
jasonc said:
I have a personal project I'm working on that involves calibrating some values from a sensor input. So far I've been doing the calibrations in a very tedious manner but I'd like to write a program to solve the calibration for me. Very long story very short, this basically boils down to the following:

I have this equation:

View attachment 220

I have a set of many v, r, g, b, and a values (v is either 0 or 1, a is a known constant, r g b vary between 0 and 1), and I want to find the best fit values for G, B, and C.

Is this possible? I don't know much about linear equations but I don't think this is one. Can anybody recommend any methods for solving these?

Thanks!
J

You want a non-linear optimisation tool that finds the minimum of:

\[ \rm{ Ob(G,B,C)=\sum_i \left|v_i-\frac{-g_iG-b_iB+r_i-C}{-g_iG-b_iB+a-C}\right|}^{\alpha} \]

Usual choices of \(\alpha\) are 1 and 2 (2 is better as systems that assume smoothness will work better).

I would initially suggest you look at the (non-linear) solvers that ship with Excel and/or Gnumeric.

CB
 
I'm not so sure it's nonlinear. Consider that you can re-arrange the equation thus:

$$va-r=(v-1)gG+(v-1)bB+(v-1)C=(v-1)(gG+bB+C).$$

Thus, you could try minimizing the difference

$$Ob(G,B,C)=\sum_{i}\left(v_{i}a-r_{i}+(1-v_{i})(g_{i}G+b_{i}B+C)\right)^{2}.$$

You might even be able to derive the explicit formulas you need by using the standard calculus treatment of setting the derivatives

$$\frac{\partial Ob}{\partial G}=\frac{\partial Ob}{\partial B}=\frac{\partial Ob}{\partial C}=0.$$
 
Ackbach said:
I'm not so sure it's nonlinear.

I'm not sure I said it was intrinsically non-linear, only that it could be solved fairly easily with a non-linear optimisation tool. But in the sense of mathematical programing it is non-linear.

In terms of regression it can be reduced to a linear least squares problem, but are we sure that least squares is the desired optimality condition, also you are not now minimising the sum of square resiuals between the variable of interest and the model. So you have lost any obvious sense in which this is a good fit, that is you have introduced an optimality condition different from minimising the sum some strictly increasing function of the absolute residuals (or some even more general function of the residuals).

If you want to go down this route either you need to prove that the two solutions are the same, or invoke the principle of "good enough for government purposes".

CB

PS I know that I did not leave the optimality condition fully general, but least squares or least absolute value are the two most popular optimality conditions.

PPS Another approach to to treat this a probabilistic problem were the RHS is the probability of v being 1, then we could go down the route of a maximum likelihood (or maximum posterior probability) estimator for the model paramenters - but we would still probably end up with a numerical non-linear least squares problem to solve. See my warship battle-damage survival probability paper for an example of this approach.
 
Last edited:

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 7 ·
Replies
7
Views
1K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K