UPHN: The Unit-Power Half-Normal family

View source: R/UPHN.R

UPHNR Documentation

The Unit-Power Half-Normal family

Description

The function UPHN() defines the Unit-Power Half-Normal distribution, a two parameter distribution, for a gamlss.family object to be used in GAMLSS fitting using the function gamlss().

Usage

UPHN(mu.link = "log", sigma.link = "log")

Arguments

mu.link

defines the mu.link, with "log" link as the default for the mu parameter.

sigma.link

defines the sigma.link, with "log" link as the default for the sigma.

Details

The UPHN distribution with parameters \mu and \sigma has a support in (0, 1) and density given by

f(x| \mu, \sigma) = \frac{2\mu}{\sigma x^2} \phi(\frac{1-x}{\sigma x}) (2 \Phi(\frac{1-x}{\sigma x})-1)^{\mu-1}

for 0 < x < 1, \mu > 0 and \sigma > 0.

Value

Returns a gamlss.family object which can be used to fit a UPHN distribution in the gamlss() function.

Author(s)

Juan Diego Suarez Hernandez, jsuarezhe@unal.edu.co

References

Santoro, K. I., Gomez, Y. M., Soto, D., & Barranco-Chamorro, I. (2024). Unit-Power Half-Normal Distribution Including Quantile Regression with Applications to Medical Data. Axioms, 13(9), 599.

See Also

dUPHN.

Examples

# Example 1
# Generating random values with
# known mu and sigma
require(gamlss)
mu <- 1.5
sigma <- 4.0

y <- rUPHN(1000, mu, sigma)

mod1 <- gamlss(y~1, sigma.fo=~1,  family=UPHN,
               control=gamlss.control(n.cyc=5000, trace=TRUE))

exp(coef(mod1, what="mu"))
exp(coef(mod1, what="sigma"))

# Example 2
# Generating random values under some model

# A function to simulate a data set with Y ~ UPHN
gendat <- function(n) {
  x1 <- runif(n)
  x2 <- runif(n)
  mu <- exp(0.75 - 0.69 * x1)   # Approx 1.5
  sigma <- exp(0.5 - 0.64 * x2) # Approx 1.20
  y <- rUPHN(n, mu, sigma)
  data.frame(y=y, x1=x1, x2=x2)
}

dat <- gendat(n=2000)

mod2 <- gamlss(y~x1, sigma.fo=~x2, family=UPHN, data=dat,
               control=gamlss.control(n.cyc=5000, trace=TRUE))

summary(mod2)

ZeroOneDists documentation built on March 7, 2026, 1:07 a.m.