Package 'tpwb'

Title: The Three Parameter Weibull Distribution
Description: Density, distribution function, the quantile function, random generation function, and maximum likelihood estimation.
Authors: Atchanut Rattanalertnusorn [aut, cre]
Maintainer: Atchanut Rattanalertnusorn <[email protected]>
License: GPL-3
Version: 0.1.0
Built: 2025-03-07 03:48:26 UTC
Source: https://github.com/cran/tpwb

Help Index


Distribution function plot of the three-parameter Weibull distribution

Description

Distribution function plot of the three-parameter Weibull distribution with specified shape, scale and location.

Usage

cdfplot(x, shape, scale, location)

Arguments

x

vector of quantiles

shape

shape parameter (β\beta) of the three-parameter Weibull distribution, where β>0\beta >0.

scale

scale parameter (α\alpha) of the three-parameter Weibull distribution, where α>0\alpha > 0.

location

location parameter (δ\delta) of the three-parameter Weibull distribution, where δ0\delta \ge 0.

Value

Distribution function plot of the three-parameter Weibull distribution.

References

Johnson, N. L., Kotz, S. and Balakrishnan, N. (1995) Continuous Univariate Distributions, volume 1, chapter 21. Wiley, New York.

Examples

x <- rtpwb(100,1.5,2,1)
cdfplot(x,1.5,2,1)

Maximum likelihood estimation (MLE) for the three-parameter Weibull distribution.

Description

This function for estimating parameter of the three-parameter Weibull distribution.

Usage

mlewb(x, shape, scale, location)

Arguments

x

vector of quantiles.

shape

shape parameter, where β>0\beta > 0.

scale

scale parameter, where α>0\alpha > 0.

location

location parameter, where δ0\delta \ge 0.

Value

the estimated shape, scale and location values of the three-parameter Weibull distribution.

Note

the result of this function may produce a Warning message, but not effect to the estimated parameter.

References

Johnson, N. L., Kotz, S. and Balakrishnan, N. (1995) Continuous Univariate Distributions, volume 1, chapter 21. Wiley, New York.

Examples

x<- rtpwb(1000,2,3,1) #n=1000 large sample
mlewb(x,2,3,1)
x<- rtpwb(50,2,3,1) #n=50 medium sample
mlewb(x,2,3,1)
x<- rtpwb(10,2,3,1) #n=10 small sample
mlewb(x,2,3,1)

Probability density function plot of the three-parameter Weibull distribution

Description

Probability density function plot of the three-parameter Weibull distribution with specified shape, scale and location.

Usage

pdfplot(x, shape, scale, location)

Arguments

x

vector of quantiles

shape

shape parameter (β\beta) of the three-parameter Weibull distribution, where β>0\beta >0.

scale

scale parameter (α\alpha) of the three-parameter Weibull distribution, where α>0\alpha > 0.

location

location parameter (δ\delta) of the three-parameter Weibull distribution, where δ0\delta \ge 0.

Value

Probability density function plot of the three-parameter Weibull distribution.

References

Johnson, N. L., Kotz, S. and Balakrishnan, N. (1995) Continuous Univariate Distributions, volume 1, chapter 21. Wiley, New York.

Examples

x <- rtpwb(100,1.5,2,1)
pdfplot(x,1.5,2,1)

The three-parameter Weibull distribution(tpwb)

Description

Density, distribution function, quantile function, and random generation function for the three-parameter Weibull distribution with shape, scale and location

Usage

dtpwb(x, shape, scale, location = 1, log = FALSE)

ptpwb(q, shape, scale, location = 1, lower.tail = TRUE, log.p = FALSE)

qtpwb(p, shape, scale, location = 1, lower.tail = TRUE, log.p = FALSE)

rtpwb(n, shape, scale, location = 1)

Arguments

x, q

vector of quantiles.

shape

shape parameter, where β>0\beta > 0.

scale

scale parameter, where α>0\alpha > 0.

location

location parameter, where δ0\delta \ge 0.

log, log.p

logical; (default = FALSE), if TRUE, then probabilities are given as log(p).

lower.tail

logical; if TRUE (default), probabilities are P[Xx]P[X \le x], otherwise, P[X>x]P[X > x].

p

vector of probabilities

n

number of observations. If length(n) > 1, the length is taken to be the number required.

Value

dtpwb gives the density, ptpwb gives the distribution function, qtpwb gives the quantile function, and rtpwb generates random samples.

Note

If location parameter, δ=0\delta = 0 , it reduced to the two-parameter Weibull distribution.

References

Johnson, N. L., Kotz, S. and Balakrishnan, N. (1995) Continuous Univariate Distributions, volume 1, chapter 21. Wiley, New York.

Examples

x <- rtpwb(20,1.5,3,1)
dtpwb(x,1.5,3,1)
dtpwb(x,1.5,3,1,log=TRUE)

q <- rtpwb(20,1.5,3,1)
ptpwb(q,1.5,3,1 )
ptpwb(q,1.5,3,1, lower.tail = FALSE)

q <- rtpwb(20,1.5,3,1); q
p<- ptpwb(q,1.5,3,1 ); p
qtpwb(p,1.5,3,1)

rtpwb(5, 1.5, 3, 0) # the same as rweibull(5,1.5,3)
rtpwb(25,0.5, 2, 1)