Re: [R] Runif Help: same variable, 3 different parameters

2010-12-06 Thread Duncan Murdoch

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

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Runif Help: same variable, 3 different parameters

2010-12-05 Thread pythonomics

Cheers Dieter. You are a true bro.
-- 
View this message in context: 
http://r.789695.n4.nabble.com/Runif-Help-same-variable-3-different-parameters-tp3073894p3074041.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Runif Help: same variable, 3 different parameters

2010-12-05 Thread Dieter Menne


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.
> 
> X <-runif(1:50,0,5)
> X <-runif(51:100,100,150)
> X <-runif(100:T, 1,2)
> 
> 

T=1000
c(runif(1:50,0,5), runif(51:100,100,150),runif(100:T, 1,2))

Dieter
-- 
View this message in context: 
http://r.789695.n4.nabble.com/Runif-Help-same-variable-3-different-parameters-tp3073894p3074036.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Runif Help: same variable, 3 different parameters

2010-12-05 Thread pythonomics

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.
-- 
View this message in context: 
http://r.789695.n4.nabble.com/Runif-Help-same-variable-3-different-parameters-tp3073894p3073894.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Runif Help: same variable, 3 different parameters

2010-12-05 Thread pythonomics

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.
-- 
View this message in context: 
http://r.789695.n4.nabble.com/Runif-Help-same-variable-3-different-parameters-tp3073893p3073893.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.