This function implements linear regression using the coordinate descent algorithm. This minimises the sum of squares with respect to each parameter at a time holding others fixed.

linreg.coord(Y, X)

Arguments

Y

vector of outcome variable

X

matrix of covariates

Value

coefs vector of coefficients

Examples

linreg.coord(women$height,women$weight)
#> $coefs #> [1] 25.7310814 0.2871941 #>