weibull3P {MethylIT}  R Documentation 
This function performs the nonlinear fit of Weibull CDF of a variable x
weibull3P(X, sample.size = 20, model = c("all", "2P", "3P", "Weibull2P", "Weibull3P"), npoints = NULL, maxiter = 1024, tol = 1e12, ftol = 1e12, ptol = 1e12, minFactor = 10^6, nlms = FALSE, verbose = TRUE, ...)
X 
numerical vector 
sample.size 
size of the sample 
model 
Distribution model to fit, twoparameters and threeparameters Weibull model ("Weibull2P" or simply "2P" and "Weibull3P" or "3P). Default is "all" and the model with the best AIC criterion is reported. 
npoints 
number of points used in the fit 
maxiter 
positive integer. Termination occurs when the number of iterations reaches maxiter. Default value: 1024 
tol 
A positive numeric value specifying the tolerance level for the relative offset convergence criterion. Default value: 1e12, 
ftol 
nonnegative numeric. Termination occurs when both the actual and predicted relative reductions in the sum of squares are at most ftol. Therefore, ftol measures the relative error desired in the sum of squares. Default value: 1e12, 
ptol 
nonnegative numeric. Termination occurs when the relative error between two consecutive iterates is at most ptol. Therefore, ptol measures the relative error desired in the approximate solution. Default value: 1e12, 
minFactor 
A positive numeric value specifying the minimum stepsize factor allowed on any step in the iteration. The increment is calculated with a GaussNewton algorithm and successively halved until the residual sum of squares has been decreased or until the stepsize factor has been reduced below this limit. Default value: 10^6 
nlms 
Logical. Whether to return the nonlinear model object

verbose 
if TRUE, prints the function log to stdout 
... 
other parameters 
The script algorithm first try to fit the twoparameter Weibull CDF (Weibull2P). If Weibull2P did not fit, then the algorithm will try to fit Weibull3P. The LevenbergMarquardt algorithm implemented in 'minpack.lm' R package is used to perform the nonlinear fit. Crossvalidations for the nonlinear regressions (R.Cross.val) were performed in each methylome as described in reference [1]. In addition, Stein's formula for adjusted R squared (rho) was used as an estimator of the average crossvalidation predictive power [1].
Model table with coefficients and goodnessoffit results: Adj.R.Square, deviance, AIC, R.Cross.val, and rho, as well as, the coefficient covarianza matrix.
Robersy Sanchez  06/03/2016 <https://github.com/genomaths>
1. Stevens JP. Applied Multivariate Statistics for the Social Sciences. Fifth Edit. Routledge Academic; 2009.
x < rweibull(1000, shape=0.75, scale=1) weibull3P(x, sample.size = 100)