test_sampling2 - -0.08-0.10 1.00 0.33 0.33-0.36 0.37 0.27...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% example of sampling with corr matrix that is not positive definite clear all c nsample=100; % no of random samples to be drawn nvar=8; % no of variables n xmean=[10 5 4 3 20 10 50 2]; % mean xsd= [1 1 0.1 1 1 2 5 1]; % std. deviation % correlation matrix corr=[ 1.00 0.45 -0.85 0.27 0.27 0.22 -0.38 0.37 0.45 1.00 -0.85 -0.08 0.18 0.09 -0.21 0.20 -0.85 -0.85 1.00 -0.10 -0.27 -0.18 0.34 -0.33 0.27
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: -0.08 -0.10 1.00 0.33 0.33-0.36 0.37 0.27 0.18-0.27 0.33 1.00 0.94 0.46-0.45 0.22 0.09-0.18 0.33 0.94 1.00 0.54-0.53-0.38 -0.21 0.34-0.36 0.46 0.54 1.00-1.00 0.37 0.20-0.33 0.37-0.45 -0.53 -1.00 1.00]; 1 T=chol(corr); % correlation matrix is not quite positive definite T %use lhs_iman_n z=lhs_iman_n(xmean,xsd,corr,nsample); mean(z) std(z) corrcoef(z)...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern