Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

transforming the distribution of variables

Asked by John on 4 Apr 2012

Hello,

Would anybody know if there is a function in matlab to transform a continuous random variable x to a uniform distribution by using a cumulative distribution function (cdf) transformation?

http://en.wikipedia.org/wiki/Probability_integral_transform

Any comments and suggestions welcome.

Thank you

John

0 Comments

John

Tags

Products

No products are associated with this question.

1 Answer

Answer by Oleg Komarov on 4 Apr 2012
Accepted answer

You can call cdf specifying the type of distribution or you can call directly the specific distribution function. For a list of supported cdfs: cumulative distributions.

An example:

x = randn(1000,1);
y = normcdf(x,0,1);
hist(y,100)

2 Comments

John on 4 Apr 2012

Hello Oleg,
Thank you for your reply.
So as I understand this, using the cdf function returns the cumulative distribution of the data of a specified distribution.

Would you know how I could use the cdf to then transform the continuous random variable to a uniform distribution?

Apologies if this sounds like a silly question, I only have basic statistics?

Thank you

John

Oleg Komarov on 4 Apr 2012

The Cumulative Distribution Function (CDF) maps some values into [0,1], i.e. uniform distribution on [0,1].

Oleg Komarov

Contact us