Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cgls

Conjugate gradient Least squares


Description

Conjugate gradient Least squares

Usage

cgls(Gmat, dee, niter)

Arguments

Gmat

input matrix

dee

right hand side

niter

max number of iterations

Details

Performs niter iterations of the CGLS algorithm on the least squares problem min norm(G*m-d). Gmat should be a sparse matrix.

Value

X

matrix of models

rho

misfit norms

eta

model norms

Author(s)

Jonathan M. Lees<jonathan.lees@unc.edu>

References

Aster, R.C., C.H. Thurber, and B. Borchers, Parameter Estimation and Inverse Problems, Elsevier Academic Press, Amsterdam, 2005.

Examples

set.seed(11)
####  perfect data with no noise
n <- 5
A <- matrix(runif(n*n),nrow=n)
B <- runif(n)
###  get right-hand-side (data)
trhs = as.vector( A %*% B  )
Lout = cgls(A, trhs , 15)

###  solution is
Lout$X[,15]

Lout$X[,15] - B

PEIP

Geophysical Inverse Theory and Optimization

v2.2-3
GPL (>= 2)
Authors
Jonathan M. Lees [aut, cre]
Initial release
2020-08-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.