Message Boards Message Boards

0
|
2946 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:
GROUPS:

Question on the Covariance mathematica definition.

Posted 11 years ago
Hi, I have a question on the official description of the covariance in Mathematica.

On the "detail" section, they say that they define covariance as the following:

Covariance[v1, v2] is equivalent to (v1-Mean[v1]). Conjugate[v2-Mean[v2]]/(Length[v1]-1)

-> I can get some idea on the part of "(v1-Mean[v1])" but I don't know why there is a dot "." after that

and there is an expression like "Conjugate[v2-Mean[v2]]/(Length[v1]-1)"

I thought it should be more lile [v1-Mean[v1]][v2-Mean[v2]]/(Length[v1]-1).

I don't know what the dot "." means and also what the "Conjugate" has to do with calculating the covariance/

Could you please help me out with this?


Thank you very much!
POSTED BY: Woo Young Kang
2 Replies
Posted 11 years ago
"." (or period or Dot) is the matrix or vector multiply operator. * is the scalar multiplaction operator.
These are commonly misunderstood and incorrectly used by new users.
* and + and - when used between a vector and a scalar distributes the scalar operation over the vector.
Mathematica by default almost always assumes values can be complex numbers, so it will sometimes
use Conjugate when you might not think of using this if you are thinking only of real numbers.
In[1]:= {a, b}.{3, 2}

Out[1]= 3 a + 2 b

In[2]:= {3, 2}-Mean[{3, 2}]

Out[2]= {1/2, -1/2}
POSTED BY: Bill Simpson
Posted 11 years ago
Thanks again!

So, if I want to disregard the imaginary number part for the covariance matrix by using the following code:

cv = Covariance[Table[u[i, t] - u[i, t - 1], {t, 1, 3}, {i, 1, 2}]];
m = Simplify[cv, Element[u[_, _], Reals]]

-> Then, is this "m" can be SAFELY assumed to be the resulting covariance matrix only on the real number environment
just like any normally pratical usage like in business?

Again, thank you very much!
POSTED BY: Woo Young Kang
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract