Description Usage Arguments Details Value Note Author(s) References See Also Examples

This generic function solves the equation `a %*% x = b`

for `x`

, where `b`

can be either a vector or a matrix. This implementation is similar to `solve`

, but uses a pseudo-inverse if the system is computationally singular.

1 | ```
psolve(a, b, tol)
``` |

`a` |
a rectangular numeric matrix containing the coefficients of the linear system. |

`b` |
a numeric vector or matrix giving the right-hand side(s) of the linear system. If missing, |

`tol` |
the tolerance for detecting linear dependencies in the columns of a. The default is |

If `a`

is a symmetric matrix, `eigen`

is used to compute the (pseudo-)inverse. This assumes that `a`

is a positive semi-definite matrix. Otherwise `svd`

is used to compute the (pseudo-)inverse for rectangular matrices.

If `b`

is missing, returns the (pseudo-)inverse of `a`

. Otherwise returns `psolve(a) %*% b`

.

The pseudo-inverse is calculated by inverting the eigen/singular values that are greater than the first value multiplied by `tol * min(dim(a))`

.

Nathaniel E. Helwig <helwig@umn.edu>

Moore, E. H. (1920). On the reciprocal of the general algebraic matrix. *Bulletin of the American Mathematical Society, 26*, 394-395. doi: 10.1090/S0002-9904-1920-03322-7

Penrose, R. (1955). A generalized inverse for matrices. *Mathematical Proceedings of the Cambridge Philosophical Society, 51(3)*, 406-413. doi: 10.1017/S0305004100030401

1 2 3 4 5 6 7 8 9 10 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.