Simulating the Generalized logistic distribution with skewness
genlog_simu_sk.RdCreating a simulation of the generalized logistic distribution with skewness maximum likelihood estimation of the parameters
with parallelized processing code using the foreach package.
Usage
genlog_simu_sk(real.par, init.par, sample.size = 100,
k = 1000, seed = 555, threads = 1, progress.bar = T)Arguments
- real.par
the real parameters value of the distribution wich the random sample will be taken. It has to be a vector of length 5, the parameters are the values of
c(a, b, p, mu)as listed inrgenlog,mucan be omitted and will be set to 0. There are no default values.- init.par
Initial values for the parameters to be optimized over in the following order
c(a, b, p, mu, skew). Can be an object returned bygenlog_slider. There are no default values.- sample.size
the sample size to be taken in each
ksimulation.- k
the number of simulations.
- seed
seed to be given to
set.seed()function during the sampling process- threads
the numbers of CPU threads to be used for parallel computing. If the threads number is higher than the available the maximum allowed will be used.
- progress.bar
show progress bar for each thread during simulations, default value
TRUE.
Value
It returns a data.frame with k rows (each simulation) and 7 columns with the following information:
a, b, p and mu are estimations using maximum likelihood estimation, for more info help(genlogis_mle)
sample.size The sample size used for each k simulation.
convergence The estimation's convergence status.
Details
The used distribution for this package 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)) $$
References
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.
Examples
genlog_simu_sk(real.par = c(0.3, 0.9, 1.5, 0.0, .9), init.par = c(0.9, 0.3, 0.2, 0.0, .9),
sample.size = 100, k = 50, threads = 2, seed = 200)
#> Error in { if (progress.bar == T) { if (!exists("pb")) pb <- tcltk::tkProgressBar("Parallel task", min = 1, max = k) tcltk::setTkProgressBar(pb, i) } core()}: task 1 failed - "[tcl] invalid command name "toplevel".
#> "