From 214ec8f8b19db049ea386fcd382cb63571f0fa62 Mon Sep 17 00:00:00 2001 From: Thomas Wutzler Date: Mon, 30 Jul 2018 13:55:03 +0200 Subject: [PATCH] First argument name of dlogitnorm renamed from q to x --- NEWS.md | 1 + R/logitnorm.R | 16 ++++++++-------- man/dlogitnorm.Rd | 4 ++-- man/plogitnorm.Rd | 3 +-- man/qlogitnorm.Rd | 3 +-- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/NEWS.md b/NEWS.md index 6888146..fcde125 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ # logitnorm 0.8.37 - Density returns 0 instead of NAN outside (0,1) +- Changed first argument name of dlogitnorm from q to x # logitnorm 0.8.36 Remove the library call to MASS. diff --git a/R/logitnorm.R b/R/logitnorm.R index 92fd7d7..2c194be 100755 --- a/R/logitnorm.R +++ b/R/logitnorm.R @@ -39,7 +39,7 @@ rlogitnorm <- function( plogitnorm <- function( ### Distribution function for logitnormal distribution - q + q ##<< vector of quantiles , mu = 0, sigma = 1 ##<< distribution parameters , ... ){ @@ -51,7 +51,7 @@ plogitnorm <- function( dlogitnorm <- function( ### Density function of logitnormal distribution - q ##<< quantiles + x ##<< vector of quantiles , mu = 0, sigma = 1 ##<< distribution parameters , log = FALSE ##<< if TRUE, the log-density is returned , ... ##<< further arguments passed to \code{\link{dnorm}}: \code{mean}, @@ -68,25 +68,25 @@ dlogitnorm <- function( ##seealso<< \code{\link{logitnorm}} ##details<< The function is only defined in interval (0,1), but the density ## returns 0 outside the support region. - ql <- qlogis(q) + ql <- qlogis(x) # multiply (or add in the log domain) by the Jacobian (derivative) of the # back-Transformation (logit) if (log) { ifelse( - q <= 0 | q >= 1, 0, - dnorm(ql, mean = mu, sd = sigma, log = TRUE, ...) - log(q) - log1p(-q) + x <= 0 | x >= 1, 0, + dnorm(ql, mean = mu, sd = sigma, log = TRUE, ...) - log(x) - log1p(-x) ) } else { ifelse( - q <= 0 | q >= 1, 0, - dnorm(ql,mean = mu,sd = sigma,...)/q/(1 - q) + x <= 0 | x >= 1, 0, + dnorm(ql,mean = mu,sd = sigma,...)/x/(1 - x) ) } } qlogitnorm <- function( ### Quantiles of logitnormal distribution. - p + p ##<< vector of probabilities , mu = 0, sigma = 1 ##<< distribution parameters , ... ){ diff --git a/man/dlogitnorm.Rd b/man/dlogitnorm.Rd index 573950d..d948a97 100755 --- a/man/dlogitnorm.Rd +++ b/man/dlogitnorm.Rd @@ -2,10 +2,10 @@ \alias{dlogitnorm} \title{dlogitnorm} \description{Density function of logitnormal distribution } -\usage{dlogitnorm(q, mu = 0, sigma = 1, log = FALSE, +\usage{dlogitnorm(x, mu = 0, sigma = 1, log = FALSE, ...)} \arguments{ - \item{q}{quantiles} + \item{x}{vector of quantiles} \item{mu}{distribution parameters} \item{sigma}{ } diff --git a/man/plogitnorm.Rd b/man/plogitnorm.Rd index 228d0fd..c2aa959 100755 --- a/man/plogitnorm.Rd +++ b/man/plogitnorm.Rd @@ -4,8 +4,7 @@ \description{Distribution function for logitnormal distribution } \usage{plogitnorm(q, mu = 0, sigma = 1, ...)} \arguments{ - \item{q}{ -} + \item{q}{vector of quantiles} \item{mu}{distribution parameters} \item{sigma}{ } diff --git a/man/qlogitnorm.Rd b/man/qlogitnorm.Rd index 04c93f9..8712bcb 100755 --- a/man/qlogitnorm.Rd +++ b/man/qlogitnorm.Rd @@ -4,8 +4,7 @@ \description{Quantiles of logitnormal distribution. } \usage{qlogitnorm(p, mu = 0, sigma = 1, ...)} \arguments{ - \item{p}{ -} + \item{p}{vector of probabilities} \item{mu}{distribution parameters} \item{sigma}{ }