alpha = 2; k = exp(3)
y = rpareto(n=1000, location=alpha, shape=k)
fit = vglm(y ~ 1, pareto1, trace=TRUE)
fit@extra # The estimate of alpha is here
fitted(fit)[1:5]
mean(y)
coef(fit, matrix=TRUE)
summary(fit) # Standard errors are incorrect!!
# Here, alpha is assumed known
fit2 = vglm(y ~ 1, pareto1(location=alpha), trace=TRUE, crit="c")
fit2@extra # alpha stored here
fitted(fit2)[1:5]
mean(y)
coef(fit2, matrix=TRUE)
summary(fit2) # Standard errors are ok
# Upper truncated Pareto distribution
lower = 2; upper = 8; k = exp(2)
y = rtpareto(n=100, lower=lower, upper=upper, shape=k)
fit3 = vglm(y ~ 1, tpareto1(lower, upper), trace=TRUE, cri="c")
coef(fit3, matrix=TRUE)
c(fit3@misc$lower, fit3@misc$upper)
Run the code above in your browser using DataLab