gdls: Least squares with graident descent

Description Usage Arguments Details Value See Also Examples

View source: R/gdls.R

Description

Solve least squares with graident descent

Usage

1
gdls(A, b, alpha = 0.05, tol = 1e-06, m = 1e+05)

Arguments

A

a square matrix representing the coefficients of a linear system

b

a vector representing the right-hand side of the linear system

alpha

the learning rate

tol

the expected error tolerance

m

the maximum number of iterations

Details

gdls solves a linear system using gradient descent.

Value

the modified matrix

See Also

Other linear: choleskymatrix(), detmatrix(), invmatrix(), iterativematrix, lumatrix(), refmatrix(), rowops, tridiagmatrix(), vecnorm()

Examples

1
2
3
head(b <- iris$Sepal.Length)
head(A <- matrix(cbind(1, iris$Sepal.Width, iris$Petal.Length, iris$Petal.Width), ncol = 4))
gdls(A, b, alpha = 0.05, m = 10000)

cmna documentation built on July 14, 2021, 5:11 p.m.