solve_ols: Solve linear system

Description Usage Arguments Value Author(s)

View source: R/solve_ols.R

Description

solve.ols is a function that solves linear system using either Gauss-Seidel or Jacobi. It assumes that the spectral norm of A is less than 1 to solve.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
solve_ols(
  A,
  b,
  x0 = NA,
  maxiter = 10000,
  tol = 1e-05,
  numCores = 1,
  parallel = FALSE,
  method = "Gauss",
  full_result = FALSE
)

Arguments

A

Linear System to be solved

b

Constant Vector

x0

Initial solution guess

maxiter

Maximum Number of Iteration

tol

Tolerance of the difference between two result from iteration

numCores

Only applicable when parallel == TRUE, this

parallel

Whether to use the paralleled version, Only available when using "Jacobi". Default is FALSE.

method

Method to use, default is "Gauss-Seidel", and can be "Jacobi"

full_result

Whether to return a result of each iteration

Value

The function would return the solution to the linear system or the full record of each iteration. This depends on the option of full_result.

Author(s)

Xiaohan Wang


xw547/hwpkg documentation built on Dec. 23, 2021, 7:14 p.m.