Poissonscale and Manhattandist: Difference between pages

From Eigenvector Research Documentation Wiki
(Difference between pages)
Jump to navigation Jump to search
imported>Jeremy
(Created page with "===Purpose=== Perform Poisson scaling with scaling offset. ===Synopsis=== :[xs,sc] = poissonscale(x,''options''); %calibrate scaling :xs = poissonscale(x,sc); ...")
 
imported>Benjamin
No edit summary
 
Line 1: Line 1:
===Purpose===
===Purpose===
 
Calculates Manhattan Distance between Samples (rows) of a Dataset Object (DSO) or a matrix.
Perform Poisson scaling with scaling offset.


===Synopsis===
===Synopsis===


:[xs,sc] = poissonscale(x,''options'');    %calibrate scaling
:distances = manhattandist(x)
:xs = poissonscale(x,sc);              %apply previous scaling
:distances = manhattandist(x,basis)
:distances = manhattandist(x,options)
:distances = manhattandist(x,basis,options)


===Description===
===Description===


Scales each variable by its square root mean value. When no scale values
Calculates the Manhattan Distance, sum of the absolute value differences, from each row to every other row in the supplied matrix or, optionally, all rows of (x) to all rows in a second matrix (basis).
are passed, a calibration is performed in which the square root mean
values are calculated for each variable and then these are applied to the
input data. If previously calculated scales are passed, these are simply
applied to the data. An optional options structure allows setting of the
offset which is added to each mean to avoid over-scaling when a variable
has a near-zero mean.
 


====Inputs====
====Inputs====


* '''x''' = Data to be scaled (double or DataSet object).
* '''x''' = A DSO or a matrix.


====Optional Inputs====
====Optional Inputs====


* '''sc''' = Vector of previously-calculated scales. Must be equal in length to the number of included x-block variables.
* '''basis''' = A second DSO/matrix to compare the first DSO/matrix against when calculating Manhattan distance.
* '''options''' = Options structure. See Options section below.
* '''options''' = Discussed below.


====Outputs====
====Outputs====


* '''xs''' = Scaled data.
* '''distances''' = A m-by-m matrix containing the comprehensive calculated Manhattan distances between samples.
* '''sc''' = Vector of scales calculated for given data.


===Options===
====Options====


''options'' = a structure array with the following fields:
options = A structure array with the following fields:


* '''offset''': [ 3] percent of the maximum mean value to be used as an offset on all scales. Avoids division by near-zero means.
* '''waitbar''': [{'auto'}| 'on' | 'off' ], display waitbar. 'Auto' setting will automatically display a waitbar if computation takes longer than 3 seconds.
* '''diag''': {default: 0} Defines the values to be used when comparing a sample to itself. Technically this distance is zero however in some instances, using an alternate value (e.g.: inf) is useful for flagging these self-calculated distances.


===See Also===
===See Also===
[[auto]], [[preprocess]], [[rescale]], [[scale]]

Revision as of 13:16, 15 August 2017

Purpose

Calculates Manhattan Distance between Samples (rows) of a Dataset Object (DSO) or a matrix.

Synopsis

distances = manhattandist(x)
distances = manhattandist(x,basis)
distances = manhattandist(x,options)
distances = manhattandist(x,basis,options)

Description

Calculates the Manhattan Distance, sum of the absolute value differences, from each row to every other row in the supplied matrix or, optionally, all rows of (x) to all rows in a second matrix (basis).

Inputs

  • x = A DSO or a matrix.

Optional Inputs

  • basis = A second DSO/matrix to compare the first DSO/matrix against when calculating Manhattan distance.
  • options = Discussed below.

Outputs

  • distances = A m-by-m matrix containing the comprehensive calculated Manhattan distances between samples.

Options

options = A structure array with the following fields:

  • waitbar: [{'auto'}| 'on' | 'off' ], display waitbar. 'Auto' setting will automatically display a waitbar if computation takes longer than 3 seconds.
  • diag: {default: 0} Defines the values to be used when comparing a sample to itself. Technically this distance is zero however in some instances, using an alternate value (e.g.: inf) is useful for flagging these self-calculated distances.

See Also