Make a generalized logistic distribution slider to compare histogram with theoretical distribution
genlog_slider(data, return_var = NULL, mu_range = 10, skew = F)The function plots a interactive graphic in RStudio Viewer panel.
Also, the parameters a, b, p and mu can be returned to
return_var if asked in the graphic.
vector of data to compare.
a char string to name where parameters are assigned
a number to setup the minimum and maximum range value of the mu parameter
logical, if TRUE, a model with skewness should be used..
There is a small gear in the top left of the graphic where you can slide the parameters @param a,b,p,mu.
The used distribution for this package is given by:
$$f(x) = ((a + b*(1+p)*(abs(x-mu)^p))*exp(-(x-mu)*(a+b*(|x-mu|^p)))) / ((exp(-(x-mu)*(a + b* (|x-mu|^p)))+1)^2)$$
If the density function is not printed it is not defined for these parameters.
For skew = T the model used is
The used distribution for is given by:
$$f(x) = 2*((a + b*(1+p)*(abs(x-mu)^p))*exp(-(x-mu)*(a+b*(abs(x-mu)^p))))/
((exp(-(x-mu)*(a + b* (abs(x-mu)^p)))+1)^2) *
((exp(-(skew*(x-mu))*(a+b*(abs(skew*(x-mu))^p)))+1)^(-1)) $$#' for more information about the model (help(dgenlog_sk))
If the density function is not printed it is not defined for these parameters.
help(dgenlog) for parameters restrictions.
This function requires RStudio to run.
Rathie, P. N. and Swamee, P. K (2006) On a new invertible generalized logistic distribution approximation to normal distribution, Technical Research Report in Statistics, 07/2006, Dept. of Statistics, Univ. of Brasilia, Brasilia, Brazil.
Azzalini, A. (1985) A class of distributions which includes the normal ones. Scandinavian Journal of Statistics.
if (FALSE) {
datas <- rgenlog(1000)
if (manipulate::isAvailable()) {
genlog_slider(datas, return_var = 'parameters')
}
}
Run the code above in your browser using DataLab