Zipf {VGAM} | R Documentation |
Density, and cumulative distribution function for the Zipf distribution.
dzipf(x, N, s) pzipf(q, N, s)
x, q |
vector of quantiles. |
N, s |
the number of elements, and the exponent characterizing the
distribution.
See zipf for more details.
|
This is a finite version of the zeta distribution.
See zipf
for more details.
dzipf
gives the density, and
pzipf
gives the cumulative distribution function.
T. W. Yee
zipf
.
## Not run: N = 10; s=0.5; y = 1:N proby = dzipf(y, N=N, s=s) plot(y, proby, type="h", col="blue", ylab="P[Y=y]", ylim=c(0,0.2), main=paste("Zipf(N=",N,", s=",s,")", sep="")) sum(proby) # Should be 1 max(abs(cumsum(proby) - pzipf(y, N=N, s=s))) # Should be 0 ## End(Not run)