Calculate Expected Value and Variance for Bivariate Normal Distribution
Mostrar comentarios más antiguos
I have a bivariate normal distribution wiyh 1000 samples whose mean is mu = [0, 1] and the covariance matrix is Σ=[1 0.7; 0.7 2]
I need to calculate expected value E[XY] and variance VAR[XY] for this distribution.
And I need to find the sample which represent the E[XY] and variance VAR[XY].
I would be appriciated if you help me :)
mu=[0 1];
cov=[1 0.7; 0.7 2];
rng('default');
R = mvnrnd(mu,cov,1000);
plot(R(:,1),R(:,2),'+');
y = mvnpdf(R,mu,cov);
scatter3(R(:,1),R(:,2),y,'filled')
hold on
axis([-4 4 -4 8 0 0.15])
xlabel('x1')
ylabel('x2')
zlabel('Probability Density')
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Descriptive Statistics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!