| Title: | Cauchy Regression |
|---|---|
| Description: | Cauchy regression modelling and LASSO to perform variable selection are included in this package. Cross-validation is performed to choose the optimal value of the lambda parameter. LASSO is based on the IRLS algorithm. A relevant paper is <doi:10.1109/ICIST.2014.6920341>. |
| Authors: | Michail Tsagris [aut, cre] |
| Maintainer: | Michail Tsagris <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.0 |
| Built: | 2026-09-20 11:59:31 UTC |
| Source: | https://github.com/cran/cauchyreg |
Cauchy regression modelling and LASSO to perform variable selection are included in this package. Cross-validation is performed to choose the optimal value of the lambda parameter. LASSO is based on the IRLS algorithm.
| Package: | cauchyreg |
| Type: | Package |
| Version: | 1.0 |
| Date: | 2026-09-03 |
Michail Tsagris <[email protected]>.
Michail Tsagris [email protected]
Cauchy regression
cauchy.reg(y, x, tol = 1e-07, maxit = 100, xnew = NULL)cauchy.reg(y, x, tol = 1e-07, maxit = 100, xnew = NULL)
y |
A numerical vector with the response values. |
x |
A numerical matrix or a data.frame with predictor variables. |
tol |
The tolerance value to terminate the IRLS algorithm. |
maxit |
The maximum number of iterations to perform the IRLS algorithm. |
xnew |
If you have new values for the predictors put them here. |
Cauchy regression is performed.
A list including:
be |
The regression coefficients. |
sigma |
The scale parameter. |
iters |
The number of iterations the Newton-Raphson required. |
loglik |
The log-likelihood value. |
est |
The estimated values if xnew is not NULL, otherwise this is NULL. |
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
Liu T. and Tao D. (2014, April). On the robustness and generalization of Cauchy regression. In 2014 4th IEEE International Conference on Information Science and Technology (pp. 100-105). IEEE.
y <- iris[, 1] x <- as.matrix(iris[, 2:4]) mod <- cauchy.reg(y, x)y <- iris[, 1] x <- as.matrix(iris[, 2:4]) mod <- cauchy.reg(y, x)
LASSO Cauchy regression
cauchy.reg.lasso(y, x, lambda = NULL, nlambda = 100, tol = 1e-07, maxit = 100, xnew = NULL)cauchy.reg.lasso(y, x, lambda = NULL, nlambda = 100, tol = 1e-07, maxit = 100, xnew = NULL)
y |
A numerical vector with the response values. |
x |
A numerical matrix with predictor variables. |
lambda |
The user may supply their own lambda values. If NULL, the function computes the grid of values. |
nlambda |
If the user does not provide a vector of lambda values they may specify how many shall the function use. |
tol |
The tolerance value to terminate the IRLS algorithm. |
maxit |
The maximum number of iterations to perform the IRLS algorithm. |
xnew |
If you have new values for the predictors put them here. |
LASSO is implemented using a path of lambda values.
A list including:
B |
A matrix with the stimated coefficients for each value of lambda. The rows correspond to the predictors and the columns to the lambda values. |
est |
A matrix with the estimated response values if xnew is not NULL. Each column corresponds to a different value of lambda. |
lambda |
The lambda values used. |
norm |
The sum of the absolute values of the coefficients for each value of lambda. |
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
y <- iris[, 1] x <- as.matrix(iris[, 2:4]) mod <- cauchy.reg.lasso(y, x)y <- iris[, 1] x <- as.matrix(iris[, 2:4]) mod <- cauchy.reg.lasso(y, x)
Many simple Cauchy regressions
cauchy.regs(y, x, tol = 1e-07, maxit = 100)cauchy.regs(y, x, tol = 1e-07, maxit = 100)
y |
A numerical vector with the response values. |
x |
A numerical matrix with predictor variables. |
tol |
The tolerance value to terminate the IRLS algorithm. |
maxit |
The maximum number of iterations to perform the IRLS algorithm. |
The function performs many simply Cauchy regressions, one for each column of x.
A matrix with 4 columns, the constant terms, the slope coefficients, the scale parameters and the log-likelihood values. Each row corresponds to a column in x.
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
Liu T. and Tao D. (2014, April). On the robustness and generalization of Cauchy regression. In 2014 4th IEEE International Conference on Information Science and Technology (pp. 100-105). IEEE.
y <- iris[, 1] x <- as.matrix(iris[, 2:4]) mod <- cauchy.regs(y, x)y <- iris[, 1] x <- as.matrix(iris[, 2:4]) mod <- cauchy.regs(y, x)
Cross-validation for the LASSO Cauchy regression
cv.cauchyreglasso(y, x, lambda = NULL, nlambda = 100, tol = 1e-07, maxit = 100, folds = NULL, nfolds = 10, seed = NULL)cv.cauchyreglasso(y, x, lambda = NULL, nlambda = 100, tol = 1e-07, maxit = 100, folds = NULL, nfolds = 10, seed = NULL)
y |
A numerical vector with the response values. |
x |
A numerical matrix with predictor variables. |
lambda |
The user may supply their own lambda values. If NULL, the function computes the grid of values. |
nlambda |
If the user does not provide a vector of lambda values they may specify how many shall the function use. |
tol |
The tolerance value to terminate the IRLS algorithm. |
maxit |
The maximum number of iterations to perform the IRLS algorithm. |
folds |
If you have the list with the folds supply it here. You can also leave it NULL and the function will create folds. |
nfolds |
If the user did not pass the folds argument, then they need to specify the number of folds to produce. |
seed |
You can specify your own seed number here or leave it NULL. |
The function performs K-fold cross-validation to select the optimal value of lambda.
A matrix with two columns, the lambda values and their corresponding MSE values.
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
y <- iris[, 1] x <- as.matrix(iris[, 2:4])y <- iris[, 1] x <- as.matrix(iris[, 2:4])