Cannot get determinant of matrix

7

I have the following variables

Σ = {{64, 40.8, 80}, {40.8, 289, 238}, {80, 238, 400}};
μ = {{9}, {12}, {15}};
ι = {{1}, {1}, {1}};

And then I define the following matrix:

A = {{Transpose[μ].Inverse[Σ].μ, 
Transpose[μ].Inverse[Σ].ι}, {Transpose[μ].Inverse[Σ].ι, 
Transpose[ι].Inverse[Σ].ι}};

Which gives me the matrix:

enter image description here

Now when I try to get the determinant of the matrix i get an error: enter image description here

Any1 know what the problem is?

user49495

Posted 2017-06-13T09:09:58.983

Reputation: 71

Det will take the determinant of a symbolic matrix, so you could also use something like Det[A] /. {\[CapitalSigma] -> {{64, 40.8, 80}, {40.8, 289, 238}, {80, 238, 400}}, \[Mu] -> {9, 12, 15}, \[Iota] -> {1, 1, 1}} with A as defined below by Bob Hanlon (https://mathematica.stackexchange.com/a/148259/106) – user1066 – 2017-06-13T14:34:19.483

Answers

11

Mathematica does not distinguish between row and column vectors ("The Wolfram Language represents vectors as lists, and never needs to distinguish between row and column cases."). Consequently, change your definitions of μ, ι, and A.

Σ = {{64, 40.8, 80}, {40.8, 289, 238}, {80, 238, 400}};
μ = {9, 12, 15};
ι = {1, 1, 1};

(A = {{μ.Inverse[Σ].μ, μ.Inverse[Σ].ι}, 
  {μ.Inverse[Σ].ι, ι.Inverse[Σ].ι}}) // MatrixForm

enter image description here

Det[A]

0.0021282

Bob Hanlon

Posted 2017-06-13T09:09:58.983

Reputation: 95 281

5

The problem is the structure of A. You need to use Flatten and First to get rid of the curly around each number.

Σ = {{64, 40.8, 80}, {40.8, 289, 238}, {80, 238, 400}};
μ = {{9}, {12}, {15}};
ι = {{1}, {1}, {1}};

A = {{First@Flatten[Transpose[μ].Inverse[Σ].μ], 
   First@Flatten[Transpose[μ].Inverse[Σ].ι]}, {First@
    Flatten[Transpose[μ].Inverse[Σ].ι], 
   First@Flatten[Transpose[ι].Inverse[Σ].ι]}};

A // TraditionalForm

Blockquote

Det[A]

0.0021282

zhk

Posted 2017-06-13T09:09:58.983

Reputation: 11 475

4

What you have constructed is a four-dimensional array (matrix of matrices).

To contruct a normal two-dimensional matrix from two-dimensional blocks use ArrayFlatten:

A = ArrayFlatten[{{Transpose[μ].Inverse[Σ].μ, Transpose[μ].Inverse[Σ].ι}, 
                  {Transpose[μ].Inverse[Σ].ι, Transpose[ι].Inverse[Σ].ι}}];
{{1.41771,  0.151394 }, 
 {0.151394, 0.0176682}}

Shadowray

Posted 2017-06-13T09:09:58.983

Reputation: 7 556