% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dbeta_new.R
\name{dbeta_new}
\alias{dbeta_new}
\title{Density for the Beta distributions.}
\usage{
dbeta_new(
  x,
  mu = NULL,
  v = NULL,
  shape1,
  shape2,
  ncp = 0,
  log = FALSE,
  silent = FALSE
)
}
\arguments{
\item{x}{vector of quantiles.}

\item{mu}{mean of the Beta distribution.}

\item{v}{variance of the Beta distribution.}

\item{shape1}{non-negative parameters of the Beta distribution.}

\item{shape2}{non-negative parameters of the Beta distribution.}

\item{ncp}{non-centrality parameter.}

\item{log}{logical; if TRUE, probabilities p are given as log(p).}

\item{silent}{If FALSE, show the shape1 and shape 2 values.}
}
\value{
dbeta_new gives the density for the Beta distributions
}
\description{
Density for the Beta distribution with parameters mu and v or shape1 and
shape2 (and optional non-centrality parameter ncp).\cr
The returned object has three attributes:\cr
shape1, shape2, and ncp\cr
Note that if x has other attributes, they are preserved.
}
\details{
dbeta_new returns the density for the Beta distributions

The Beta distribution with parameters shape1 = a and shape2 = b has density \cr
gamma(a+b)/(gamma(a)gamma(b))x^(a-1)(1-x)^(b-1)\cr
for a > 0, b > 0 and 0 <= x <= 1 where the boundary values at x=0 or x=1 are defined as by
continuity (as limits).\cr
The mean is a/(a+b) and the variance is ab/((a+b)^2 (a+b+1)). These moments and all
distributional properties can be defined as limits.
}
\examples{
pi <- rbeta(100, shape1=0.48, shape2=0.12)
hist(pi, freq=FALSE, breaks=seq(from=0, to=1, by=0.1), ylim=c(0, 8), las=1)
library("HelpersMG")
mx <- ScalePreviousPlot()$ylim["end"]/
      max(dbeta_new(seq(from=0.01, to=0.99, by=0.01), mu = 0.8, v=0.1))
curve(dbeta_new(x, mu = 0.8, v=0.1)*mx, add=TRUE, col="red")
out <- dbeta_new(0.1, mu = 0.8, v=0.1)
out
attributes(out)$shape1; attributes(out)$shape2; attributes(out)$ncp
dbeta(0.1, shape1=attributes(out)$shape1, shape2=attributes(out)$shape2, 
      ncp=attributes(out)$ncp)

# It can be used to generate random numbers using mu and v
out <- dbeta_new(0.1, mu = 0.8, v=0.1, silent=TRUE)
pi <- rbeta(100, shape1=attributes(out)$shape1, shape2=attributes(out)$shape2, 
      ncp=attributes(out)$ncp)
hist(pi, freq=FALSE, breaks=seq(from=0, to=1, by=0.1), ylim=c(0, 8), las=1)
}
\seealso{
Other Distributions:
\code{\link[=cutter]{cutter()}},
\code{\link[=dSnbinom]{dSnbinom()}},
\code{\link[=dcutter]{dcutter()}},
\code{\link[=dggamma]{dggamma()}},
\code{\link[=dnbinom_new]{dnbinom_new()}},
\code{\link[=logLik.cutter]{logLik.cutter()}},
\code{\link[=plot.cutter]{plot.cutter()}},
\code{\link[=print.cutter]{print.cutter()}},
\code{\link[=r2norm]{r2norm()}},
\code{\link[=rcutter]{rcutter()}},
\code{\link[=rmnorm]{rmnorm()}},
\code{\link[=rnbinom_new]{rnbinom_new()}}
}
\author{
Marc Girondot \email{marc.girondot@gmail.com}
}
\concept{Distributions}
