Title: | Power Normal Distribution |
---|---|
Description: | Miscellaneous functions for a descriptive analysis and initial Bayesian and classical inference for the power parameter of the the Power Normal (PN) distribution. This miscellaneous will be extend for more distributions into the power family and the three-parameter model. |
Authors: | Gualberto Segundo Agamez Montalvo, Marcia D'Elia Branco |
Maintainer: | Gualberto Segundo Agamez Montalvo <[email protected]> |
License: | GPL-2 |
Version: | 1.2.0 |
Built: | 2025-02-22 04:09:06 UTC |
Source: | https://github.com/cran/PowerNormal |
Density, distribution function, quantile function and random generation for the PN distribution with power equal to alpha.
dpn(x, alpha) ppn(q, alpha) qpn(p, alpha) rpn(n, alpha)
dpn(x, alpha) ppn(q, alpha) qpn(p, alpha) rpn(n, alpha)
x , q
|
vector of observations or quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
alpha |
power parameter. |
The alpha parameter must be greater than 0 (alpha > 0)
.
Lehmann, EL. (1953). The power of rank tests. The Annals of Mathematical Statistics, 24, 23–43.
Durrans, SR. (1992). Distributions of fractional order statistics in hydrology. Water Resources Research, 28, 1649–1655.
Agamez-Montavo, G. (2017). Modelos de mistura finita usando a classe de distribuicoes alpha potencia. Thesis (Doctoral), University of Sao Paulo.
# Density dpn(2,1) dnorm(2) # Distribution function ppn(2,1) pnorm(2) # Quantile function qpn(0.5,1) qnorm(0.5) # Random generation alpha <- 0.5 n <- 10 rpn(n, alpha)
# Density dpn(2,1) dnorm(2) # Distribution function ppn(2,1) pnorm(2) # Quantile function qpn(0.5,1) qnorm(0.5) # Random generation alpha <- 0.5 n <- 10 rpn(n, alpha)
Return the posterior mean, median and variance of power parameter for PN distribution
pn.bayes(x,prior= "Jeffreys", shape_0 = NULL, rate_0 = NULL)
pn.bayes(x,prior= "Jeffreys", shape_0 = NULL, rate_0 = NULL)
x |
the response vector |
prior |
the prior distribution of power parameter: "Jeffreys" (default), "Uniform" and "Gamma" |
shape_0 , rate_0
|
shape and rate hyperparameters of the gamma distribution. |
Agamez-Montavo, G. (2017). Modelos de mistura finita usando a classe de distribuicoes alpha potencia. Thesis (Doctoral), University of Sao Paulo.
x <- rpn(100, 25) pn.bayes(x) pn.bayes(x, prior = 'Uniform') pn.bayes(x, prior = 'Gamma', 1/100, 1/100)
x <- rpn(100, 25) pn.bayes(x) pn.bayes(x, prior = 'Uniform') pn.bayes(x, prior = 'Gamma', 1/100, 1/100)
Unbiased estimator for alpha
of PN distribution
pn.bias(x)
pn.bias(x)
x |
the response vector |
Gupta RD, Gupta RC. (1998). Analyzing skewed data by power normal model. Test, 17, 197–210.
Plot the estimated density or log-density (PN)
pn.dens(x, model, log=FALSE, ylab=NULL, xlab = NULL, main = NULL, ...)
pn.dens(x, model, log=FALSE, ylab=NULL, xlab = NULL, main = NULL, ...)
x |
the response vector |
model |
a variable returned by |
log |
Logical, plot log-density if TRUE (default = FALSE) |
ylab |
Title of the ylab, if NULL default is selected |
xlab |
Title of the xlab, if NULL default is selected |
main |
Main Title, if NULL default is selected |
... |
further arguments to plot |
Plot the histogram along with the estimated density (PN)
pn.hist(x, model, breaks, main,..., col.lines, lwd, lty )
pn.hist(x, model, breaks, main,..., col.lines, lwd, lty )
x |
the response vector |
model |
a variable returned by |
breaks |
the same option in histogram |
main |
the main title (have useful default values) |
... |
further arguments to histogram |
col.lines |
line color |
lwd |
line width |
lty |
line type |
Confidence interval for the power parameter of PN distribution
pn.IC(x,p)
pn.IC(x,p)
x |
the response vector |
p |
confidence level |
Gupta RD, Gupta RC. (1998). Analyzing skewed data by power normal model. Test, 17, 197–210.
Credibility interval for the power parameter of PN distribution
pn.ICred(x, p, prior="Jeffreys", shape_0=NULL, rate_0 = NULL)
pn.ICred(x, p, prior="Jeffreys", shape_0=NULL, rate_0 = NULL)
x |
the response vector |
p |
credibility level |
prior |
the prior distribution of power parameter: "Jeffreys" (default), "Uniform" and "Gamma" |
shape_0 , rate_0
|
shape and rate hyperparameters of the gamma distribution. |
Agamez-Montavo, G. (2017). Modelos de mistura finita usando a classe de distribuicoes alpha potencia. Thesis (Doctoral), University of Sao Paulo.
x <- rpn(100, 25) pn.ICred(x, 0.95) pn.ICred(x, 0.95, prior = 'Uniform') pn.ICred(x, 0.95, prior = 'Gamma', 1/100, 1/100)
x <- rpn(100, 25) pn.ICred(x, 0.95) pn.ICred(x, 0.95, prior = 'Uniform') pn.ICred(x, 0.95, prior = 'Gamma', 1/100, 1/100)
Add lines of PN estimated denisty or log-density in pn.dens or pn.hist plots.
pn.lines(x, model, log=FALSE, ...)
pn.lines(x, model, log=FALSE, ...)
x |
the response vector |
model |
a variable returned by |
log |
Logical, plot log-density if TRUE (default = FALSE) |
... |
further arguments to |
Return the estimative of power parameter for PN distribution
pn.mle(x)
pn.mle(x)
x |
the response vector |
Gupta RD, Gupta RC. (1998). Analyzing skewed data by power normal model. Test, 17, 197–210.