Hypergeometric Distribution

M

makepeace

My task is to find a solution in Perl to the hypergeometric
distribution function, and to graphically present the results using GD
and GD::Graph perl modules. The software's to be used as a tool for
biosecurity and biocontainment. Does anyone know if there's such perl
code out there? I've found a peace of promissing-looking code at: <a
href="http://www.sys.eng.net/blog/category/perl" target="_blank">Fun
with Hypergeometric Distribution Probabilities</a>, but it didn't work
as expected. (Maybe I didn't use it properly, I admit.)
<p>
GD::Graph::lines related question: how do I force the module to start
plotting the curve from point "0" on the X-axis? It always begins at
"1".
 
X

xhoster

makepeace said:
My task is to find a solution in Perl to the hypergeometric
distribution function, and to graphically present the results using GD
and GD::Graph perl modules. The software's to be used as a tool for
biosecurity and biocontainment.

I find that somewhat scary. I would prefer that that type of job not
be a "learn on the job" or "Let's get someone on usenet to do it for me"
type of thing.
Does anyone know if there's such perl
code out there?

GO::TermFinder has some hypergeometric code. I can't comment on it
efficiency or numerical stability. Generally, I it just math. I doubt
the implementation in Perl is going have a substantially different
strategy than an implementation in C or java or whatever.

I've found a peace of promissing-looking code at: <a
href="http://www.sys.eng.net/blog/category/perl" target="_blank">Fun
with Hypergeometric Distribution Probabilities</a>,

That web page doesn't seem to exist. s/sys.eng/sys-eng/
but it didn't work
as expected. (Maybe I didn't use it properly, I admit.)

If you don't tell us what you expected, or what you actually got,
or how you used it, then how could we possible help you figure out
what went wrong?
<p>
GD::Graph::lines related question: how do I force the module to start
plotting the curve from point "0" on the X-axis? It always begins at
"1".

You should try to decompose your questions into orthoganal components, but
for your own use and for posting. People who are interested in GD::Graph
but not in hypergeometric distribution will likely never see this question!

Show use the code that makes the curve begin at step "1", and we can
probably tell you how to make it start at point "0". Without some code
to go along with it, your description is too vague to be meaningful.

Xho
 
M

makepeace

It works!

The code at <http://www.sys-eng.net/blog/category/perl> works like a
charm. The reason I was not getting correct results was my passing
parameters to the function in a wrong oder (parameters are position
dependent).

Regarding GD::Graph::lines problem, all I needed to do was to use
numerical X axis, instead of labeled one.

Jim, I checked GSL and couldn't find anything useful - that's why I
went to the Web.

Xho, you're right about decomposing the question for a better public
use. I was selfish and hasty.

Thank you, gentlemen, so much for your help. Have a great weekend!

Makepeace
 
A

A. Sinan Unur

Show use the code that makes the curve begin at step "1", and we can
probably tell you how to make it start at point "0". Without some
code to go along with it, your description is too vague to be
meaningful.

The section titled "Options for graphs with a numerical X axis" in the
GD::Graph documentation may shed some light here. Basically, GD::Graph is
not the right tool for XY graphs.

Sinan

--
A. Sinan Unur <[email protected]>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
 
M

makepeace

Yes, Sinan, the graph I'm getting looks pretty rude, no matter how much
I tried to beautify it. I would appreciate if you could suggest a
better solution. Keep in mind that I must deliver generated images to
browsers.
 
A

A. Sinan Unur

Yes, Sinan,

Apparently you are replying to me. However, you have quoted no context
which makes it hard for other readers to follow. Please quote some context
when you post replies.
the graph I'm getting looks pretty rude, no matter how much
I tried to beautify it. I would appreciate if you could suggest a
better solution. Keep in mind that I must deliver generated images to
browsers.

I would use Gnuplot for scientific graphs. Development is active again.

I have not used it, but there is a module for driving Gnuplot from Perl.

http://search.cpan.org/~caidaperl/Chart-Graph-2.0/Graph/Gnuplot.pm

Sinan

--
A. Sinan Unur <[email protected]>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
 
A

A. Sinan Unur

comp.lang.perl.misc message ID
[email protected]:






Gnuplot seems to be exactly what I need. Thank you very much, Sinan
and have a great weekend!

You are most welcome, and you too.
P.S. I hope you'll find my manners a little better now. :)

I am sure we all appreciate the effort. Proper quoting makes it much
easier to follow discussions, especially for those of us who are
involved in more than one thread at a time.

Sinan
--
A. Sinan Unur <[email protected]>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
 
Z

zentara

My task is to find a solution in Perl to the hypergeometric
distribution function, and to graphically present the results using GD
and GD::Graph perl modules. The software's to be used as a tool for
biosecurity and biocontainment. Does anyone know if there's such perl
code out there? I've found a peace of promissing-looking code at: <a
href="http://www.sys.eng.net/blog/category/perl" target="_blank">Fun
with Hypergeometric Distribution Probabilities</a>, but it didn't work
as expected. (Maybe I didn't use it properly, I admit.)
<p>
GD::Graph::lines related question: how do I force the module to start
plotting the curve from point "0" on the X-axis? It always begins at
"1".

Another alternative, is plotting on the Tk::Canvas, which will give you
alot more flexibility. The Canvas can be exported as a jpeg, png, or
gif. The drawback is that it needs an X server running.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top