### Showing how to fit a simple vector of data to the skewed
### generalized t distribution.
require(graphics)
require(stats)
set.seed(123456)
x = rt(100, df=10)
X.f = X ~ x
start = list(mu = 0, sigma = 2, lambda = 0, p = 2, q = 12)
result = sgt.mle(X.f = X.f, start = start, finalHessian = "BHHH")
sumResult = summary(result)
print(result)
coef(result)
print(sumResult)
### Note that the t distribution is a special case of the
### skewed generalized t distribution
Run the code above in your browser using DataLab