Hi,
May be this helps:
m <- 0.01
 T <- 90
 t <- 0:T
set.seed(42)
res1 <- sapply(t,function(.t) runif(1,0,m*(T-.t)))

#or
 set.seed(42)
 res2 <- runif(91,rep(0,91),m*(rep(T,91)-t))
identical(res1,res2)
#[1] TRUE

A.K.


Hi, 

I need to generate a sequence that consists of random numbers. 
My first idea was runif with the condition m(T-t), but i couldn't 
achieve. 

Given: m=0.01 , T=90, t={0,1,...,T} 

Sequence: s={p_0, p_1,..., p_T}, where p_t is chosen from the time-dependent 
interval [0, m(T-t)]   


I appreciate if someone helps me.

______________________________________________
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.

Reply via email to