Message-ID: <4CFCCDE5.3040505@gmail.com>
Date: 2010-12-06T11:49:57Z
From: Duncan Murdoch
Subject: Runif Help: same variable, 3 different parameters
In-Reply-To: <1291605188137-3073893.post@n4.nabble.com>
On 05/12/2010 10:13 PM, pythonomics wrote:
>
> So I am working on an economic model and I need to change the parameters of
> the runif statement as time goes on.
>
> Ex.
>
> X<-runif(1:50,0,5)
> X<-runif(51:100,100,150)
> X<-runif(100:T, 1,2)
>
> Not sure how to go about entering this in to R properly.
It's not clear what you are trying to do. The first argument to runif
only selects the sample size. In your first two cases, you'll get
samples of size 50; in the last one, you'll get a sample size depending
on T in a nonlinear way.
Duncan Murdoch