Title: | Nonlinear Regression Parameters Estimation by 'CRS4HC' and 'CRS4HCe' |
---|---|
Description: | Functions for nonlinear regression parameters estimation by algorithms based on Controlled Random Search algorithm. Both functions (crs4hc(), crs4hce()) adapt current search strategy by four heuristics competition. In addition, crs4hce() improves adaptability by adaptive stopping condition. |
Authors: | Josef Tvrdík [aut], Tomáš Goryl [trl, cre] |
Maintainer: | Tomáš Goryl <[email protected]> |
License: | GPL-2 |
Version: | 0.2 |
Built: | 2024-12-08 07:01:49 UTC |
Source: | CRAN |
This function estimates the regression coefficients of a nonlinear regression function using least squares. The minimization is performed by the CRS algorithm with four competing local heuristics. Algorithm is described in Tvrdík et al. (2007).
crs4hc(formula, data, a, b, N, my_eps, max_evals, delta, w0)
crs4hc(formula, data, a, b, N, my_eps, max_evals, delta, w0)
formula |
(obligatory) a nonlinear formula including variables and parameters |
data |
(obligatory) data frame in which to evaluate the variables in |
a |
(obligatory) a vector of length equal to number of parameters representing lower bounds of search space (bounds for parameters must be specified in the same order they appear on right-hand side of |
b |
(obligatory) a vector of length equal to number of parameters representing upper bounds of search space (bounds for parameters must be specified in the same order they appear on right-hand side of |
N |
(optional) size of population. Default value is |
my_eps |
(optional) is used for stopping condition. Default value is 1e-15. |
max_evals |
(optional) is used for stopping condition, specifies maximum number of objective function evaluations per dimension (dimension=nonlinear model parameter). Default value is 40000. |
delta |
(optional) controls the competition of local heuristics. Default value is 0.05. delta > 0. |
w0 |
(optional) controls the competition of local heuristics. Default value is 0.5. w0 > 0. |
There are implemented methods for generic functions print, summary, plot.
An S3 object of class crs4hc
. This object is a list of:
model |
a list of two items, includes estimates of nonlinear model parameters and minimal residual sum of squares |
algorithmInfo |
a list of three items with some internal info about algorithm run |
data |
a data frame that was passed to function as the |
other |
a list of four items which include info about nonlinear model |
Tvrdík, J., Křivý, I., and Mišík, L. Adaptive Population-based search: Application to Estimation of Nonlinear Regression Parameters. Computational Statistics and Data Analysis 52 (2007), 713–724. Preprint URL http://www1.osu.cz/~tvrdik/wp-content/uploads/CSDA-06SAS03e.pdf
x <- c(1,2,3,5,7,10) y <- c(109,149,149,191,213,224) df <- data.frame(x=x, y=y) lowerBounds <- c(1, 0.1) upperBounds <- c(1000, 2) mod <- crs4hc(y ~ b1 * (1-exp(-b2*x)), df, lowerBounds, upperBounds) mod
x <- c(1,2,3,5,7,10) y <- c(109,149,149,191,213,224) df <- data.frame(x=x, y=y) lowerBounds <- c(1, 0.1) upperBounds <- c(1000, 2) mod <- crs4hc(y ~ b1 * (1-exp(-b2*x)), df, lowerBounds, upperBounds) mod
This function estimates the regression coefficients of a nonlinear regression function using least squares. The minimization is performed by the CRS algorithm with four competing local heuristics and adaptive stopping condition. Algorithm is described in Tvrdík et al. (2007).
crs4hce(formula, data , a, b, N, my_eps0, gamma, max_evals, delta, w0)
crs4hce(formula, data , a, b, N, my_eps0, gamma, max_evals, delta, w0)
formula |
(obligatory) a nonlinear formula including variables and parameters |
data |
(obligatory) data frame in which to evaluate the variables in |
a |
(obligatory) a vector of length equal to number of parameters representing lower bounds of search space (bounds for parameters must be specified in the same order they appear on right-hand side of |
b |
(obligatory) a vector of length equal to number of parameters representing upper bounds of search space (bounds for parameters must be specified in the same order they appear on right-hand side of |
N |
(optional) size of population. Default value is |
my_eps0 |
(optional) is used for adaptation of stopping condition. Default value is 1e-9. |
gamma |
(optional) is used for adaptation of stopping condition. Default value is 1e7. |
max_evals |
(optional) is used for stopping condition, specifies maximum number of objective function evaluations per dimension (dimension=nonlinear model parameter). Default values is 40000. |
delta |
(optional) controls the competition of local heuristics. Default value is 0.05. delta > 0. |
w0 |
(optional) controls the competition of local heuristics. Default value is 0.5. w0 > 0. |
It´s recommended to modify values of my_eps0
and gamma
together. There are implemented methods for generic functions print, summary, plot.
An S3 object of class crs4hc
. This object is a list of:
model |
a list of two items, includes estimates of nonlinear model parameters and minimal residual sum of squares |
algorithmInfo |
a list of three items with some internal info about algorithm run |
data |
a data frame that was passed to function as the |
other |
a list of four items which include info about nonlinear model |
Tvrdík, J., Křivý, I., and Mišík, L. Adaptive Population-based search: Application to Estimation of Nonlinear Regression Parameters. Computational Statistics and Data Analysis 52 (2007), 713–724. Preprint URL http://www1.osu.cz/~tvrdik/wp-content/uploads/CSDA-06SAS03e.pdf
x <- c(1,2,3,5,7,10) y <- c(109,149,149,191,213,224) df <- data.frame(x=x, y=y) lowerBounds <- c(1, 0.1) upperBounds <- c(1000, 2) mod <- crs4hce(y ~ b1 * (1-exp(-b2*x)), df, lowerBounds, upperBounds) mod
x <- c(1,2,3,5,7,10) y <- c(109,149,149,191,213,224) df <- data.frame(x=x, y=y) lowerBounds <- c(1, 0.1) upperBounds <- c(1000, 2) mod <- crs4hce(y ~ b1 * (1-exp(-b2*x)), df, lowerBounds, upperBounds) mod