knitr::opts_chunk$set(echo = TRUE) library(fitODBOD) library(ggplot2) library(reshape2) library(grid) library(gridExtra)
IT WOULD BE CLEARLY BENEFICIAL FOR YOU BY USING THE RMD FILES IN THE GITHUB DIRECTORY FOR FURTHER EXPLANATION OR UNDERSTANDING OF THE R CODE FOR THE RESULTS OBTAINED IN THE VIGNETTES.
Using Moment about zero values is useful to calculating mean, variance, skewness and kurtosis. There is no useful need to plot the moment about zero values against how shape parameter values change. Therefore, I have not plotted it.
Below are the six functions which can produce moment about zero values.
mazUNI
- producing moment about zero values for Uniform distribution.mazTRI
- producing moment about zero values for Triangular distribution.mazBETA
- producing moment about zero values for Beta distribution.mazKUM
- producing moment about zero values for Kumaraswamy distribution.mazGHGBeta
- producing moment about zero values for Gaussian Hyper-geometric Generalized Beta distribution.mazGBeta1
- producing moment about zero values for Generalized Beta Type 1 distribution.mazGamma
- producing moment about zero values for Gamma distribution.Consider the $r^{th}$ Moment about zero for the Beta distribution for when a random variable $P$ is given below
$$E[P^r]= \prod_{i=0}^{r-1} \frac{(\alpha+i)}{(\alpha+\beta+i)} $$ where $\alpha$ (a) and $\beta$ (b) are shape parameters($\alpha, \beta > 0$) .
Using the above four equations it is possible to find the mean, variance, skewness and kurtosis. It is even possible to validate the mean and variance calculated from dxxx functions through the mazxxx functions.
Mean from dBETA compared with mazBETA function
# a=3, b=9 and mean output cat("Mean from dBETA function for (a=3, b=9) =",dBETA(0.5,3,9)$mean,"\n") # a=3, b=9 and first moment cat("Mean from mazBETA function for (a=3, b=9) =",mazBETA(1,3,9))
Variance from dBETA compared with mazBETA function
# a=3,b=9 and variance output cat("Variance from dBETA function for (a=3,b=9) =",dBETA(0.5,3,9)$var,"\n") # a=3, b=9, first moment and second moment cat("Variance from mazBETA function for (a=3,b=9) =",mazBETA(2,3,9)-mazBETA(1,3,9)*mazBETA(1,3,9))
According to the above outputs it clear that the mean and variance can be acquired using moment about zero value functions.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.