Skip to contents

Density, distribution function, quantile function, random generation and hazard function for the reduced new modified Weibull distribution with parameters mu, sigma and nu.

Usage

dRNMW(x, mu, sigma, nu, log = FALSE)

Arguments

x, q

vector of quantiles.

mu

parameter one.

sigma

parameter two.

nu

parameter three.

log, log.p

logical; if TRUE, probabilities p are given as log(p).

p

vector of probabilities.

n

number of observations.

lower.tail

logical; if TRUE (default), probabilities are P[T <= t], otherwise, P[T > t].

Value

dRNMW gives the density, pRNMW gives the distribution function, qRNMW gives the quantile function, rRNMW generates random deviates and hRNMW gives the hazard function.

Details

The reduced new modified Weibull with parameters mu, sigma and theta has density given by

$$f(x) = \frac{1}{2 \sqrt{x}} \left( \mu + \sigma (1 + 2 \nu x) e^{\nu x} \right) e^{-\mu \sqrt{x} - \sigma \sqrt{x} e^{\nu x}}$$

for x > 0, $$\mu$$, $$\sigma$$ and $$\lambda$$ > 0.

References

almalki2013reducedRelDists

Examples

old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters

## The probability density function
curve(
    dRNMW(x, mu = 0.05, sigma = 0.00025, nu = 2.2),
    from = 0, to = 5, col = "red", las = 1, ylab = "f(x)"
)
#> Error in dRNMW(x, mu = 0.05, sigma = 0.00025, nu = 2.2): could not find function "dRNMW"

## The cualphalative distribution and the Reliability function
par(mfrow = c(1, 2))
curve(
    pRNMW(x, mu = 0.05, sigma = 0.00025, nu = 2.2),
    from = 0, to = 5, ylim = c(0, 1),
    col = "red", las = 1, ylab = "F(x)"
)
#> Error in pRNMW(x, mu = 0.05, sigma = 0.00025, nu = 2.2): could not find function "pRNMW"
curve(
    pRNMW(
        x, mu = 0.05, sigma = 0.00025, nu = 2.2, 
        lower.tail = FALSE
    ),
    from = 0, to = 5, ylim = c(0, 1),
    col = "red", las = 1, ylab = "R(x)"
)
#> Error in pRNMW(x, mu = 0.05, sigma = 0.00025, nu = 2.2, lower.tail = FALSE): could not find function "pRNMW"

## The quantile function
p <- seq(from = 0, to = 0.999, length.out = 100)
plot(
    x = qRNMW(p, mu = 0.05, sigma = 0.00025, nu = 2.2),
    y = p, xlab = "Quantile", las = 1,
    ylab = "Probability"
)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'plot': could not find function "qRNMW"
curve(
    pRNMW(x, mu = 0.05, sigma = 0.00025, nu = 2.2),
    from = 0, add = TRUE, col = "red"
)
#> Error in pRNMW(x, mu = 0.05, sigma = 0.00025, nu = 2.2): could not find function "pRNMW"

## The random function
hist(
    rRNMW(n = 10000, mu = 0.05, sigma = 0.00025, nu = 2.2),
    freq = FALSE, xlab = "x", las = 1, main = "", ylim = c(0,0.8)
)
#> Error in rRNMW(n = 10000, mu = 0.05, sigma = 0.00025, nu = 2.2): could not find function "rRNMW"
curve(dRNMW(x, mu = 0.05, sigma = 0.00025, nu = 2.2),
    from = 0, add = TRUE, col = "red"
)
#> Error in dRNMW(x, mu = 0.05, sigma = 0.00025, nu = 2.2): could not find function "dRNMW"

## The Hazard function
par(mfrow = c(1, 1))
curve(
    hRNMW(x, mu = 0.003, sigma = 5e-6, nu = 0.025),
    from = 0, to = 250, col = "red", 
    ylab = "Hazard function", las = 1
)
#> Error in hRNMW(x, mu = 0.003, sigma = 5e-06, nu = 0.025): could not find function "hRNMW"

par(old_par) # restore previous graphical parameters