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,
  ...
)

Arguments

x, q

A vector of quantiles.

shape1, shape2

Shape parameters.

params

A list that includes all named parameters.

...

Additional parameters.

p

A vector of probabilities.

n

Number of observations.

X

Sample observations.

w

An optional vector of sample weights.

method

Parameter estimation method.

logL

logical; if TRUE, lSSRTB gives the log-likelihood, otherwise the likelihood is given.

Value

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.

Details

No details as of yet.

See also

ExtDist for other standard distributions.

Author

Haizhen Wu.

Examples

# 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