-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5c8ddc4
Showing
51 changed files
with
5,223 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
Package: new.dist | ||
Title: Alternative Continuous and Discrete Distributions | ||
Version: 0.1.0 | ||
Authors@R: c( | ||
person("Ramazan", "Akman",,"ramazanakman12345@gmail.com",role=c("cre","ctb"), | ||
comment = "https://www.researchgate.net/profile/Ramazan-Akman"), | ||
person("Coşkun", "Kuş",,"coskunkus@gmail.com",role=c("aut","ctb"), | ||
comment = "https://www.selcuk.edu.tr/Person/Detail/coskun"), | ||
person("Ihab", "Abusaif",,"censtat@gmail.com",role=c("aut","ctb"), | ||
comment = "https://www.researchgate.net/profile/Ihab-Abusaif")) | ||
Maintainer: Ramazan Akman <ramazanakman12345@gmail.com> | ||
Description: The aim is to develop an R package, which is the 'new.dist' | ||
package, for the probability (density) function, the | ||
distribution function, the quantile function and the | ||
associated random number generation function for discrete and | ||
continuous distributions, which have recently been proposed | ||
in the literature. This package implements the following | ||
distributions: The Power Muth Distribution, a Bimodal Weibull | ||
Distribution, the Discrete Lindley Distribution, The | ||
Gamma-Lomax Distribution, Weighted Geometric Distribution, a | ||
Power Log-Dagum Distribution, Kumaraswamy Distribution, | ||
Lindley Distribution, the Unit-Inverse Gaussian Distribution, | ||
EP Distribution, Akash Distribution, Ishita Distribution, | ||
Maxwell Distribution, the Standard Omega Distribution, | ||
Slashed Generalized Rayleigh Distribution, Two-Parameter | ||
Rayleigh Distribution, Muth Distribution, Uniform-Geometric | ||
Distribution, Discrete Weibull Distribution. | ||
License: GPL-3 | ||
URL: https://github.com/akmn35/new.dist, | ||
https://akmn35.github.io/new.dist/ | ||
BugReports: https://github.com/akmn35/new.dist/issues | ||
Imports: VGAM, expint, pracma | ||
Suggests: knitr, rmarkdown, roxygen2, stats, testthat (>= 3.0.0) | ||
VignetteBuilder: knitr | ||
RdMacros: | ||
Config/testthat/edition: 3 | ||
Encoding: UTF-8 | ||
RoxygenNote: 7.2.3 | ||
NeedsCompilation: no | ||
Packaged: 2023-11-06 18:41:02 UTC; Ramazan | ||
Author: Ramazan Akman [cre, ctb] | ||
(https://www.researchgate.net/profile/Ramazan-Akman), | ||
Coşkun Kuş [aut, ctb] (https://www.selcuk.edu.tr/Person/Detail/coskun), | ||
Ihab Abusaif [aut, ctb] | ||
(https://www.researchgate.net/profile/Ihab-Abusaif) | ||
Repository: CRAN | ||
Date/Publication: 2023-11-07 18:00:02 UTC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
e08191fcf5e494ccfce846535e04d027 *DESCRIPTION | ||
c7e983e493b85ece1561940c4e785a8d *NAMESPACE | ||
ae6e50a9dba9ed4635e3d479c3443f06 *NEWS.md | ||
22f6eeb15f11b98a13226d6ff863d89a *R/EPd.R | ||
d4ebac56bc9b18aefcb396d2e638e50b *R/bwd.R | ||
f92e472c870d172186b973686b124270 *R/dld.R | ||
7409e4b9b91af960b7f595121d7f7cc1 *R/emd.R | ||
5eb9cfe75381f9ce0a75b87eb4f61ad4 *R/epkd.R | ||
420dfa68faf5e2f67368775a173c2f94 *R/gld.R | ||
15a7f43fc093b60be53af5a975ce5f46 *R/ndd.R | ||
381502723afe47a15c63ecf8e43096d9 *R/noPDD.R | ||
9d3cb495446831c5beb7bf626e42f737 *R/omd.R | ||
d535253b674d6a21dfa3fe80f223231d *R/pldd.R | ||
2a9739bde1b77618efec47e27d08b5ba *R/rld.R | ||
66bafd32d0cabf512aeff4eab8701332 *R/sgrd.R | ||
8b3af42ee93898e8c1f9a814a3762156 *R/sod.R | ||
706ed2ec766bcb0284f4d550e223d4e4 *R/tpmd.R | ||
045b30ecd81e01bf265f705aca89d6c1 *R/tprd.R | ||
4e21a21eeb893d4974462f2d2bc1f8a2 *R/ugd.R | ||
ac3a5531531ba9b159122a8b44467a5d *R/uigd.R | ||
4365fb0620c8023f17624f5043fb4f81 *R/wgd.R | ||
86ab0f2620afe07b3a18133f1c9f3bc5 *README.md | ||
eaf2bcd6c2582c6cab65ee1adb0aedfe *build/vignette.rds | ||
e2f2cd77604eefba45c86e6ada00ac68 *inst/doc/new_dist.R | ||
8042fad75ee2eefd11fb442643ea5364 *inst/doc/new_dist.Rmd | ||
98c4ed40406ca04b4eadab7cf509524b *inst/doc/new_dist.html | ||
744351085f01be60b5a9c470a823b8f4 *man/EPd.Rd | ||
2ada602622c55effd424360cee2dbb33 *man/bwd.Rd | ||
d8970b62142f10de4f0c6c9a780835d0 *man/dld.Rd | ||
50f6c878e09a54a0e9fed915a178278b *man/emd.Rd | ||
3c5bfb1656bfa37ef31ffdf33c386ded *man/epkd.Rd | ||
240961a508f9907c78b3b52945c9b942 *man/figures/indir.png | ||
9bf6624dd637c0ce5dc4fcf4d0f623f3 *man/figures/logo.png | ||
2303c55345563835bcea02db7483094e *man/figures/new.dist.png | ||
d7c60c38c94e66e167de3731287d9591 *man/gld.Rd | ||
f12c8d0f1f3b68da9aa18e7e2358b504 *man/ndd.Rd | ||
1b5cdf34cfb281c528937b49f31c48cc *man/noPDD.Rd | ||
c7fa88095a4ff980ba7741be59216d21 *man/omd.Rd | ||
9f95df732476c4a15e51d83a742c4bbe *man/pldd.Rd | ||
583dd219d099bffdcac804f55a33ae12 *man/rld.Rd | ||
eb5651b493898a045d41cbd1e5343a2e *man/sgrd.Rd | ||
0164e82c6a7555923eee26cf93207d46 *man/sod.Rd | ||
696b62bb4a8153b26ced38788449f7a6 *man/tpmd.Rd | ||
c8a88fc81bd6f0cfe8a51576a407695c *man/tprd.Rd | ||
6a2e4589b248574d31cedadf92cccb8e *man/ugd.Rd | ||
eb37f30df707d3c052c908c610dd7baf *man/uigd.Rd | ||
6e3c2701a5d593eae4a156c5eb743086 *man/wgd.Rd | ||
0da559b6c8b289d16bb77c1a9782b1f2 *tests/testthat.R | ||
897242f485e9a48b816a22882dfb640d *tests/testthat/test_function.R | ||
8042fad75ee2eefd11fb442643ea5364 *vignettes/new_dist.Rmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export(dEPd) | ||
export(dbwd) | ||
export(ddld) | ||
export(demd) | ||
export(depkd) | ||
export(dgld) | ||
export(dndd) | ||
export(dnoPDD) | ||
export(domd) | ||
export(dpldd) | ||
export(drld) | ||
export(dsgrd) | ||
export(dsod) | ||
export(dtpmd) | ||
export(dtprd) | ||
export(dugd) | ||
export(duigd) | ||
export(dwgd) | ||
export(pEPd) | ||
export(pbwd) | ||
export(pdld) | ||
export(pemd) | ||
export(pepkd) | ||
export(pgld) | ||
export(pndd) | ||
export(pnoPDD) | ||
export(pomd) | ||
export(ppldd) | ||
export(prld) | ||
export(psgrd) | ||
export(psod) | ||
export(ptpmd) | ||
export(ptprd) | ||
export(pugd) | ||
export(puigd) | ||
export(pwgd) | ||
export(qEPd) | ||
export(qbwd) | ||
export(qdld) | ||
export(qemd) | ||
export(qepkd) | ||
export(qgld) | ||
export(qndd) | ||
export(qnoPDD) | ||
export(qomd) | ||
export(qpldd) | ||
export(qrld) | ||
export(qsgrd) | ||
export(qsod) | ||
export(qtpmd) | ||
export(qtprd) | ||
export(qugd) | ||
export(quigd) | ||
export(qwgd) | ||
export(rEPd) | ||
export(rbwd) | ||
export(rdld) | ||
export(remd) | ||
export(repkd) | ||
export(rgld) | ||
export(rndd) | ||
export(rnoPDD) | ||
export(romd) | ||
export(rpldd) | ||
export(rrld) | ||
export(rsgrd) | ||
export(rsod) | ||
export(rtpmd) | ||
export(rtprd) | ||
export(rugd) | ||
export(ruigd) | ||
export(rwgd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# new.dist 0.1.0 | ||
|
||
* First public release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
#' The EP distribution | ||
#' @export | ||
#' @name EPd | ||
#' @param x,q vector of quantiles. | ||
#' @param lambda,beta are parameters. | ||
#' @param p vector of probabilities. | ||
#' @param n number of observations. If \code{length(n) > 1}, the length is taken | ||
#' to be the number required. | ||
#' @param log,log.p logical; if TRUE, probabilities p are given as log(p). | ||
#' @param lower.tail logical; if TRUE (default), probabilities are | ||
#' \eqn{P\left[ X\leq x\right]}, otherwise,\eqn{P\left[ X>x\right] }. | ||
#' @description | ||
#' Density, distribution function, quantile function and random generation for | ||
#' the EP distribution parameters. | ||
#' @return \code{dEPd} gives the density, \code{pEPd} gives the distribution | ||
#' function, \code{qEPd} gives the quantile function and \code{rEPd} generates | ||
#' random deviates. | ||
#' @details | ||
#' The EP distribution with parameters are \eqn{\lambda}, \eqn{\beta}, | ||
#' has density given by | ||
#' \deqn{f\left( x\right) =\frac{\lambda \beta } | ||
#' {\left( 1-e^{-\lambda }\right) } e^{-\lambda -\beta x+\lambda e^{-\beta x}},} | ||
#' where | ||
#' \deqn{x>\mathbb{R}_{+},~\beta ,\lambda \in \mathbb{R}_{+}.} | ||
#' @references Kuş, C., 2007, | ||
#' *A new lifetime distribution*, Computational Statistics & Data Analysis, | ||
#' 51 (9), 4497-4509. | ||
#' @examples | ||
#' library(new.dist) | ||
#' dEPd(1, lambda=2, beta=3) | ||
dEPd<-function(x,lambda,beta,log=FALSE) | ||
{ | ||
if(any(lambda<=0)) {stop("lambda must be > 0")} | ||
if(any(beta<=0)) {stop("beta must be > 0")} | ||
enuzun<-max(length(x),length(lambda),length(beta)) | ||
x<-rep(x,enuzun/length(x)+1)[1:enuzun] | ||
lambda<-rep(lambda, enuzun/length(lambda)+1)[1:enuzun] | ||
beta<-rep(beta,enuzun/length(beta)+1)[1:enuzun] | ||
pdf<-NULL | ||
for (i in 1:enuzun) | ||
{ | ||
if(x[i]<=0) {pdf[i]<-0} else | ||
{pdf[i]<-(lambda[i]*beta[i])/(1-exp(-lambda[i]))*exp((-lambda[i])-beta[i]* | ||
x[i]+lambda[i]*exp(-beta[i]*x[i]))} | ||
} | ||
if(log==TRUE) pdf<-log(pdf) | ||
return(pdf) | ||
} | ||
#' The EP distribution | ||
#' @export | ||
#' @rdname EPd | ||
#' @examples | ||
#' pEPd(1,lambda=2,beta=3) | ||
pEPd<-function(q,lambda,beta,lower.tail=TRUE,log.p=FALSE) | ||
{ | ||
if(any(lambda<=0)) {stop("lambda must be > 0")} | ||
if(any(beta<=0)) {stop("beta must be > 0")} | ||
enuzun<-max(length(q),length(lambda),length(beta)) | ||
q<-rep(q,enuzun/length(q)+1)[1:enuzun] | ||
lambda<-rep(lambda, enuzun/length(lambda)+1)[1:enuzun] | ||
beta<-rep(beta,enuzun/length(beta)+1)[1:enuzun] | ||
cdf<-NULL | ||
for (i in 1:enuzun) | ||
{ | ||
if(q[i]>0) cdf[i]<-((exp(lambda[i]*exp(-beta[i]*q[i]))-exp(lambda[i]))* | ||
(1-exp(lambda[i]))^(-1)) else cdf[i]<-0 | ||
} | ||
if(lower.tail==FALSE) cdf<-1-cdf | ||
if(log.p==TRUE) cdf<-log(cdf) | ||
return(cdf) | ||
} | ||
#' The EP distribution | ||
#' @export | ||
#' @rdname EPd | ||
#' @examples | ||
#' qEPd(.8,lambda=2,beta=3) | ||
qEPd<-function(p,lambda,beta,lower.tail=TRUE) | ||
{ | ||
if(any(p<0)|any(p>1)) {stop("p must be between >= 0 and <= 1")} | ||
if(any(lambda<=0)) {stop("lambda must be > 0")} | ||
if(any(beta<=0)) {stop("beta must be > 0")} | ||
enuzun<-max(length(p),length(lambda),length(beta)) | ||
p<-rep(p,enuzun/length(p)+1)[1:enuzun] | ||
lambda<-rep(lambda,enuzun/length(lambda)+1)[1:enuzun] | ||
beta<-rep(beta,enuzun/length(beta)+1)[1:enuzun] | ||
qfonk<-NULL | ||
for (i in 1:enuzun) | ||
{ | ||
qfonk[i]<--(log(log((exp(lambda[i])+p[i]-p[i]*exp(lambda[i])))/lambda[i])/ | ||
beta[i]) | ||
} | ||
if(lower.tail==FALSE) | ||
{ | ||
qfonk[i]<--(log(log((exp(lambda[i])+(1-p[i])-(1-p[i])*exp(lambda[i])))/ | ||
lambda[i])/beta[i]) | ||
} | ||
return(qfonk) | ||
} | ||
#' The EP distribution | ||
#' @export | ||
#' @rdname EPd | ||
#' @examples | ||
#' rEPd(10,lambda=2,beta=3) | ||
rEPd<-function(n,lambda,beta) | ||
{ | ||
n<-floor(n) | ||
if(any(n<1)) {stop("n must be >= 1")} | ||
if(any(lambda<=0)) {stop("lambda must be > 0")} | ||
if(any(beta<=0)) {stop("beta must be > 0")} | ||
rn<-qEPd(stats::runif(n),lambda,beta) | ||
return(rn) | ||
} |
Oops, something went wrong.