📄 mf_luinv.hlp
字号:
{smcl}
{* 21mar2005}{...}
{cmd:help mata luinv()}
{hline}
{* index inverse matrix}{...}
{* index luinv()}{...}
{* index _luinv()}{...}
{* index _luinv_la()}{...}
{* index LAPACK}{...}
{title:Title}
{p 4 4 2}
{bf:[M-5] luinv() -- Square matrix inversion}
{title:Syntax}
{p 8 12 2}
{it:numeric matrix}
{cmd:luinv(}{it:numeric matrix A}{cmd:)}
{p 8 12 2}
{it:numeric matrix}
{cmd:luinv(}{it:numeric matrix A}{cmd:,}
{it:real scalar tol}{cmd:)}
{p 8 12 2}
{it:void}{bind: }
{cmd:_luinv(}{it:numeric matrix A}{cmd:)}
{p 8 12 2}
{it:void}{bind: }
{cmd:_luinv(}{it:numeric matrix A}{cmd:,}
{it:real scalar tol}{cmd:)}
{p 8 12 2}
{it:real scalar}{bind: }
{cmd:_luinv_la(}{it:numeric matrix A}{cmd:,}
{it:real scalar tol}{cmd:)}
{title:Description}
{p 4 4 2}
{cmd:luinv(}{it:A}{cmd:)}
and
{cmd:luinv(}{it:A}{cmd:,} {it:tol}{cmd:)}
return the inverse of real or complex, square matrix {it:A}.
{p 4 4 2}
{cmd:_luinv(}{it:A}{cmd:)}
and
{cmd:_luinv(}{it:A}{cmd:,} {it:tol}{cmd:)}
do the same thing except that, rather than returning the inverse matrix, they
overwrite the original matrix {it:A} with the inverse.
{p 4 4 2}
In all cases, optional argument {it:tol} specifies the tolerance for
determining singularity; see {it:Remarks} below.
{p 4 4 2}
{cmd:_luinv_la(}{it:A}{cmd:,} {it:tol}{cmd:)}
is the interface to the
{bf:{help m1_lapack:[M-1] LAPACK}} routines that do the work.
{title:Remarks}
{p 4 4 2}
These routines calculate the inverse of {it:A}. The inverse matrix
{it:A}^(-1) of {it:A} satisfies the conditions
{it:A}{it:A}^(-1) = {it:I}
{it:A}^(-1){it:A} = {it:I}
{p 4 4 2}
{it:A} is required to be square and of full rank.
See
{bf:{help mf_qrinv:[M-5] qrinv()}}
and
{bf:{help mf_pinv:[M-5] pinv()}} for generalized inverses of nonsquare, or
rank-deficient matrices.
See {bf:{help mf_invsym:[M-5] invsym()}} for inversion of real, symmetric
matrices.
{p 4 4 2}
{cmd:luinv(}{it:A}{cmd:)} is logically equivalent to
{cmd:lusolve(}{it:A}{cmd:, I(rows(}{it:A}{cmd:)))};
see {bf:{help mf_lusolve:[M-5] lusolve()}}
for details and for use of the optional {it:tol} argument.
{title:Conformability}
{cmd:luinv(}{it:A}{cmd:,} {it:tol}{cmd:)}:
{it:A}: {it:n x n}
{it:tol}: 1 {it:x} 1 (optional)
{it:result}: {it:n x n}
{cmd:_luinv(}{it:A}{cmd:,} {it:tol}{cmd:)}:
{it:input:}
{it:A}: {it:n x n}
{it:tol}: 1 {it:x} 1 (optional)
{it:output:}
{it:A}: {it:n x n}
{cmd:_luinv_la(}{it:A}{cmd:,} {it:tol}{cmd:)}:
{it:input:}
{it:A}: {it:n x n}
{it:tol}: 1 {it:x} 1
{it:output:}
{it:A}: {it:n x n}
{it:result}: 1 {it:x} 1
{title:Diagnostics}
{p 4 4 2}
The inverse returned by these functions is {cmd:real} if {it:A} is
{cmd:real}, and is {cmd:complex} if {it:A} is {cmd:complex}.
If you use these functions with a singular matrix,
returned will be a matrix of missing values. The determination
of singularity is made relative to {it:tol}. See
{it:Tolerance} under {it:Remarks} in
{bf:{help mf_lusolve:[M-5] lusolve()}} for details.
{p 4 4 2}
{cmd:luinv(}{it:A}{cmd:)} and {cmd:_luinv(}{it:A}{cmd:)}
return a matrix containing missing
if {it:A} contains missing values.
{p 4 4 2}
{cmd:_luinv(}{it:A}{cmd:)} aborts with error if {it:A} is a view.
{p 4 4 2}
{cmd:_luinv_la(}{it:A}{cmd:,} {it:tol}{cmd:)}
should not be used directly; use {cmd:_luinv()}.
{p 4 4 2}
See
{bf:{help mf_lusolve:[M-5] lusolve()}}
and
{bf:{help m1_tolerance:[M-1] tolerance}}
for information on the optional {it:tol} argument.
{title:Source code}
{p 4 4 2}
{view luinv.mata, adopath asis:luinv.mata},
{view _luinv.mata, adopath asis:_luinv.mata};
{cmd:_luinv_la()} is built-in.
{title:Also see}
{p 4 13 2}
Manual: {hi:[M-5] luinv()}
{p 4 13 2}
Online: help for
{bf:{help mf_invsym:[M-5] invsym()}},
{bf:{help mf_cholinv:[M-5] cholinv()}},
{bf:{help mf_qrinv:[M-5] qrinv()}},
{bf:{help mf_pinv:[M-5] pinv()}},
{bf:{help mf_lusolve:[M-5] lusolve()}},
{bf:{help mf_lud:[M-5] lud()}};
{bf:{help m4_matrix:[M-4] matrix}}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -