ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Random numbers in metapost
@ 2009-12-31  7:08 David Arnold
  2009-12-31 13:13 ` Taco Hoekwater
  0 siblings, 1 reply; 3+ messages in thread
From: David Arnold @ 2009-12-31  7:08 UTC (permalink / raw)
  To: Context Mailing List List

Hi,

Does anyone have any strategies for drawing random numbers from various statistics distributions in Metapost? For example, say, drawing 100 random numbers from a beta distribution?

David
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Random numbers in metapost
  2009-12-31  7:08 Random numbers in metapost David Arnold
@ 2009-12-31 13:13 ` Taco Hoekwater
  2009-12-31 18:17   ` David Arnold
  0 siblings, 1 reply; 3+ messages in thread
From: Taco Hoekwater @ 2009-12-31 13:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

David Arnold wrote:
> Hi,
> 
> Does anyone have any strategies for drawing random numbers from
> various statistics distributions in Metapost? For example, say,
> drawing 100 random numbers from a beta distribution?

Assuming you are using mkiv: create a lua function and use its
calculated results to create the metapost code. Metapost only knows
about uniformdeviate and normaldeviate, and metapost is not a good
language to program mathematics in.

Best wishes,
Taco
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Random numbers in metapost
  2009-12-31 13:13 ` Taco Hoekwater
@ 2009-12-31 18:17   ` David Arnold
  0 siblings, 0 replies; 3+ messages in thread
From: David Arnold @ 2009-12-31 18:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1582 bytes --]

Taco et al,

I think I've found a way. Anthony Phan has written a brilliant stats package for Metapost.

http://www-math.univ-poitiers.fr/~phan/statsmac.html

I think (haven't tried yet) I can select a number at random from the uniform distribution on [0,1], then use one of Anthony's functions such as:

poissonicdf(expr p, lambda). Inverse cumulative distribution function of P(lambda).

See Anthony's manual at:

http://www-math.univ-poitiers.fr/~phan/downloads/metapost/statsman.pdf

David.


On Dec 31, 2009, at 5:13 AM, Taco Hoekwater wrote:

> David Arnold wrote:
>> Hi,
>> Does anyone have any strategies for drawing random numbers from
>> various statistics distributions in Metapost? For example, say,
>> drawing 100 random numbers from a beta distribution?
> 
> Assuming you are using mkiv: create a lua function and use its
> calculated results to create the metapost code. Metapost only knows
> about uniformdeviate and normaldeviate, and metapost is not a good
> language to program mathematics in.
> 
> Best wishes,
> Taco
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 2877 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-31 18:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-31  7:08 Random numbers in metapost David Arnold
2009-12-31 13:13 ` Taco Hoekwater
2009-12-31 18:17   ` David Arnold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).