finding multivariate pdf of normally distributed data?

1 回表示 (過去 30 日間)
Hydro
Hydro 2014 年 10 月 1 日
コメント済み: José-Luis 2014 年 10 月 2 日
Assume my data is multivariate normally distributed. how i can plot the pdf of my first variable? say I have data matrix below with four variables
A =
5 11 10 8
9 7 6 12
4 14 15 1
4 14 15 1
9 7 6 12
my mean is say
M=
4 14 15 1
my covariance matrix is
Cov=
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
I used mvnpdf(A(:,1),M(:,1),cov(:,1)). any help would be appreciated.
  1 件のコメント
José-Luis
José-Luis 2014 年 10 月 2 日
Cov is not a covariance matrix.

サインインしてコメントする。

回答 (1 件)

SK
SK 2014 年 10 月 2 日
Do you want the histogram of the data. If so, use the hist() function.
If you want a theoretical normal marginal pdfs from the covariance and mean, use the diagonal terms from the covariance matrix as the variance for each variable. So for example, for the first variable:
x = 4-3*16 : 0.01 : 4+3*16;
y = pdf('normal', x, 4, 16);
plot(x(:), y(:));

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by