R ã«ã¯æ¨æºã§ããåå¸ãçæããé¢æ°ãããã¾ãããï¼ä»¥ä¸ã®é¢æ°ãå®ç¾©ããã¨ï¼Zipf-Mandelbrot åå¸ ã«å¾ãä¹±æ°ã runif ã¨åãæè¦ã§çæã§ãã¾ãï¼ rzipf <- function (n, s=1, q=0, supp=c(1,n)) { x <- supp[1]:supp[2] p <- 1/(x + q)**s y <- sample(x, n, replace=T, prob=p) return(y) } ããã§ï¼å¼æ°ã® supp ã¯ï¼ç¢ºçåå¸ã®ãµãã¼ãã®ä¸éã¨ä¸éãæã¤é åã§ãï¼
{{#tags}}- {{label}}
{{/tags}}