User's Guide

COVAR

Compute the mean vector and covariance matrix of a multiband image

Function:

Computes the mean vector and covariance matrix of a multi-band image. The statistics can be used in the principal components program KARLOV which gives uncorrelated principal components of the specified multi-band image. The statistics are stored under "MEAN_VECTOR" and "COVARIANCE_MATRIX" at the top level in the statistics file.

Parameters:

IN
Input image. Must be a multi-band image.

OUTSTAT
Output statistics file. Name of the statistics file to contain the mean vector and covariance matrix. Can be an existing file or a new file.

Example:

  1. LAS> covar in=balto outstat=balto;stat

    The mean vector and covariance matrix of the multi-band image BALTO are calculated and stored in the statistics file BALTO;STAT.

Description/Algorithm:

COVAR computes the mean vector, "m," and the covariance matrix, "V," of a multi-band image. These statistics are written to the level 0 (zero) node of the statistics file OUTSTAT. The bands of the image are variables and the pixels are observation vectors. If there are p bands (variables) and n pixels in the multi-band image, then the mean vector is given by:

Nonfatal Error Messages:

    None.

Fatal Error Messages:

  1. [covar-nbands] Input image must contain more than one band

    COVAR calculates multi-variate statistics and, therefore, needs multi-variate data (i.e., a multi-band image) as input.

  2. [covar-stopen] Unable to open statistics file

    Check if file being updated is a statistics file.

User Note:

  1. The results for the covariance matrix generated by COVAR may vary from the results generated by the program STATS in the sixth significant digit for some elements, especially if the input image is large (i.e., full TM scene).