How to obtain the 3 × 3 symmetric covariance matrix of a 3x1 matrix?
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
A 3x1 matrix A = [1; 2; 3]. Use function cov and the result is cov(A) = 1.
Can A have a 3 × 3 symmetric covariance matrix? Thank you
2 Kommentare
Antworten (2)
Matt J
am 1 Okt. 2021
cov(A) considers the rows of A to be different observations and the columns of A to be different variables. So, if A is 3x1, then you have 1 variable. Therefore, its covariance matrix will be a 1x1 matrix, i.e., a scalar consisting of the variance of the observations. This confirms that cov() gave you the right result:
var([1;2;3])
0 Kommentare
John D'Errico
am 1 Okt. 2021
Bearbeitet: John D'Errico
am 1 Okt. 2021
If all you have are three numbers, then a covariance matrix is meaningless. There are two cases we might consider, since I have no idea what you think you have.
- If they are three independent values, so three samples form a single distributino, then at best, you can compute a variance. But just a single variance, of the three numbers.
- If they represent ONE sample from some distribution of points in some three dimensional space, then you have only ONE point. Again, a covariance matrix is impossible to determine.
If you think you need a 3x3 covariance matrix, then it must be case #2. But as I said, then you have only ONE data point. You cannot determine a covariance matrix from one piece of information. The covariance matrix you desire to compute is undefined. In fact, the only valid covariance matrix from that single piece of information will be effectively
NaN(3,3)
Why is that? Because the computation of said covariance matrix will involve the value
0/0
for all 9 elements of that matrix.
So while the underlying process that generated the vector may have a well defined covariance matrix, you cannot compute it from one vector. You need more data.
You cannot squeeze blood from a rock. Well, you might get blood if you try, but if you look at your hands, the blood came from your own fingers. Sorry.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Hypothesis Tests finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!