dimcorr - Computes statistics and correlation for two variables.

SYNOPSIS

dimcorr  [ parameter=value ... ]  [ inputfile outputfile ]

Parameters are:   var1var2,   dimssame_unitskeep_Nsbig_mem.

DESCRIPTION

dimcorr computes the correlation between two variables, along with their means and standard deviations, with respect to the specified dimensions. In addition, if the variables have the same units, the rms difference and the bias are also calculated. Optionally, the number of elements used in the computations of the statistics and the correlation can also be written to the output dataset. Note that elements used in the computations only involve those for which the correponding elements exist in both datasets.

The mean and standard deviation output variables have the same data type as the input variable they were computed from (see datasets). For variables "x" and "y", these output variables are named, "x_MEAN", "y_MEAN", "x_STDEV" and "y_STDEV". If the two input variables have the same name, then the mean variables would be named "x1_MEAN" and "x2_MEAN", likewise with the standard deviations. The correlation variable has data type GP_FLOAT (see include/gp.h) and is named "x_y_COR". The (optional) number-of-element variable has data type GP_SHORT and is named "x_y_N". The rms and bias variables have the same data type as the variable with the larger data type and are named "x_y_RMS" and "x_y_BIAS".

The computed rms difference does not include the bias.

PARAMETERS

var1

Specifies the name of first variable.

There is no default.

var2

Specifies the name of second variable.

There is no default.

dims

Specifies the dimensions in the input datasets about which to compute the statistics. For example, if the variables have three dimensions, x, y and t, specifying t will result in output variables with dimensions x and y, and statistics (e.g., means) being computed for each group of elements along the t dimension at each separate x and y location. On the other hand specifying x and y, will result in output variables with dimension t, and statistics being computed for each group of elements for all x and y at each separate t location. These dimensions must exist and be the same size for both variables.

There is no default.

same_units

If same_units=yes, then the rms difference and bias about the dimension dim are caculated. The bias is not included in the computation of the rms difference.

Valid responses are [yes or no]. The default is no.

keep_Ns

If keep_Ns=yes, dimcorr stores the number of elements used in the computations. This counts only elements that have non-missing values at the same location for each variable.

Valid responses are [ yes, no ]. The default is no.

big_mem

OPTIONAL. If big_mem=yes, dimcorr reads all data into memory and then accesses the data along the given dimensions dims from memory rather than from disk. In some cases, when dims includes some of a variable's higher order dimensions (e.g., day for a variable with dimensions day, line and sample), this can greatly speed up the computation as long as sufficient memory exists.

Valid responses are [ yes, no ]. The default is no. This parameter can only be set by an explicit specification on the command line.

EXAMPLES

This example shows how to calculate the correlation, means and standard deviations for two albedo variables, youralbedo and myalbedo. Each variable is three dimensional with dimensions, latitude, longitude and time. The statistics are computed about the time dimension and therefore the output variables will be functions of latitude and longitude.

% dimcorr
in/out files   : char(255) ? test.tdf compare.tdf
var1           : char(255) ? myalbedo
var2           : char(255) ? youralbedo
dims           : char( 31) ? [] time
same_units     : char(  3) ? [yes]
keep_Ns        : char(  3) ? [no] y

SEE ALSO

datasets, spectral, sample, composite, emath, nhood, polyfit, linfit, anomaly, dimcorr, samplam, laminate, varname.


Last Update: $Date: 1998/05/28 18:07:57 $