pTRI function

Triangular Distribution Bounded Between [0,1]

Triangular Distribution Bounded Between [0,1]

These functions provide the ability for generating probability density values, cumulative probability density values and moments about zero values for the Triangular Distribution bounded between [0,1].

pTRI(p,mode)

Arguments

  • p: vector of probabilities.
  • mode: single value for mode.

Returns

The output of pTRI gives the cumulative density values in vector form.

Details

Setting min=0min=0 and max=1max=1 mode=cmode=c in the Triangular distribution a unit bounded Triangular distribution can be obtained. The probability density function and cumulative density function of a unit bounded Triangular distribution with random variable P are given by

gP(p)=2pc g_{P}(p)= \frac{2p}{c}

; 0p<c0 \le p < c

gP(p)=2(1p)(1c) g_{P}(p)= \frac{2(1-p)}{(1-c)}

; cp1c \le p \le 1

GP(p)=p2c G_{P}(p)= \frac{p^2}{c}

; 0p<c0 \le p < c

GP(p)=1(1p)2(1c) G_{P}(p)= 1-\frac{(1-p)^2}{(1-c)}

; cp1c \le p \le 1

0mode=c1 0 \le mode=c \le 1

The mean and the variance are denoted by

E[P]=(a+b+c)3=(1+c)3 E[P]= \frac{(a+b+c)}{3}= \frac{(1+c)}{3} var[P]=a2+b2+c2abacbc18=(1+c2c)18 var[P]= \frac{a^2+b^2+c^2-ab-ac-bc}{18}= \frac{(1+c^2-c)}{18}

Moments about zero is denoted as

E[Pr]=2cr+2c(r+2)+2(1cr+1)(1c)(r+1)+2(cr+21)(1c)(r+2) E[P^r]= \frac{2c^{r+2}}{c(r+2)}+\frac{2(1-c^{r+1})}{(1-c)(r+1)}+\frac{2(c^{r+2}-1)}{(1-c)(r+2)}

r=1,2,3,...r = 1,2,3,...

NOTE : If input parameters are not in given domain conditions necessary error messages will be provided to go further.

Examples

#plotting the random variables and probability values col <- rainbow(4) x <- seq(0.2,0.8,by=0.2) plot(0,0,main="Probability density graph",xlab="Random variable", ylab="Probability density values",xlim = c(0,1),ylim = c(0,3)) for (i in 1:4) { lines(seq(0,1,by=0.01),dTRI(seq(0,1,by=0.01),x[i])$pdf,col = col[i]) } dTRI(seq(0,1,by=0.05),0.3)$pdf #extracting the pdf values dTRI(seq(0,1,by=0.01),0.3)$mean #extracting the mean dTRI(seq(0,1,by=0.01),0.3)$var #extracting the variance #plotting the random variables and cumulative probability values col <- rainbow(4) x <- seq(0.2,0.8,by=0.2) plot(0,0,main="Cumulative density graph",xlab="Random variable", ylab="Cumulative density values",xlim = c(0,1),ylim = c(0,1)) for (i in 1:4) { lines(seq(0,1,by=0.01),pTRI(seq(0,1,by=0.01),x[i]),col = col[i]) } pTRI(seq(0,1,by=0.05),0.3) #acquiring the cumulative probability values mazTRI(1.4,.3) #acquiring the moment about zero values mazTRI(2,.3)-mazTRI(1,.3)^2 #variance for when is mode 0.3 #only the integer value of moments is taken here because moments cannot be decimal mazTRI(1.9,0.5)

References

\insertRef horsnell1957economicalfitODBOD

\insertRef johnson1995continuousfitODBOD

\insertRef karlis2008polygonalfitODBOD

\insertRef okagbue2014usingfitODBOD