Go to the source code of this file.
|
function | inv (in cholow) |
| Generate and return the inverse of a positive-definite matrix whose Lower-triangular Cholesky factorization is given as input.
More...
|
|
◆ inv()
function inv |
( |
in |
cholow | ) |
|
Generate and return the inverse of a positive-definite matrix whose Lower-triangular Cholesky factorization is given as input.
- Parameters
-
[in] | cholow | : The input square matrix representing the lower-triangular Cholesky factorization whose inverse must be computed.
|
- Returns
invmat
: The output square positive-definite matrix, representing the inverse of the matrix whose lower-triangular Cholesky factorization is given as input.
Possible calling interfaces ⛓
invmat = pm.matrix.inv(cholow);
- See also
- See Matrix Inversion Using Cholesky Decomposition, Aravindh Krishnamoorthy, Deepak Menon, (arXiv:1111.4144).
Example usage ⛓
1cd(fileparts(mfilename(
'fullpath'))); % Change working directory to source code directory.
2addpath(
'../../../'); % Add the ParaMonte library
root directory to the search path.
5pm.matlab.show(
'covmat = pm.stats.dist.cov.getRand(3)')
6 covmat = pm.stats.dist.cov.getRand(3)
7pm.matlab.show(
'cholow = chol(covmat, "lower")')
8 cholow = chol(covmat,
"lower")
9pm.matlab.
show('invmat = pm.matrix.
inv(cholow)')
10 invmat = pm.matrix.
inv(cholow)
11pm.matlab.
show('invmat -
inv(covmat)')
13assert(all(all(
abs(invmat -
inv(covmat)) < 1.e-12)));
function abs(in path, in style)
Return the Get absolute canonical path of a file or folder.
function inv(in cholow)
Generate and return the inverse of a positive-definite matrix whose Lower-triangular Cholesky factori...
function root()
Return a scalar MATLAB string containing the root directory of the ParaMonte library package.
function show(in obj, in name, in hidden)
Display the components of an input MATLAB variable on MATLAB Console recursively.
Example output ⛓
2covmat = pm.stats.dist.cov.getRand(3)
4 1.000000000000000 0.639727310732842 0.806646266412048
5 0.639727310732842 1.000000000000000 0.662419765081143
6 0.806646266412048 0.662419765081143 1.000000000000000
7cholow = chol(covmat,
"lower")
10 0.639727310732842 0.768601956738678 0
11 0.806646266412048 0.190457644653703 0.559506645605276
12invmat = pm.matrix.
inv(cholow)
14 3.034619433453406 -0.569877251219465 -2.070366481098747
15 -0.569877251219465 1.888914151677041 -0.791564711603009
16 -2.070366481098747 -0.791564711603009 3.194401502389541
21 0 -0.222044604925031 0.111022302462516
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
-
If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
-
If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
- Copyright
- Computational Data Science Lab
This function builds upon the work of Aravindh Krishnamoorthy (2024). Matrix Inversion using Cholesky Decomposition, MATLAB Central File Exchange.
- Author:
- Joshua Alexander Osborne, May 21 2024, 12:06 AM, University of Texas at Arlington
Fatemeh Bagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.
Amir Shahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin