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

Home » Public Forums » archive » monte carlo analysis
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
monte carlo analysis [message #18279] Fri, 17 December 1999 00:00 Go to next message
charliesolomon is currently offline  charliesolomon
Messages: 1
Registered: December 1999
Junior Member
Hello ng,

Does anyone have experience with monte carlo analysis in IDL? I'm just
starting to research it and would appreciate any insights or pointers
in the right direction. The purpose would be to take an existing
scientific model and run gads of iterations, using different
distributions for the input variables to get statistical results.
Thanks,

Charlie Solomon
csolomon@usc.edu


Sent via Deja.com http://www.deja.com/
Before you buy.
Re: monte carlo analysis [message #18334 is a reply to message #18279] Wed, 22 December 1999 00:00 Go to previous message
htonishi is currently offline  htonishi
Messages: 7
Registered: September 1999
Junior Member
I often set up simple monte carlo analyes in IDL especially when
visualization is useful for debugging. However, I have found that you
have to be VERY careful about how you code your loops because you can
easily loose a factor of 10 in performance if you don't design your
loops correctly. I have also found just recently that the profiler in
5.3 (I don't know if it's in earlier versions) is very handy for
determining where time is being spent and where you should therefore
look to optimize run time.

If, however, you're going to run a lot of monte carlos -- hundreds of
thousands or millions of iterations -- then I think you should really
consider C or Fortran.

Howard Onishi


* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
Re: monte carlo analysis [message #18343 is a reply to message #18279] Tue, 21 December 1999 00:00 Go to previous message
Andy Loughe is currently offline  Andy Loughe
Messages: 174
Registered: November 1995
Senior Member
William Thompson wrote:

<snip>

> There was some discussion a
> while back about the properties of the random number generators in IDL. You
> might check out www.dejanews.com, for example


One concern is generating the initial seed.
Here is one simple method using the system clock...


seed = long((systime(1) - long(systime(1))) * 1.e8)

; Then for a Normal distribution:
num_rans = 100000
ran_nums = randomn(seed, num_rans)
stats = moment(ran_nums)
plot, histogram(ran_nums, binsize=.1), thick=3
print, '1)MEAN, 2)VARIANCE, 3)SKEWNESS, 4)KURTOSIS :', stats


Then there is no need to set the seed again, unless you
delvar, seed

--
| Andrew F. Loughe | email: afl@cdc.noaa.gov
| NOAA-CIRES CDC | web : www.cdc.noaa.gov/~afl
| 325 Broadway Mail Code R/E/CD1 | voice: (303)497-6211
| Boulder, CO 80303-3328 | fax : (303)497-7013
------------------------------------------------------------ -----
"We must believe in free will, we have no choice"-Isaac B. Singer
Re: monte carlo analysis [message #18373 is a reply to message #18279] Sat, 18 December 1999 00:00 Go to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
charliesolomon@my-deja.com writes:

> Hello ng,

> Does anyone have experience with monte carlo analysis in IDL? I'm just
> starting to research it and would appreciate any insights or pointers
> in the right direction. The purpose would be to take an existing
> scientific model and run gads of iterations, using different
> distributions for the input variables to get statistical results.
> Thanks,

> Charlie Solomon
> csolomon@usc.edu

The trick with Monte Carlo analysis is to generate a properly randomized set of
test particles with the correct characteristics. There was some discussion a
while back about the properties of the random number generators in IDL. You
might check out www.dejanews.com, for example

http://x45.deja.com/ [ST_rn=if]/getdoc.xp?AN=509839686&CONTEXT=945475070.1365 508166&hitnum=12

Other than that, Monte Carlo is a fairly straightforward process. IDL may not
be the best language to implement it in, though, because of all the looping
you'll probably need to do.

William Thompson
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Marketplace for Technical Expertise
Next Topic: Re: idl 5.3 runtime on idl 5.2 system work?

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

Current Time: Wed Oct 08 19:01:54 PDT 2025

Total time taken to generate the page: 0.00587 seconds