MATLAB Answers

0

What is the difference between rand and copularand

Asked by SOUVIK DATTA on 19 Jul 2019
Latest activity Edited by the cyclist
on 21 Jul 2019
Hello, I am searching for some answers regarding copularand. Please help me providing some light on this topic.
What is the difference between rand and copularand?
When I am going to apply copulacdf on some data, do I need to feed the rank transformation of the given data(rank CDF) or data transformed by copularand (like for every different copulacdf (gaussian or gumbel or frank etc.), we need to transform data accrodingly )?
what is the application of copularand? where to use the copularand transformation as input?
thank you.

  0 Comments

Sign in to comment.

Products


Release

R2019a

1 Answer

Answer by the cyclist
on 19 Jul 2019
Edited by the cyclist
on 20 Jul 2019
 Accepted Answer

It's a little difficult to know where to start with an explanation? Do you know what a copula is, and why it is used? If not, maybe start by reading this wikipedia article.
I guess I would say that the main difference between rand and copularnd is that rand is for generating random numbers in one variable from a uniform distribution, and copularnd is for generating multiple variables, related by the copula.
See the following code, which is a slight variation on the example from the documentation for copularnd.
rng default % For reproducibility
tau = -0.8;
rho = copulaparam('Gaussian',tau);
u = copularnd('gaussian',rho,1000);
figure
scatterhist(u(:,1),u(:,2))

  2 Comments

Sir,
Thank you for your reply. All I need to know if I want to calculate cpolacdf for some random variables, whichone (rand or copularnd) is to use?
I find your questions confusing.
copulacdf will calculate the cdf for either type of input. Neither rand nor copularnd is "correct" or "incorrect". They simply calculate different things (as I explained in my answer).
You use the phrase "transform the data" a couple of times. rand and copularnd do not transform data. They generate random data. Do you already have the data, or are you trying to generate random numbers?
Sorry, but I just can't figure out what inputs you have, or what you are really trying to do. That makes it impossible to help you. (It's probably partly a language barrier, too.)

Sign in to comment.