Re: Random Sampling in 2D with a Known Distribution
From: andre (andrevh_at_sci.kun.nl)
Date: 10/26/04
- Next message: Jack Tomsky: "Re: Rigorous Election Statistics"
- Previous message: _at_(nospam)rmc.ca: "Cramer Rao bound in nonlinear parameter estimation"
- In reply to: andrew cooke: "Random Sampling in 2D with a Known Distribution"
- Next in thread: David Jones: "Re: Random Sampling in 2D with a Known Distribution"
- Reply: David Jones: "Re: Random Sampling in 2D with a Known Distribution"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 26 Oct 2004 18:58:22 +0000 (UTC)
andrew@acooke.org (andrew cooke) wrote:
>Hi,
>
>Given a probability ditribution in 2D, how can I generate a list of
>points that reflects that distribution (ie more points where the
>probability is higher).
>
>It seems that somehow I want a cumulative distribution as a function
>of a single variable, which I can then invert and sample uniformly.
>However, I can't see how to get from 2D distribution to a single
>variable.
>
>I guess this is a common problem - if someone could just give me the
>standard name I can probably google for appropriate solutions.
>
>I'm interested in both approaches for analytically nice distributions
>and those that can only be handled numerically.
>
>Thanks,
>Andrew
The "analytical" way to get what you want would be to find two multi-variate
functions f1(x1,x2,...,xn) and f2(x1,x2,...,xn) such that your density
P(y1,y2) is given by
P(y1,y2) = integral( dirac( y1-f1(x1,...,xn) )*dirac( y2-f2(x1,...,xn) ) )
where the integral is over all variables x1=0..1, x2=0..1, ... ,xn=0..1.
The minimal number of variables you would need is 2. But in general it is too
difficult to find such functions.
The most common, but maybe inefficient, alternative is the following (don't
know the name, would call it "rejection")
Given a number A and a pdf G such that A*G(y1,y2) >= P(y1,y2) for all
y1,y2 you are interested in, you generate (y1,y2) from G and x uniformly
in [0,1]. If x*A*G(y1,y2) =< P(y1,y2) you accept, and else you reject
y1,y2,x and try again. The simplest, but maybe not the most efficient, is of
course to take the uniform distribution for G(y1,y2).
- Next message: Jack Tomsky: "Re: Rigorous Election Statistics"
- Previous message: _at_(nospam)rmc.ca: "Cramer Rao bound in nonlinear parameter estimation"
- In reply to: andrew cooke: "Random Sampling in 2D with a Known Distribution"
- Next in thread: David Jones: "Re: Random Sampling in 2D with a Known Distribution"
- Reply: David Jones: "Re: Random Sampling in 2D with a Known Distribution"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|