Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

code for Levy Distribution?

by hsfrey (Beadle)
on Oct 03, 2011 at 00:31 UTC ( #929235=perlquestion: print w/ replies, xml ) Need Help??
hsfrey has asked for the wisdom of the Perl Monks concerning the following question:

I need a routine such as gsl_ran_levy.

I downloaded the whole big Math::GSL file from CPAN, which is supposed to contain it, but can't find the code in it anywhere. There are loads of redundant files which appear to be make files, or descriptions of the arguments, but nowhere the actual code.

One file suggested I had to 'build' the file I downloaded, but when I followed the instructions for doing so (run Build.pl) it said a needed PkgConfig, which was not included in the Megabytes included in the downloaded package. So I need a whole package to install another package.

I had no better luck trying to find the C code direct from GSL.

All I wanted was a short subroutine which probably isn't more than about 4 or 5 lines of code!

Does anyone know where I can find the perl code for a Levy Distribution?

Why can I download complete working office suites with one click, but CPAN is so complicated to use just to download some simple text?

Comment on code for Levy Distribution?
Re: code for Levy Distribution?
by Khen1950fx (Canon) on Oct 03, 2011 at 01:18 UTC
    It's just one line of code:). You'll find it in

    Math::GSL::Randist.

    gsl_ran_levy($r, $c, $alpha);
    covers the symmetric, while:
    gsl_ran_levy_skew($r, $c, $alpha, $beta):
    covers the skew.
      LOL!

      I wouldn't consider a call to a subroutine "one line of code"!

Re: code for Levy Distribution?
by Anonymous Monk on Oct 03, 2011 at 01:28 UTC
      "Because you're confused and cranky :)"

      Well, yes, that's quite true - on both counts.

      "The purpose of libraries and CPAN is to be re-used, not provide you with cut/paste implementations of algorithms on demand"

      Some of us are not happy with black boxes, and like to know what our programs are doing.

      "You can find the formula in the wikipedia://LÚvy distribution"

      Yes, I know that. I DID say that I wanted something like "gsl_ran_levy", which gives random variates drawn from a Levy distribution, and that's quite a different thing than a formula giving the probability distribution, which is what you referred me to.

        Yes, I know that. I DID say that I wanted something like "gsl_ran_levy", which gives random variates drawn from a Levy distribution, and that's quite a different thing than a formula giving the probability distribution, which is what you referred me to.

        Last thing I liked to was the source to gsl_ran_levy :)

      I don't know how you install modules, but I don't consider my way complicated:

      cpan Module::Name

      Then again, I don't use CPAN to download text. I use it to download, build, test and install modules — not to mention all of their dependencies — in a portable and reliable manner.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://929235]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2014-09-21 19:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (175 votes), past polls