Generating correlated QUASI random numbers

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












Hi I am trying to generate correlated quasi random numbers using a sobol sequence in matlab. My Problem is the Following: Using "standard" random numbers it is easy to generate the 6 correlated random variables (NumberOfSteps X NumberOfSimulations) I need, using a cholesky decomposition:



L = chol(CorrelationMatrix,"lower");

for i=1:NumberOfSimulations

Z = L*randn(4,NumberOfSteps);

for t=2:NumberOfSteps

.....Z1(i,t);

.....Z2(i,t);



Since i only want to generate the sequence once (very time consuming) the only way i found to generate two correlated r.v. is the following:



Ps = sobolset(NumberOfSteps);

Ps = scramble(Ps,'MatousekAffineOwen');

U = net(Ps,NumberOfSimulations);

Z1 = norminv(U);



Z2 = Rho.*Z1 + sqrt(1-Rho^2).*randn(NumberOfSimulations,NumberOfSteps);



Unfortunately I have No idea how I can extend this to 6 correlated random varibles. Can anyone help me?



Best regards,
Alex







share|cite|improve this question















  • 1




    Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to.
    – José Carlos Santos
    Aug 1 at 10:37














up vote
0
down vote

favorite












Hi I am trying to generate correlated quasi random numbers using a sobol sequence in matlab. My Problem is the Following: Using "standard" random numbers it is easy to generate the 6 correlated random variables (NumberOfSteps X NumberOfSimulations) I need, using a cholesky decomposition:



L = chol(CorrelationMatrix,"lower");

for i=1:NumberOfSimulations

Z = L*randn(4,NumberOfSteps);

for t=2:NumberOfSteps

.....Z1(i,t);

.....Z2(i,t);



Since i only want to generate the sequence once (very time consuming) the only way i found to generate two correlated r.v. is the following:



Ps = sobolset(NumberOfSteps);

Ps = scramble(Ps,'MatousekAffineOwen');

U = net(Ps,NumberOfSimulations);

Z1 = norminv(U);



Z2 = Rho.*Z1 + sqrt(1-Rho^2).*randn(NumberOfSimulations,NumberOfSteps);



Unfortunately I have No idea how I can extend this to 6 correlated random varibles. Can anyone help me?



Best regards,
Alex







share|cite|improve this question















  • 1




    Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to.
    – José Carlos Santos
    Aug 1 at 10:37












up vote
0
down vote

favorite









up vote
0
down vote

favorite











Hi I am trying to generate correlated quasi random numbers using a sobol sequence in matlab. My Problem is the Following: Using "standard" random numbers it is easy to generate the 6 correlated random variables (NumberOfSteps X NumberOfSimulations) I need, using a cholesky decomposition:



L = chol(CorrelationMatrix,"lower");

for i=1:NumberOfSimulations

Z = L*randn(4,NumberOfSteps);

for t=2:NumberOfSteps

.....Z1(i,t);

.....Z2(i,t);



Since i only want to generate the sequence once (very time consuming) the only way i found to generate two correlated r.v. is the following:



Ps = sobolset(NumberOfSteps);

Ps = scramble(Ps,'MatousekAffineOwen');

U = net(Ps,NumberOfSimulations);

Z1 = norminv(U);



Z2 = Rho.*Z1 + sqrt(1-Rho^2).*randn(NumberOfSimulations,NumberOfSteps);



Unfortunately I have No idea how I can extend this to 6 correlated random varibles. Can anyone help me?



Best regards,
Alex







share|cite|improve this question











Hi I am trying to generate correlated quasi random numbers using a sobol sequence in matlab. My Problem is the Following: Using "standard" random numbers it is easy to generate the 6 correlated random variables (NumberOfSteps X NumberOfSimulations) I need, using a cholesky decomposition:



L = chol(CorrelationMatrix,"lower");

for i=1:NumberOfSimulations

Z = L*randn(4,NumberOfSteps);

for t=2:NumberOfSteps

.....Z1(i,t);

.....Z2(i,t);



Since i only want to generate the sequence once (very time consuming) the only way i found to generate two correlated r.v. is the following:



Ps = sobolset(NumberOfSteps);

Ps = scramble(Ps,'MatousekAffineOwen');

U = net(Ps,NumberOfSimulations);

Z1 = norminv(U);



Z2 = Rho.*Z1 + sqrt(1-Rho^2).*randn(NumberOfSimulations,NumberOfSteps);



Unfortunately I have No idea how I can extend this to 6 correlated random varibles. Can anyone help me?



Best regards,
Alex









share|cite|improve this question










share|cite|improve this question




share|cite|improve this question









asked Aug 1 at 10:34









Vanity

12




12







  • 1




    Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to.
    – José Carlos Santos
    Aug 1 at 10:37












  • 1




    Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to.
    – José Carlos Santos
    Aug 1 at 10:37







1




1




Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to.
– José Carlos Santos
Aug 1 at 10:37




Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to.
– José Carlos Santos
Aug 1 at 10:37















active

oldest

votes











Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2868932%2fgenerating-correlated-quasi-random-numbers%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2868932%2fgenerating-correlated-quasi-random-numbers%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What is the equation of a 3D cone with generalised tilt?

Color the edges and diagonals of a regular polygon

Relationship between determinant of matrix and determinant of adjoint?