⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mf_eigensystem.hlp

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 HLP
📖 第 1 页 / 共 2 页
字号:
Concerning item 3, let us begin with the right-eigensystem problem:

			{it:A}{it:X} = {it:X}*diag({it:L})

{p 4 4 2}
Taking the transpose of both sides results in

			{it:X}{bf:'}{it:A} = diag({it:L})*{it:X}{bf:'}

{p 4 4 2}
because {it:A}={it:A}{bf:'} if {it:A} is symmetric (Hermitian).  

{p 4 4 2}
{cmd:symeigensystem(}{it:A}{cmd:,} {it:X}{cmd:,} {it:L}{cmd:)}
calculates right eigenvectors.  To obtain the left eigenvectors, 
you simply transpose {it:X}.


{title:Normalization and order}

{p 4 4 2}
If {it:x} is a solution to

			{it:A}{it:x} = {it:l}{it:x}

{p 4 4 2} 
then so is {it:c}{it:x}, {it:c}: 1 {it:x} 1, {it:c}!=0.  

{p 4 4 2}
The eigenvectors returned by the above routines are scaled to have length
(norm) 1.

{p 4 4 2}
The eigenvalues are combined and returned in a vector ({it:L}) and the
eigenvectors in a matrix ({it:X}).  The eigenvalues are ordered from largest
to smallest in absolute value (or, if the eigenvalues are complex, in length).
The eigenvectors are ordered to correspond to the eigenvalues.


{title:Eigenvalue condition}

{p 4 4 2}
Optional argument {it:rcond} may be specified as a value other than 0 or 
missing -- {it:rcond}=1 is suggested -- and then {it:rcond} will be filled
in with a vector containing the reciprocals of the condition numbers
for the eigenvalues.  Each element of {it:rcond} measures the accuracy 
with which the corresponding eigenvalue has been calculated; large numbers 
(numbers close to 1) are better and small numbers (numbers close to 0)
indicate inaccuracy.

{p 4 4 2}
The reciprocal condition number is calculated as abs({it:y}*{it:x}), where
{it:y}: 1 {it:x} {it:n} is the left eigenvector and {it:x}: {it:n} {it:x} 1 is
the corresponding right eigenvector.  Since {it:y} and {it:x} each have norm
1, abs({it:y}*{it:x})=abs(cos({it:theta})), where {it:theta} is the
angle made by the vectors.  Thus 0<=abs({it:y}*{it:x})<=1.  For symmetric
matrices, {it:y}*{it:x} will equal 1.  It can be proved that
abs({it:y}*{it:x}) is the reciprocal of the condition number for a simple
eigenvalue, and so it turns out that the sensitivity of the eigenvalue to a
perturbation is a function of how far the matrix is from symmetric on this
scale.

{p 4 4 2}
Requesting {it:rcond} be calculated increases the amount of computation 
considerably.


{title:Balancing}

{p 4 4 2}
By default, balancing is performed for general matrices.  Optional argument 
{it:nobalance} allows you to suppress balancing.

{p 4 4 2}
Balancing is related to row-and-column equilibration; see 
{bf:{help mf__equilrc:[M-5] _equilrc()}}.  In this case, however, a diagonal
matrix {it:D} is found such that {it:DAD}^(-1) is better balanced, the
eigenvalues and eigenvectors for {it:DAD}^(-1) are extracted, and then the
eigenvalues and eigenvectors are adjusted by {it:D} to so that they reflect those
for the original {it:A} matrix.

{p 4 4 2}
There is no gain from these machinations when {it:A} is symmetric, so 
the symmetric routines do not have a {it:nobalance} argument.


{title:eigensystem() and eigenvalues()}

{p 4 8 2}
1.  Use {it:L} = {cmd:eigenvalues(}{it:A}{cmd:)} and 
    {cmd:eigensystem(}{it:A}{cmd:,} {it:X}{cmd:,} {it:L}{cmd:)}
    for general matrices {it:A}.

{p 4 8 2}
2.  Use {it:L} = {cmd:eigenvalues(}{it:A}{cmd:)} 
    when you do not need the eigenvectors; it will save both time and 
    memory.

{p 4 8 2}
3.  The eigenvalues returned by 
    {it:L} = {cmd:eigenvalues(}{it:A}{cmd:)} and by 
    {cmd:eigensystem(}{it:A}{cmd:,} {it:X}{cmd:,} {it:L}{cmd:)}
    are of storage type complex even if the eigenvalues are real 
    (i.e., even if {cmd:Im(}{it:L}{cmd:)}==0).  If the eigenvalues are 
    known to be real, you can save computer memory by subsequently coding

		{cmd:L = Re(L)}

{p 8 8 2}
    If you wish to test whether the eigenvalues are real, examine 
    {cmd:mreldifre(}{it:L}{cmd:)}; 
    see {bf:{help mf_reldif:[M-5] reldif()}}.

{p 4 8 2}
4.  The eigenvectors returned by 
    {cmd:eigensystem(}{it:A}{cmd:,} {it:X}{cmd:,} {it:L}{cmd:)}
    are of storage type complex even if the eigenvectors are real
    (i.e., even if {cmd:Im(}{it:X}{cmd:)}==0).  If the eigenvectors are 
    known to be real, you can save computer memory by subsequently coding

		{cmd:X = Re(X)}

{p 8 8 2}
    If you wish to test whether the eigenvectors are real, examine 
    {cmd:mreldifre(}{it:X}{cmd:)};
    see {bf:{help mf_reldif:[M-5] reldif()}}.

{p 4 8 2}
5.  If you are using 
    {cmd:eigensystem(}{it:A}{cmd:,} {it:X}{cmd:,} {it:L}{cmd:)}
    interactively (outside of a program), do not forget that {it:X} and {it:L}
    must be predefined.  Type

		: {cmd:eigensystem(A, X=., L=.)}


{title:lefteigensystem()}

{p 4 4 2}
What was just said about {cmd:eigensystem()} applies equally well to 
{cmd:lefteigensystem()}.  

{p 4 4 2}
If you only need the eigenvalues, use 
{it:L} = {cmd:eigenvalues(}{it:A}{cmd:)}.  The eigenvalues are the same 
for both left and right systems.


{title:symeigensystem() and symeigenvalues()}

{p 4 8 2}
1.  Use {it:L} = {cmd:symeigenvalues(}{it:A}{cmd:)} and 
    {cmd:symeigensystem(}{it:A}{cmd:,} {it:X}{cmd:,} {it:L}{cmd:)}
    for symmetric or Hermitian matrices {it:A}.

{p 4 8 2}
2.  Use {it:L} = {cmd:symeigenvalues(}{it:A}{cmd:)} 
    when you do not need the eigenvectors; it will save both time and 
    memory.

{p 4 8 2}
3.  The eigenvalues returned by 
    {it:L} = {cmd:symeigenvalues(}{it:A}{cmd:)} and by 
    {cmd:symeigensystem(}{it:A}{cmd:,} {it:X}{cmd:,} {it:L}{cmd:)}
    are of storage type real.  Eigenvalues of symmetric and Hermitian 
    matrices are always real.

{p 4 8 2}
4.  The eigenvectors returned by 
    {cmd:symeigensystem(}{it:A}{cmd:,} {it:X}{cmd:,} {it:L}{cmd:)}
    are of storage type real when {it:A} is of storage type real and of
    storage type complex when {it:A} is of storage type complex.

{p 4 8 2}
5.  If you are using 
    {cmd:symeigensystem(}{it:A}{cmd:,} {it:X}{cmd:,} {it:L}{cmd:)}
    interactively (outside of a program), do not forget that {it:X} and {it:L}
    must be predefined.  Type

		: {cmd:symeigensystem(A, X=., L=.)}


{title:Conformability}

{p 4 4 2}
{cmd:eigensystem(}{it:A}{cmd:,} 
{it:X}{cmd:,} 
{it:L}{cmd:,} 
{it:rcond}{cmd:,} 
{it:nobalance}{cmd:)}:
{p_end}
	{it:input:}
		{it:A}:  {it:n x n}
	    {it:rcond}:  1 {it:x} 1  (optional, specify as 1 to obtain {it:rcond})
	{it:nobalance}:  1 {it:x} 1  (optional, specify as 1 to prevent balancing)
	{it:output:}
		{it:X}:  {it:n x n}  (columns contain eigenvectors)
		{it:L}:  1 {it:x n}
	    {it:rcond}:  1 {it:x n}  (optional)
	   {it:result}:  {it:void}

{p 4 4 2}
{cmd:lefteigensystem(}{it:A}{cmd:,} {it:X}{cmd:,} {it:L}{cmd:,} 
{it:rcond}{cmd:,} 
{it:nobalance}{cmd:)}:
{p_end}
	{it:input:}
		{it:A}:  {it:n x n}
	    {it:rcond}:  1 {it:x} 1  (optional, specify as 1 to obtain {it:rcond})
	{it:nobalance}:  1 {it:x} 1  (optional, specify as 1 to prevent balancing)
	{it:output:}
		{it:X}:  {it:n x n}  (rows contain eigenvectors)
		{it:L}:  {it:n x} 1
	    {it:rcond}:  {it:n x} 1  (optional)
	   {it:result}:  {it:void}

{p 4 4 2}
{cmd:eigenvalues(}{it:A}{cmd:,} 
{it:rcond}{cmd:,} 
{it:nobalance}{cmd:)}:
{p_end}
	{it:input:}
		{it:A}:  {it:n x n}
	    {it:rcond}:  1 {it:x} 1  (optional, specify as 1 to obtain {it:rcond})
	{it:nobalance}:  1 {it:x} 1  (optional, specify as 1 to prevent balancing)
	{it:output:}
	    {it:rcond}:  1 {it:x n}  (optional)
	   {it:result}:  1 {it:x n}  (contains eigenvalues)


    {cmd:symeigensystem(}{it:A}{cmd:,} {it:X}{cmd:,} {it:L}{cmd:)}:
	{it:input:}
		{it:A}:  {it:n x n}
	{it:output:}
		{it:X}:  {it:n x n}  (columns contain eigenvectors)
		{it:L}:  1 {it:x n}
	   {it:result}:  {it:void}

    {cmd:symeigenvalues(}{it:A}{cmd:)}:
	{it:input:}
		{it:A}:  {it:n x n}
	{it:output:}
	   {it:result}:  1 {it:x n}  (contains eigenvalues)

{p 4 4 2}
{cmd:_eigensystem(}{it:A}{cmd:,} 
{it:X}{cmd:,} 
{it:L}{cmd:,} 
{it:rcond}{cmd:,} 
{it:nobalance}{cmd:)}:
{p_end}
	{it:input:}
		{it:A}:  {it:n x n}
	    {it:rcond}:  1 {it:x} 1  (optional, specify as 1 to obtain {it:rcond})
	{it:nobalance}:  1 {it:x} 1  (optional, specify as 1 to prevent balancing)
	{it:output:}
		{it:A}:  0 {it:x} 0
		{it:X}:  {it:n x n}  (columns contain eigenvectors)
		{it:L}:  1 {it:x n}
	    {it:rcond}:  1 {it:x n}  (optional)
	   {it:result}:  {it:void}

{p 4 4 2}
{cmd:_lefteigensystem(}{it:A}{cmd:,} {it:X}{cmd:,} 
{it:L}{cmd:,} {it:rcond}{cmd:,} {it:nobalance}{cmd:)}:
{p_end}
	{it:input:}
		{it:A}:  {it:n x n}
	    {it:rcond}:  1 {it:x} 1  (optional, specify as 1 to obtain {it:rcond})
	{it:nobalance}:  1 {it:x} 1  (optional, specify as 1 to prevent balancing)
	{it:output:}
		{it:A}:  0 {it:x} 0 
		{it:X}:  {it:n x n}  (rows contain eigenvectors)
		{it:L}:  {it:n x} 1
	    {it:rcond}:  {it:n x} 1  (optional)
	   {it:result}:  {it:void}

{p 4 4 2}
{cmd:_eigenvalues(}{it:A}{cmd:,} 
{it:rcond}{cmd:,} {it:nobalance}{cmd:)}:
{p_end}
	{it:input:}
		{it:A}:  {it:n x n}
	    {it:rcond}:  1 {it:x} 1  (optional, specify as 1 to obtain {it:rcond})
	{it:nobalance}:  1 {it:x} 1  (optional, specify as 1 to prevent balancing)
	{it:output:}
		{it:A}:  0 {it:x} 0
	    {it:rcond}:  1 {it:x n}  (optional)
	   {it:result}:  1 {it:x n}  (contains eigenvalues)

{p 4 4 2}
{cmd:_symeigensystem(}{it:A}{cmd:,} {it:X}{cmd:,} {it:L}{cmd:)}:
{p_end}
	{it:input:}
		{it:A}:  {it:n x n}
	{it:output:}
		{it:A}:  0 {it:x} 0
		{it:X}:  {it:n x n}  (columns contain eigenvectors)
		{it:L}:  1 {it:x n}
	   {it:result}:  {it:void}

    {cmd:_symeigenvalues(}{it:A}{cmd:)}:
	{it:input:}
		{it:A}:  {it:n x n}
	{it:output:}
		{it:A}:  0 {it:x} 0 
	   {it:result}:  1 {it:x n}  (contains eigenvalues)

{p 4 4 2}
{cmd:_eigen_la(}{it:todo}{cmd:,}
{it:A}{cmd:,}
{it:X}{cmd:,}
{it:L}{cmd:,}
{it:rcond}{cmd:,}
{it:nobalance}{cmd:)}:
{p_end}
	{it:input:}
	     {it:todo}:  1 {it:x} 1
		{it:A}:  {it:n x n}
	     {it:rcnd}:  1 {it:x} 1
	{it:nobalance}:  1 {it:x} 1
	{it:output:}
		{it:A}:  0 {it:x} 0 
		{it:X}:  {it:n x n}
		{it:L}:  1 {it:x n}  or  {it:n x} 1
	    {it:rcond}:  1 {it:x n}  or  {it:n x} 1  (optional)
	   {it:result}:  1 {it:x} 1  (return code)

{p 4 4 2}
{it:real scalar}
{cmd:_symeigen_la(}{it:todo}{cmd:,}
{it:A}{cmd:,}
{it:X}{cmd:,}
{it:L}{cmd:)}:
{p_end}
	{it:input:}
	     {it:todo}:  1 {it:x} 1
		{it:A}:  {it:n x n}
	{it:output:}
		{it:A}:  0 {it:x} 0 
		{it:X}:  {it:n x n}
		{it:L}:  1 {it:x n}
	   {it:result}:  1 {it:x} 1  (return code)


{title:Diagnostics}

{p 4 4 2}
All functions return missing-value results if {it:A} has missing values.

{p 4 4 2}
{cmd:symeigensystem()},
{cmd:symeigenvalues()},
{cmd:_symeigensystem()}, and
{cmd:_symeigenvalues()},
use the lower triangle of {it:A} without checking for symmetry.  
When {it:A} is complex, only the real part of the diagonal is used.


{title:Source code}

{p 4 4 2}
{view eigensystem.mata, adopath asis:eigensystem.mata},
{view lefteigensystem.mata, adopath asis:lefteigensystem.mata},
{view eigenvalues.mata, adopath asis:eigenvalues.mata},
{view symeigensystem.mata, adopath asis:symeigensystem.mata},
{view symeigenvalues.mata, adopath asis:symeigenvalues.mata},
{view _eigensystem.mata, adopath asis:_eigensystem.mata},
{view _lefteigensystem.mata, adopath asis:_lefteigensystem.mata},
{view _eigenvalues.mata, adopath asis:_eigenvalues.mata},
{view _symeigensystem.mata, adopath asis:_symeigensystem.mata},
{view _symeigenvalues.mata, adopath asis:_symeigenvalues.mata},
{view _eigen_work.mata, adopath asis:_eigen_work.mata},
{view _symeigen_work.mata, adopath asis:_symeigen_work.mata}

{p 4 4 2}
{cmd:_eigen_la()} 
and 
{cmd:_symeigen_la()} 
are built-in.


{title:Also see}

{p 4 13 2}
Manual:  {hi:[M-5] eigensystem()}

{p 4 13 2}
Online:  help for 
{bf:{help mf_matexpsym:[M-5] matexpsym()}},
{bf:{help mf_matpowersym:[M-5] matpowersym()}};
{bf:{help m4_matrix:[M-4] matrix}}
{p_end}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -