SSRTB.Rd
Density, distribution, quantile, random number generation and parameter estimation functions for the SSRTB distribution. Parameter estimation can be based on a weighted or unweighted i.i.d sample and can be carried out numerically.
dSSRTB(x, shape1 = 2, shape2 = 3, params = list(shape1, shape2), ...)
pSSRTB(q, shape1 = 2, shape2 = 3, params = list(shape1, shape2), ...)
qSSRTB(p, shape1 = 2, shape2 = 3, params = list(shape1, shape2), ...)
rSSRTB(n, shape1 = 2, shape2 = 3, params = list(shape1, shape2), ...)
eSSRTB(X, w, method = "numerical.MLE", ...)
lSSRTB(
X,
w,
shape1 = 2,
shape2 = 3,
params = list(shape1, shape2),
logL = TRUE,
...
)
A vector of quantiles.
Shape parameters.
A list that includes all named parameters.
Additional parameters.
A vector of probabilities.
Number of observations.
Sample observations.
An optional vector of sample weights.
Parameter estimation method.
logical; if TRUE, lSSRTB gives the log-likelihood, otherwise the likelihood is given.
dSSRTB gives the density, pSSRTB the distribution function, qSSRTB the quantile function, rSSRTB generates random variables, eSSRTB estimates the parameters and lSSRTB provides the log-likelihood.
No details as of yet.
ExtDist for other standard distributions.
# Parameter estimation for a distribution with known shape parameters
X <- rSSRTB(n=500, shape1=2, shape2=10)
est.par <- eSSRTB(X); est.par
#>
#> Parameters for the SSRTB distribution.
#> (found using the numerical.MLE method.)
#>
#> Parameter Type Estimate
#> shape1 shape 1.868396e+00
#> shape2 shape 6.448260e+07
#>
#>
plot(est.par)
# Fitted density curve and histogram
den.x <- seq(min(X),max(X),length=100)
den.y <- dSSRTB(den.x,shape1=est.par$shape1,shape2=est.par$shape2)
hist(X, breaks=10, probability=TRUE, ylim = c(0,1.2*max(den.y)))
lines(den.x, den.y, col="blue")
lines(density(X), lty=2)
# Extracting shape parameters
est.par[attributes(est.par)$par.type=="shape"]
#> $shape1
#> [1] 1.868396
#>
#> $shape2
#> [1] 64482600
#>
# log-likelihood function
lSSRTB(X,param = est.par)
#> [1] 42.1524