What is: cdfn(sqrt(rho)*rndn(1,Ns) + sqrt(1-rho)*rndn(N,Ns))
Bill Denney
bill at denney.ws
Sat Jun 21 11:54:10 CDT 2008
Jaroslav Hajek wrote:
> On Mon, Jun 16, 2008 at 5:58 PM, pierrreg
> <pierre.gazzano at morganstanley.com> wrote:
>
>> I don't know if this code is an Octave code, but if it is, I would like to
>> know what this code does:
>>
>> cdfn(sqrt(rho)*rndn(1,Ns) + sqrt(1-rho)*rndn(N,Ns))
>>
>> I guess that cdfn is the cumulative distribution function
>> and rndn is a random generator that generates a random variable between 0
>> and 1.
>>
>> assuming that Ns=1000, N=100, rho=0.5
> rndn could be randn - normal random number generator. I have no idea
> what "cdfn" could correspond to.
>
I would guess that cdfn is looking for a cumulative distribution
function. It appears that the goal is to have an experimental
cumulative distribution function (as opposed to a theoretical one). To
do that, you're probably wanting the function cumsum. If you're wanting
the theoretical cdf (i.e. one where you would provide a mean and
standard deviation), you may want something like normcdf (or for a
non-normal distribution, there are others).
Have a good day,
Bill
More information about the Help-octave
mailing list