Package 'PowerNormal'

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

Help Index


The PN distribution

Description

Density, distribution function, quantile function and random generation for the PN distribution with power equal to alpha.

Usage

dpn(x, alpha)
ppn(q, alpha)
qpn(p, alpha)
rpn(n, alpha)

Arguments

x, q

vector of observations or quantiles.

p

vector of probabilities.

n

number of observations.

alpha

power parameter.

Details

The alpha parameter must be greater than 0 (alpha > 0).

References

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.

Examples

# 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)

Fit univariate PN distribution (Bayesian)

Description

Return the posterior mean, median and variance of power parameter for PN distribution

Usage

pn.bayes(x,prior= "Jeffreys", shape_0 = NULL, rate_0 = NULL)

Arguments

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.

References

Agamez-Montavo, G. (2017). Modelos de mistura finita usando a classe de distribuicoes alpha potencia. Thesis (Doctoral), University of Sao Paulo.

Examples

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 (PN distribution)

Description

Unbiased estimator for alpha of PN distribution

Usage

pn.bias(x)

Arguments

x

the response vector

References

Gupta RD, Gupta RC. (1998). Analyzing skewed data by power normal model. Test, 17, 197–210.


Estimated densities (PN distribution)

Description

Plot the estimated density or log-density (PN)

Usage

pn.dens(x, model, log=FALSE, ylab=NULL, xlab = NULL, main = NULL, ...)

Arguments

x

the response vector

model

a variable returned by pn.mle

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


Histrogram and estimated densities plots (PN distribution)

Description

Plot the histogram along with the estimated density (PN)

Usage

pn.hist(x, model, breaks, main,..., col.lines, lwd, lty  )

Arguments

x

the response vector

model

a variable returned by pn.mle

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 alpha (PN distribution)

Description

Confidence interval for the power parameter of PN distribution

Usage

pn.IC(x,p)

Arguments

x

the response vector

p

confidence level

References

Gupta RD, Gupta RC. (1998). Analyzing skewed data by power normal model. Test, 17, 197–210.


Credibility interval for alpha (PN distribution)

Description

Credibility interval for the power parameter of PN distribution

Usage

pn.ICred(x, p, prior="Jeffreys", shape_0=NULL, rate_0 = NULL)

Arguments

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.

References

Agamez-Montavo, G. (2017). Modelos de mistura finita usando a classe de distribuicoes alpha potencia. Thesis (Doctoral), University of Sao Paulo.

Examples

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)

Plot lines of PN densities

Description

Add lines of PN estimated denisty or log-density in pn.dens or pn.hist plots.

Usage

pn.lines(x, model, log=FALSE, ...)

Arguments

x

the response vector

model

a variable returned by pn.mle

log

Logical, plot log-density if TRUE (default = FALSE)

...

further arguments to lines


Fit univariate PN distribution (Classic)

Description

Return the estimative of power parameter for PN distribution

Usage

pn.mle(x)

Arguments

x

the response vector

References

Gupta RD, Gupta RC. (1998). Analyzing skewed data by power normal model. Test, 17, 197–210.