Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: Random draws from multivariate normal not centered at the mean

 From "Fernando Rios Avila" To Subject Re: st: Random draws from multivariate normal not centered at the mean Date Mon, 14 Feb 2011 22:24:26 -0500

```Hi Mauro,
I think I understand what exactly you want to do. The only way i can think of that you can be sure that the new draw is not "centered" around the mean  is to "correct" the draw using the inverse mills ratio.
For instance, assume x follows N(u,sigma) and u want to get random draws that will have a mean= u+sigma*normalden((a-u)/sigma)/[1-normal((a-u)/sigma)], where A is just an arbitrary limit,
you would just need to first btain the random draws xi, and then "correct" them accordingly depending to which mean u want.
For more references to this, look at references respect to moments for truncated normal distributions.

Once you have the random draws, the draws for the second section of the multivariate normal distribution can simply be generated using the rnormal(), function, where the mean and variance correspond to the conditional normal distribution.

Hope this is what u were looking for.
Fernando
>>> David Muller <davidmull@gmail.com> 02/14/11 8:10 PM >>>
Hi Mauro,

I'm afraid I don't understand what you're after, and I don't know what
you are refer to when you use the term 'centered' if you are not
referring to the mean.

David

On Tue, Feb 15, 2011 at 11:45 AM, Mauro Caselli <m.caselli@unsw.edu.au> wrote:
> Unfortunately, that doesn't quite do the job. The means() option tells
> the means of the distribution you draw from, which in my previous
> example were 4 and 5. But is it possible to draw from that
> distribution with mean 4 and 5 a set of numbers that are not centered
> around those means? If you input in the means() option the means that
> you would like, the draws are from a different distribution and not
> from the original one I am interested in.
> I hope that this clears what I am trying to do.
>
> Mauro
>
>
>
> On 15 February 2011 11:10, David Muller <davidmull@gmail.com> wrote:
>>
>> The -means()- option in -drawnorm- does what you require. It's
>> documented in -help drawnorm-.
>>
>> Cheers,
>> David
>>
>> On Tue, Feb 15, 2011 at 10:34 AM, Mauro Caselli <m.caselli@unsw.edu.au> wrote:
>> > Dear Stata users,
>> >
>> > I have the following question:
>> > I have a multivariate normal distribution with two variables
>> > (therefore I have means and variances of both and the correlation
>> > coefficient). I want to draw psuedo-random draws from this
>> > distribution and I know that this can be done with the command
>> > drawnorm. However, I would like to have draws not centered at the mean
>> > of the population but rather at a different value of one of the two
>> > variables.
>> > So, if the means are 4 for x and 5 for y, for instance I would like to
>> > draw ten numbers that give an average of 3 for x and follow the
>> > multivariate normal to give the relative values of y. Is this possible
>> > with drawnorm? If not, can anyone point me in the right direction?
>> >
>> > Thank you very much.
>> >
>> > With best wishes,
>> >
>> > Mauro
>> >
>> >
>> >
>> > --
>> > Mauro Caselli
>> > Postdoctoral Research Fellow
>> > School of Economics, Room 410
>> > Australian School of Business
>> > The University of New South Wales, NSW, 2052
>> > Australia
>> > Phone: +61 (0)2 9385 3561
>> > Email: m.caselli@unsw.edu.au
>> > *
>> > *   For searches and help try:
>> > *   http://www.stata.com/help.cgi?search
>> > *   http://www.stata.com/support/statalist/faq
>> > *   http://www.ats.ucla.edu/stat/stata/
>> >
>>
>> *
>> *   For searches and help try:
>> *   http://www.stata.com/help.cgi?search
>> *   http://www.stata.com/support/statalist/faq
>> *   http://www.ats.ucla.edu/stat/stata/
>
>
>
> --
> Mauro Caselli
> Postdoctoral Research Fellow
> School of Economics, Room 410
> The University of New South Wales, NSW, 2052
> Australia
> Phone: +61 (0)2 9385 3561
> Email: m.caselli@unsw.edu.au
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```