How to create two independent Normal distribution ?
18 views (last 30 days)
Show older comments
Commented: Masoud Dorvash on 2 Jan 2021
I want to create two (or more) independent distributions, then I want to find the Covariance of them.
My problem is how to define two independent distributions.
X = makedist('Normal');
Y = makedist('Normal');
Z = X + Y;
Here, I can't add these two distributions, even I don't know if they are independent or not.
Ive J on 2 Jan 2021
Edited: Ive J on 2 Jan 2021
You basically can generate multiple independent normal random variables form a multivariate normal dist. You just need to define var-covar matrix properly. So, to generate two iid vectors, you can generate them from a bivariate normal dist:
mu = [0 0];
Sigma = [1 0; 0 1]; % set off diagonals to zero
X = mvnrnd(mu, Sigma, 1e5);
% visual examination
% are they really independent?
More Answers (0)
Find more on Exponential Distribution in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!