Generate Two Correlated Random Vectors In Matlab

  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Generate Two Correlated Random Vectors In Matlab as PDF for free.

More details

  • Words: 46
  • Pages: 1
%%% Program by Hammad Munawar (www.hammadmunawar.weebly.com) %%% IAA, Islamabad, Pakistan % %%% Create two random vectors with mean=100,sd=10,correlation=0.5 % mean=100;%mean sd=10;%standard deviation corr_mat=[1 0.5;0.5 1];%correlation matrix L=chol(corr_mat);%cholesky factorization U=mean+sd.*rand(100,2);%generate random vectors with specified mean and sd U=U*L;%set correlations x=U(:,1);%first random vector y=U(:,2);%second random vector corr(x,y)%verify correlation

Related Documents