Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. ```{r}
  2. ratio = function(k, alpha){
  3. (k / (k+1))**(1 + alpha)
  4. }
  5.  
  6. x1=1:20
  7. x2 = 2:21
  8. par(mfrow=c(1, 3))
  9. plot(x2, zipf(x2, alpha=0.5, Cte=2.612) / zipf(x1, alpha=0.5, Cte=2.612), type='h', ylab="P(K+1) / P(K)", xlab="alpha=0.5", xlim=c(1, 20))
  10. lines(x1, ratio(x1, 0.5), col='red')
  11.  
  12. plot(x2, zipf(x2, alpha=1, Cte=1.645) / zipf(x1, alpha=1, Cte=1.645), type='h', ylab="P(K+1) / P(K)", xlab="alpha=1", xlim=c(1, 20))
  13. lines(x1, ratio(x1, 1), col='red')
  14.  
  15. plot(x2, zipf(x2, alpha=2, Cte=1.202) / zipf(x1, alpha=2, Cte=1.202), type='h', ylab="P(K+1) / P(K)", xlab="alpha=2", xlim=c(1, 20))
  16. lines(x1, ratio(x1, 2), col='red')
  17. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement