[SciPy-User] random variable for truncated multivariate normal and t distributions
josef.pktd at gmail.com
josef.pktd at gmail.com
Thu Jun 2 12:54:23 EDT 2011
On Thu, Jun 2, 2011 at 12:24 PM, Bruce Southey <bsouthey at gmail.com> wrote:
> On 06/02/2011 09:35 AM, josef.pktd at gmail.com wrote:
>> (another random question)
>>
>> I would like to generate random variables for multivariate normal and
>> t distributions that are truncated on a rectangular area (element wise
>> upper and lower bounds).
>>
>> Is there anything better available than sampling from the un-truncated
>> distributions and throwing away the out of bounds samples ?
>>
>> Josef
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User at scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
> You have seen R's tmvtnorm?
> cran.r-project.org/web/packages/tmvtnorm
No, I didn't know about this, they use rejection sampling or Gibbs sampling.
If these are the alternatives, then I will stick with rejection sampling.
I'm not starting to learn the implementation details of simulating
with MCMC, Metropolis-Hastings or Gibbs, and leave it to the pymc
developers and to Wes.
rtmvnorm has a big Warning label about the Gibbs sampler, although,
for MonteCarlo integration, any serial correlation in the sampler
won't be very relevant.
Thanks Sturla and Bruce,
Josef
>
> Bruce
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
More information about the SciPy-User
mailing list