R: The standard symmetric-reflected truncated beta (SSRTB)...
SSRTB
R Documentation
The standard symmetric-reflected truncated beta (SSRTB) distribution.
Description
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.
logical; if TRUE, lSSRTB gives the log-likelihood, otherwise the likelihood is given.
Details
No details as of yet.
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.
Author(s)
Haizhen Wu.
See Also
ExtDist for other standard distributions.
Examples
# Parameter estimation for a distribution with known shape parameters
X <- rSSRTB(n=500, shape1=2, shape2=10)
est.par <- eSSRTB(X); est.par
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"]
# log-likelihood function
lSSRTB(X,param = est.par)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(ExtDist)
Attaching package: 'ExtDist'
The following object is masked from 'package:stats':
BIC
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/ExtDist/SSRTB.Rd_%03d_medium.png", width=480, height=480)
> ### Name: SSRTB
> ### Title: The standard symmetric-reflected truncated beta (SSRTB)
> ### distribution.
> ### Aliases: SSRTB dSSRTB eSSRTB lSSRTB pSSRTB qSSRTB rSSRTB
>
> ### ** 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 S.E.
shape1 shape 1.963766 0.2577075
shape2 shape 2.110834 2.8581397
> 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.963766
$shape2
[1] 2.110834
>
> # log-likelihood function
> lSSRTB(X,param = est.par)
[1] 58.63162
>
>
>
>
>
> dev.off()
null device
1
>