TMtxMDScaling Class

Source: StatTools.cs · Assembly: Dew.Stats
ComponentTMtxComponentTMtxMDScaling

public class TMtxMDScaling : TMtxComponent

Performs multidimensional scaling.

Use TMtxMDScaling component to perform multidimensional scaling on dataset.

How to use TMtxMDScaling component?
1. Drop a TMtxMDScaling component on the form. 2. Set Dew.Stats.TMtxMDScaling.DataFormat property to define how data will be interpreted. Data can be interpreted as dissimilarities matrix, similarities matrix or raw data matrix. 3. Define Dew.Stats.TMtxMDScaling.Data, the matrix representing dissimilarities matrix, similarities matrix or raw data.
4. Set Dew.Stats.TMtxMDScaling.Dimensions to define number of variables in reduced space. 5. Set Dew.Stats.TMtxMDScaling.DistanceMethod to define how pairwise distance will be calculated. 6. Set Dew.Stats.TMtxMDScaling.ScalingMethod to define scaling algorithm. Currently only metric (classical) multidimensional scaling algorithm is supported. 7. Call the Dew.Stats.TMtxMDScaling.Recalc method to trigger calculation.

Results:
1. Dew.Stats.TMtxMDScaling.Y : Point coordinates in reduced space. 2. Dew.Stats.TMtxMDScaling.EigenValues : Eigenvalues in reduced space, sorted in descending order. 3. Dew.Stats.TMtxMDScaling.DHat : Estimated dissimilarities matrix. 4. Dew.Stats.TMtxMDScaling.Stress : Calculated stress factor.

Examples

csharp
using Dew.Stats;
using Dew.Stats.Units;
using Dew.Math;
namespace Dew.Examples
{
    private void Example(StatTools.TMtxMDScaling mds)
    {
        // similarities matrix (symmetric with 1.0 on diagonal)
        mds.Data.SetIt(5,5,false, new double[] {
            1.00, 0.3, 0.2, 0.25, 0.33,
            0.30, 1.0, 0.11, 0.21, 0.8,
            0.20, 0.11, 1.0, 0.40, 0.5,
            0.25, 0.21, 1.0, 0.10, 0.05,
            0.33, 0.80, 0.5, 0.05, 1.00});
        mds.DataFormat = TMDDataFormat.mdFormatSimilarities;
        // use "standard" Euclidian metric
        mds.DistanceMethod = TPWDistMethod.pwdistEuclidian;
        // define number of desired dimensions (1)
        mds.Dimensions = 1;
        // Do the math
        mds.Recalc();
        // check Stress, DHat, EigeValues to evaluate GOF if (1) dimension is used
    }
}

Properties

NameTypeDescription
AutoUpdateBooleanIf true then changing any of the TMtxPCA properties will trigger the Dew.Stats.TMtxMDScaling.Recalc method.
BlockAssignBooleanBlock streaming of specific properties when storing only a "template".
DTMtxUsed dissimilarities matrix.
DataTMtxData to be analyzed by MDS.
DataFormatTMDDataFormatData format.
DHatTMtxEstimated dissimilarities matrix.
DimensionsInt32Reduced dimension size.
DirtyBooleanWhen any of the TMtxMDScaling properties changes, this property is automatically set to true.
DistanceMethodTPWDistMethodMetric for distance calculation.
EditorActiveBooleanReturns True, if the component editor is displayed.
EigenValuesTVecReduced space eigenvalues.
ReferenceTReferenceListStores a list of components that have to be notified, when this component is destroyed.
ScalingMethodTMDScalingMethodDefines multidimensional scaling algorithm.
StressDoubleReturns multidimensional scaling stress value which is an estimate for GOF.
YTMtxReduced space point coordinates.

Methods

NameDescription
AllowStreamingReturns the negatated value of BlockAssign.
AssignAssign values of all published properties from Source.
AssignTemplateAssign values of "template-like" published properties from Source.
EditorClassTo be overriden in descendanr classses.
LoadFromStreamLoad the component from Src stream.
LoadTemplateFromFileLoad a template from file.
LoadTemplateFromStreamLoad a template from stream.
RecalcTriggers MDScalling recalculation.
ResetReset is called after loading the data from stream or file.
SaveTemplateToFileSave template to file.
SaveTemplateToStreamSave template to stream.
SaveToStreamSave the component to Dst stream.