1
$\begingroup$

I have this matrix:

X       Y       X*Y     X^2     Y^2     Z 11,16   1,24    13,84   124,55  1,54    22,15 24,20   16,23   392,77  585,64  263,41  2,83 19,85   10,72   212,79  394,02  114,92  7,97 10,35   4,11    42,54   107,12  16,89   22,33 19,72   1,39    27,41   388,88  1,93    16,83 0,00    20,00   0,00    0,00    400,00  34,60 20,87   20,00   417,40  435,56  400,00  5,74 19,99   4,62    92,35   399,60  21,34   14,72 10,28   15,16   155,84  105,68  229,83  21,59 4,51    20,00   90,20   20,34   400,00  15,61 0,00    4,48    0,00    0,00    20,07   61,77 16,70   19,65   328,16  278,89  386,12  6,31 6,08    4,58    27,85   36,97   20,98   35,74 25,00   11,87   296,75  625,00  140,90  4,40 14,90   3,12    46,49   222,01  9,73    21,70 0,00    0,00    0,00    0,00    0,00    58,20 9,66    20,00   193,20  93,32   400,00  4,73 5,22    14,66   76,53   27,25   214,92  40,36 11,77   10,47   123,23  138,53  109,62  13,62 15,10   17,19   259,57  228,01  295,50  12,57 25,00   3,87    96,75   625,00  14,98   8,74 25,00   0,00    0,00    625,00  0,00    12,00 14,59   8,71    127,08  212,87  75,86   14,81 15,20   0,00    0,00    231,04  0,00    21,60 5,23    10,72   56,07   27,35   114,92  26,50 2,14    15,03   32,16   4,58    225,90  53,10 0,51    8,37    4,27    0,26    70,06   49,43 25,00   20,00   500,00  625,00  400,00  0,60 21,67   14,36   311,18  469,59  206,21  5,52 3,31    0,13    0,43    10,96   0,02    44,08 

And I'm trying to solve it, starting by getting it's determinant (after fill it with "1", so it becomes a square matrix).

I tried using Octave, but I got:

error: det: invalid dense matrix type

And trying in MSExcel 2007 I got a value of zero, what is wrong (I don't know the answer, but I know it can't be zero).

Any idea how to solve it (preferable on the computer)?

--reformulating

I have the above 30 values for X, Y and Z, and I need to find the coeficients (a,b,c,d,e,f) for:

$z=a+bx+cy+dxy+ex^2+fy^2$

(the values for [a, b, c, d, e, f] need to work for all lines at the same time)

  • 4
    A 6x30 matrix does not have a determinant... You should probably review what a determinant is.2012-09-20
  • 0
    @MarianoSuárez-Alvarez Correct, someone told me to fill it with "1"s so it will be an square matrix and I can calculate, that's what I'm trying to do.2012-09-20
  • 8
    If you fill with 1's, the new columns will be linearly dependent and the result will be zero.2012-09-20
  • 0
    Only square matrices have determinants. You can ask about the rank of a 6x30 matrix however.2012-09-20
  • 0
    @TomBrito You might want to check out this post http://stackoverflow.com/questions/10646159/error-calculating-matrix-determinant-of-matrix-in-matlab2012-09-20
  • 0
    So, is there another way to solve it? I'm out of ideas...2012-09-20
  • 1
    To solve *what*?2012-09-20
  • 0
    @MarianoSuárez-Alvarez to solve the matrix, to find the unknowns of the equations.2012-09-20
  • 2
    Look up "least squares", Tom.2012-09-20
  • 3
    Tom, "solving the matrix" does not mean anything. What equations do you what to solve? It will probably be best if you explain what you want to do (in the question body, not in comments)2012-09-20
  • 0
    @MarianoSuárez-Alvarez right, did it.2012-09-20
  • 0
    @J.M. I'll take a look if Octave can do that (the point here is that I want to solve using the computer, not by hand).2012-09-20
  • 0
    the values for $a$, $b$, etc, need to work for all lines at the same time?2012-09-20
  • 0
    @MarianoSuárez-Alvarez yes2012-09-20
  • 0
    Since you are looking for the solution to a (seriously overdetermined) linear system of equations, you can either try the "\" operator in Octave, or follow J.M.'s suggesting and apply Least Squares (the latter will probably work much better - unless there is a polynomial of the form you are looking for that fits your data exactly, the first method will fail, while Least Squares will give you a good approximation).2012-09-20
  • 0
    @Johannes, the backslash operator in MATLAB and Octave will in fact solve overdetermined systems in the least-squares sense, if given such a system. See the docs for details.2012-09-21

1 Answers 1