comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Help needed!!
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Help needed!! [message #70506 is a reply to message #70504] Fri, 16 April 2010 09:40 Go to previous messageGo to previous message
bala murugan is currently offline  bala murugan
Messages: 23
Registered: April 2010
Junior Member
On Apr 16, 10:33 am, pp <pp.pente...@gmail.com> wrote:
> On Apr 16, 1:18 pm, bala murugan <bala2...@gmail.com> wrote:
>
>
>
>
>
>> My aim is to do the following,
>
>> To write an IDL routine that takes as input the mean of a Poisson
>> distribution (fLambda = a floating point number >= 0.0) and a number
>> of realizations (N), and generates N samples from the Poisson
>> distribution with mean fLambda.  The output samples should be provided
>> as a vector (list) of integers (each >= 0).  I will also want to plot
>> a histogram of the samples (IDL probably has a built-in histogramming
>> routine).
>
>> My subroutine/program will look something like this...
>
>> piSamples = PoissonDist(fLambda, N)
>>         piSamples = vector of N integer samples returned by the routine
>>         fLambda = mean of the Poisson distribution
>>         N = number of samples to generate
>
>> This routine will need to loop n = 1..N  Each time through the loop,
>> it will need to call RANDOMU to get a random number between 0.0 and
>> 1.0.  It will then need to call IMSL_POISSONCDF (probably repeatedly)
>> to determine which integer in the Poisson distribution corresponds to
>> the random number gotten from RANDOMU.  This integer is then placed in
>> the output vector, etc.
>
>> I am not using IMSL_POISSONCDF. Rather I am calculating the poisson
>> probability myself.
>
>> Can you please help me with this?
>
> Better now, but you still did not say what the problem is. One problem
> that is obvious is the line
>
> if (x EQ r) THEN a[i]=j
>
> since neither a or i exist at that point. And that condition is
> probably never going to be true.

@pp

Can you please go through the summary of what I want to accomplish and
suggest me some method to do it?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: GridData Conundrum
Next Topic: Comparison operators and floating-point errors

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 16:17:49 PDT 2025

Total time taken to generate the page: 0.00416 seconds