What is the difference between rand and copularand

1 view (last 30 days)
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.

Accepted Answer

the cyclist
the cyclist on 19 Jul 2019
Edited: the cyclist on 20 Jul 2019
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
SOUVIK DATTA
SOUVIK DATTA on 20 Jul 2019
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?
the cyclist
the cyclist on 21 Jul 2019
Edited: the cyclist on 21 Jul 2019
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.

More Answers (0)

Products


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!