cgm: Optimization & estimation based on Conjugate Gradient Method

Description Usage Arguments Value Examples

View source: R/cgm.R

Description

Function utilizes the Conjugate Gradient Method for optimization to solve equation Ax=b

Usage

1
cgm(A, b, x = NULL, iter = 500, tol = 1e-07)

Arguments

A

: Input matrix

b

: Response vector

x

: Initial solutions

iter

: Number of Iterations

tol

: Convergence tolerance

Value

optimal : Optimal solutions

initial : initial solution

itr.conv : Number of iterations for convergence

conv : Convergence array

Examples

1
2
3
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="cgm", iter=500, tol=1e-7)

Example output

Loaded optR Version:            1.2.5

optR documentation built on May 29, 2017, 2:10 p.m.