Skip to content
Back to formatted view

Raw Message

Message-ID: <CAJ55+dK3yciLoXKrOKjeVngzZ1p_7TrmYza0WAPq9pOE2jGMeQ@mail.gmail.com>
Date: 2012-09-13T21:10:40Z
From: Thomas Lumley
Subject: simulate from conditional distribution
In-Reply-To: <CAHLnndZyLj6t8Zv2ppDtJhBvEx-f_7_D4aD1kWORP6ph874_7g@mail.gmail.com>

On Fri, Sep 14, 2012 at 9:02 AM, li li <hannah.hlx at gmail.com> wrote:
> Dear all,
>         Y, X are bivariate normal with all the parameters known.
> I would like to generate numbers from the distribution Y | X > c
> where c is a constant.
>         Does there exist an R function generating
> random numbers from such a distribution?


Not directly, as far as I know, but you can easily simulate X|X>c by
transforming uniform random numbers using the inverse CDF, and Y|X=x
is univariate Normal with mean linear in x and variance independent of
x.

    -thomas

-- 
Thomas Lumley
Professor of Biostatistics
University of Auckland