Re: uniform distribution with a random dimension usign IMSL



On 16 Feb 2007 16:32:53 -0800, fortee wrote:
I tried to made a code with a poisson and a uniform distribution in
IMSL. There is no problem in compiling the following code in Intel
Fortran Complier. But when I try to execute the code, a error message
pops up.

I want to draw a vector x1 from a unifrom distribution[0,1] with a
random dimension (n) which is drawn from a poisson distribution(mean
5000). I mean

iter1 x1(4999 dimension)
iter2 x1(4988 dimension)
...
iter10 x1(4898 dimension)

Dimensions are random

Please help me. I am so frustrated now.



program brownian

INCLUDE 'link_f90_static.h'


use rnpoi_int
use rnset_int
use rnun_int


implicit none


integer, dimension(1)::len
integer:: i
real, parameter:: ns=5000
integer, dimension(1):: dummy

integer:: N
real, allocatable::x1(:)

real:: dum
integer, parameter:: r=10

real:: ks(r)

do i=1,r
call rnpoi(ns, len)
dummy(:)=len
N=dummy(1)

allocate(x1(N))

call rnun(x1)

ks(r)=sum(x1)
enddo


dum=sum(ks)/r


end program brownian

Your IMSL calls appear to be ok. The problem is that you have an
ALLOCATE statement inside a DO loop, but no DEALLOCATE anywhere. This
results in an error when you attempt to allocate the same array for the
second time.



--
Dave Seaman
U.S. Court of Appeals to review three issues
concerning case of Mumia Abu-Jamal.
<http://www.mumia2000.org/>
.



Relevant Pages

  • Re: uniform distribution with a random dimension usign IMSL
    ... But when I try to execute the code, a error message ... random dimension which is drawn from a poisson distribution(mean ... Your IMSL calls appear to be ok. ... ALLOCATE statement inside a DO loop, ...
    (comp.lang.fortran)
  • Re: Error processing cube with disabled lowest level of shared dimension
    ... come across the error message you described if the error condition ... SRL wrote: ... Dimension is snow-flaked. ... > When processing the cube, I get a 'member with key '' was found ...
    (microsoft.public.sqlserver.olap)
  • Re: The attribute key cannot be found (a new twist in the story)
    ... Not sure whether this fits your scenario, but I've seen this error message on ... I have actually solved my problem by deleting the dimension and creating it ... it will cause key errors during cube ... I'd run a trace (if you're using SQL Server RDBMS) to ...
    (microsoft.public.sqlserver.olap)
  • Re: suggestion for new intrinsic function: CONFORM
    ... thing I do is check that the dimension are what I expect, ... particular that certain pairs of arguments conform, ... Have it print out a nice error message if the sizes aren't correct. ... With optional shape-like arguments the routine can compare a (ton + 2) ...
    (comp.lang.fortran)