Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = c(1,2,3,4,5,6,7,8,9,10)
- d.x = diff(x); d.x
- ## 1 1 1 1 1 1 1 1 1
- mean(d.x)
- ## 1
- (max(x) - min(x))/(length(x)-1)
- ## 1
- y = runif(1000) # generate 1000 obs from UNIF(0,1)
- d.y = diff(sort(y)) # 999 interarrival times
- mean(d.y)
- ## 0.0009988142 # aprx mean interarrival time, exact = 0.001
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement