NCL Home > Documentation > Functions > Singular value decomposition

evssm_lapack

Calculates the eigenvalues and eigenvectors of a real matrix stored in symmetric storage mode. Function not yet available.

Available in version 5.2.0 or later.

Prototype

	function evssm_lapack (
		mssm  [*] : numeric,  
		neval [1] : integer,  
		opt   [1] : integer   
	)

	return_val [*] :  float or double

Arguments

mssm

Real matrix containing the covariance or correlation matrix in symmetric storage mode. If the original data matrix had (say) N grid points or stations, then the length of this matrix is N*(N+1)/2

neval

The number of eigenvalues and vectors to return

opt

option. Currently, not used. Set to zero.

Return value

The return array of size (neval,N) will contain the eigenvectors, Associated with the return array will be the attributes

  • eval: a one-dimensional array of size neval that contains the eigenvalues.

Description

Function not yet available.

This function invokes the LAPACK routine "DSPEVX" to calculate the eigenvalues and vectors.

Missing values are not allowed, and the routine will exit if any are encountered.

Examples

Example 1

Consider the covariance matrix (covm_ssm) created in Example 1 ( covcorm ) In this case, the number of variables ("nvar") was 7. Hence, the length of the input matrix is 28 [= 7*(7+1)/2 ].

            neval = 7         ; all possible eigenvalues (neval=nvar)
            evec  = evssm_lapack( covm_ssm, neval, 0)
The values for evec(neval,nvar) are:
                                [eigenvectors]
          1       2       3       4       5       6       7
     -0.1642  0.4220  0.6449 -0.0901 -0.2251  0.4150  0.3848
     -0.1421  0.4474 -0.7130 -0.0497 -0.3949  0.0664  0.3293
      0.1729  0.2568 -0.1301  0.6292  0.6072  0.2799  0.2108
     -0.1699  0.6495  0.1463  0.2121 -0.0329 -0.4028 -0.5653
     -0.5464 -0.1348  0.1053  0.1645  0.1612 -0.5961  0.5137
     -0.7683 -0.1332 -0.1487 -0.0621  0.2069  0.4648 -0.3273
     -0.0728 -0.3130  0.0652  0.7195 -0.5957  0.1069 -0.0924
The values for evec@eval are:
      34.4911    
      18.9988
       2.53878
       0.805937
       0.340749
       0.033403
       0.00252845
If (say) neval=3, then only the first three columns of the eigenvectors and three largest eigenvalues would be returned.