VGAMパッケージには、Zipf分布の指数を推定するための機能があります。最適な推定密度に対して分布をプロットすることをお勧めします。
plot( cntdens <- table(f[['cnt']])/length(f[['cnt']]),
xlim=range(f[['cnt']]), ylim=c(0, 0.8) )
# And then plot the theoretic distribution for the VGAM fit
# ... extending the example on ?VGAM::zipf:
require(VGAM)
zdata <- data.frame( y=1:max( f[['cnt']] ), ofreq= table( f[['cnt']] ) )
fit = vglm(y ~ 1, zipf, zdata, trace = TRUE, weight = ofreq, crit = "coef")
proby = dzipf(1:max(f[['cnt']]), N =max(f[['cnt']]), s = Coef(fit) )
points((1:5)+0.05, proby, col="red")
以下は、?dzipfページの例のデータを使用した手順です。
