# creating data from Pareto 2 distribution
Y <- rPARETO2(1000)
# getting the density
histSmo(Y, lower=0)
# more breaks a bit slower
histSmo(Y, breaks=200, lower=0)
# quick fit using lambda
histSmoO(Y, lambda=1, breaks=200, lower=0)
# or
histSmo(Y, lambda=1, breaks=200, lower=0)
# quick fit using df
histSmoC(Y, df=15, breaks=200, lower=0)
# or
histSmo(Y, df=15, breaks=200, lower=0)
# saving results
m1<- histSmo(Y, lower=0, save=TRUE)
plot(m1)
plot(m1, "cdf")
plot(m1, "invcdf")
# now gererate from SHASH
YY <- rSHASH(1000)
m1<- histSmo(YY, save=TRUE)
# calculate Pr(YY>10)
1-m1$cdf(10)
# calculate Pr(-10<YY<10)
1-(1-m1$cdf(10))-m1$cdf(-10)
YYY <- rNBI(1000, mu=5, sigma=4)
histDist(YYY, discrete=TRUE, family=NBI())
Run the code above in your browser using DataLab