#

## Manuals

### diffix

#### Description

fix an incomplete difference matrix by guessing from differences between locations close to the ones whose values are missing

#### Synopsis

diffix -L [-o filename] difference-table-file location-file

diffix -a float [-o filename] difference-table-file location-file

#### Options

-L
  Coordinates are in longitude/latitude
-a float
  Coordinates are in x/y, with the given aspect ratio, (>= 1)
-o filename
  Output file

#### Purpose

Suppose you got a difference matrix, created by the program leven, that has a few missing values (`NA`'s). Not all programs can handle a difference matrix with missing values, for example: mds, cluster. This program, diffix, makes reasonable guesses to fix an incomplete difference matrix.

Suppose there is no difference value available for locations A and B. This value is substituted by the average of the following 8 values:

- The differences between A and the 4 locations closest to B for which a difference with A is available.
- The differences between B and the 4 locations closest to A for which a difference with B is available.

#### Type of coordinates

To determine what locations are closest to the ones involved in missing differences, it must me determined how the coordinates must be interpreted.

Use option -L if the coordinates are given in longitude and latitude.

Use option -a if the coordinates are given in some user-defined rectangular grid, and specify the aspect ration between X- and Y-coordinates. This must be a value of 1.0 or greater, meaning a distance of 1X can represent a smaller geographical distance than a distance of 1Y.

#### Output file

The output file is a new difference matrix.