Simulating the Generalized logistic distribution
genlog_simu.Rd
Creating a simulation of the generalized logistic distribution maximum likelihood estimation of the parameters
with parallelized processing code using the foreach
package.
Usage
genlog_simu(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 4, the parameters are the values of
c(a, b, p, mu)
as listed inrgenlog
,mu
can 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)
. Can be an object returned bygenlog_slider
. There are no default values.- sample.size
the sample size to be taken in each
k
simulation.- 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) = ((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)$$
For more about the distribution use help(dgenlog)
.
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.
Examples
genlog_simu(real.par = c(0.3, 0.9, 1.5, 0.0), init.par = c(0.9, 0.3, 0.2, 0.0),
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".
#> "