# NOT RUN {
# Plot Dirichlet process priors for different values of alpha
(DP <- G_priorDensity(N=50, alpha=c(3, 10, 25)))
# Non-zero discount requires loading the "Rmpfr" library
# require("Rmpfr")
# Verify that these alpha/discount values produce Pitman-Yor process priors with the same mean
# G_expected(N=50, alpha=c(19.23356, 6.47006, 1), discount=c(0, 0.47002, 0.7300045))
# Now plot them to examine tail behaviour as discount increases
# alpha <- c(19.23356, 6.47006, 1)
# discount <- c(0, 0.47002, 0.7300045)
# (PY <- G_priorDensity(N=50, alpha=alpha, discount=discount, type="l"))
#' # Other special cases of the PYP are also facilitated
# G_priorDensity(N=50, alpha=c(alpha, 27.1401, 0),
# discount=c(discount, -27.1401/100, 0.8054447), type="b")
# }
Run the code above in your browser using DataLab