Learn R Programming

optR (version 1.2.5)

gaussSeidel: Gauss-Seidel based Optimization & estimation

Description

Function utilizes the Gauss-Seidel optimization to solve equation Ax=b

Usage

gaussSeidel(A, b, x = NULL, iter = 500, tol = 1e-07, w = 1, witr = NULL)

Arguments

A
: Input matrix
b
: Response
x
: Initial solutions
iter
: Number of Iterations
tol
: Convergence tolerance
w
: Relaxation paramter used to compute weighted avg. of previous solution. w=1 represent no relaxation
witr
: Iteration after which relaxation parameter become active

Value

optimal : Optimal solutionsinitial : initial solutionrelaxationFactor : relaxation factor

Examples

Run this code
A<-matrix(c(4,-1,1, -1,4,-2,1,-2,4), nrow=3,ncol=3, byrow = TRUE)
b<-matrix(c(12,-1, 5), nrow=3,ncol=1,byrow=TRUE)
Z<-optR(A, b, method="gaussseidel", iter=500, tol=1e-7)

Run the code above in your browser using DataLab