This function returns A goodness-of-fit criteria for nonlinear model selection, specifically, the cross-validation correlation coefficient R (R.Cross.val).
cdf_crossval(model, ...)
# S4 method for missingORNULL
cdf_crossval(
model,
formula,
pars,
q,
logx = FALSE,
min.val = NULL,
loss.fun = c("linear", "huber", "smooth", "cauchy", "arctg"),
maxiter = 1024,
maxfev = 1e+05,
ptol = 1e-12,
minFactor = 1e-06
)
# S4 method for nls
cdf_crossval(
model,
q,
logx = FALSE,
min.val = NULL,
maxiter = 1024,
ptol = 1e-12,
minFactor = 1e-06
)
# S4 method for CDFmodel
cdf_crossval(
model,
q,
logx = FALSE,
min.val = NULL,
maxiter = 1024,
ptol = 1e-12,
minFactor = 1e-06
)
# S4 method for nls.lm
cdf_crossval(
model,
formula,
q,
logx = FALSE,
min.val = NULL,
maxiter = 1024,
ptol = 1e-12,
minFactor = 1e-06
)
No required for when a model from class
CDFmodel or nls
is provided. Otherwise,
it will be nonlinear model formula including variables and parameters,
which will be coerced to a formula if necessary. For example, for a Gamma
model the formula will be: "Y ~ pgamma(q, shape, scale)", where
pgamma
function is available in 'stats' R package.
However, the nls.lm
class model created by
function fitCDF
has incorporated the formula information.
Estimated model parameters.
Objective variable used to build the model, typically called a vector of quantiles. The model's formula must be expressed in terms of variable \('q'\).
logical(1). If TRUE, then a logarithm transformation will be applied: \(q = log1p(q)\).
A number denoting the lower bound of the domain where CDF is defined. For example, for Weibull and GGamma min.val = 0.
Described in fitCDF
.
A positive numeric value specifying the minimum step-size factor allowed on any step in the iteration. The increment is calculated with a Gauss-Newton algorithm and successively halved until the residual sum of squares has been decreased or until the step-size factor has been reduced below this limit. Default value: 10^-6.
The cross-validation correlation coefficient R (R.Cross.val) is an estimator of the average cross-validation predictive power (1).
Stevens JP. Applied Multivariate Statistics for the Social Sciences. Fifth Edit. Routledge Academic; 2009.
mcgoftest
for Bootstrap test for Goodness of fit.
## Let's simulate a sample from normal distribution
x1 = rnorm(10000, mean = 1.5, sd = 2) + runif(10^4)
## Let's build a model
cdfp <- fitCDF(x1, distNames = "Normal", plot = F)
#>
#> *** Fitting Normal distribution ...
#> .Fitting Done.
#> ** Done ***
## Next, we get an estimation of the cross-validation correlation
## coefficient R (R.Cross.val)
cdf_crossval(model = cdfp$bestfit, q = x1)
#> R.Cross.val
#> 0.9999794