Learn R Programming

PWEALL (version 1.3.0.1)

pwu: Piecewise uniform distribution: distribution

Description

This will calculate the distribution function of the piecewise uniform distribution

Usage

pwu(t=seq(0,1,by=0.1),u=c(0,5,0.5),ut=c(1,2))

Value

dist

distribution

Arguments

t

a vector of time points

u

piecewise constant density

ut

a strictly increasing sequence of time points defining the pieces. The first element must be strictly greater than zero. u and ut must have the same length.

Author

Xiaodong Luo

Details

Let \(f(t)=\sum_{j=1}^m u_j I(t_{j-1}<t\le t_j)\) be the density function, where \(u_1,\ldots,u_m\) are the corresponding elements of u and \(t_1,\ldots,t_{m}\) are the corresponding elements of ut and \(t_0=0\). The distribution function $$F(t)=\sum_{j=1}^m u_j(t\wedge t_j-t\wedge t_{j-1}). $$ User must make sure that \(\sum_{j=1}^m u_j (t_j-t_{j-1})=1\) before using this function.

References

Luo, et al. (2017)

See Also

pwe

Examples

Run this code
t<-seq(-1,3,by=0.5)
u<-c(0.6,0.4)
ut<-c(1,2)
pwud<-pwu(t=t,u=u,ut=ut)
pwud

Run the code above in your browser using DataLab