Skip to content
Back to formatted view

Raw Message

Message-ID: <4AF9BC51.9060800@stats.uwo.ca>
Date: 2009-11-10T19:17:37Z
From: Duncan Murdoch
Subject: Monte Carlo Simulation in R...
In-Reply-To: <1b27d6790911101025q201c9fc3se4bef3ef5797b428@mail.gmail.com>

On 11/10/2009 1:25 PM, Hongwei Dong wrote:
> Hi, Dear R users,
> 
> I'm wondering if I can do Monte Carlo Simulation in R. My problem is like
> this: I know variable X follows Gamma distribution with shape parameter
> 0.067 and scale parameter 0.008. The sum of the X is 2000. I need R help me
> to simulate a vector of X that satisfies both the probability distribution
> and the sum. Anyone has a clue to this? Much appreciated.

Your requirements are slightly contradictory or incomplete.  Here's one 
way to fully specify the problem:

The X_i values are independent Gammas, with the given shape and scale. 
You want to simulate from the joint distribution conditional on the 
event sum(X) == 2000.

Is that your problem?  I don't know how to do the simulation, but maybe 
someone else does.

Duncan Murdoch