ISlAnalysis.StandartizationCoefficients

Syntax

StandartizationCoefficients: Array;

Description

The StandartizationCoefficients property determines standardization coefficients.

Comments

The number of coefficients should match the number of the studied data series (variables). Coefficients are estimated only for the following analysis types: Correlation matrix of source data and Standardized matrix of source data (ISlAnalysis.Type). If the Standardized matrix of source data analysis type is used, these coefficients can be defined.

Example

Add a link to the Stat system assembly.

Sub UserProc;
Var
    pc: SmPrincipalComponentAnalysis;
    Obj: ISlSeries;
    d0, d1, d2: Double;
    i, res: Integer;
    ar1, ar2, ar3, sc: Array Of Double;
    Analysis: ISlAnalysis;
Begin
    pc := New SmPrincipalComponentAnalysis.Create;
    pc.MissingData.Method := MissingDataMethod.AnyValue;
    ar1 := New Double[10];
    ar2 := New Double[10];
    ar3 := New Double[10];
    // values ar1, ar2, ar3
    ar1[0] := 7.0000; ar2[0] := 4.0000; ar3[0] := 3.0000;
    ar1[1] := 4.0000; ar2[1] := 1.0000; ar3[1] := 8.0000;
    ar1[2] := 6.0000; ar2[2] := 3.0000; ar3[2] := 5.0000;
    ar1[3] := 8.0000; ar2[3] := 6.0000; ar3[3] := 1.0000;
    ar1[4] := 8.0000; ar2[4] := 5.0000; ar3[4] := 7.0000;
    ar1[5] := 7.0000; ar2[5] := 2.0000; ar3[5] := 9.0000;
    ar1[6] := 5.0000; ar2[6] := 3.0000; ar3[6] := 3.0000;
    ar1[7] := 9.0000; ar2[7] := 5.0000; ar3[7] := 8.0000;
    ar1[8] := 7.0000; ar2[8] := 4.0000; ar3[8] := 5.0000;
    ar1[9] := 8.0000; ar2[9] := 2.0000; ar3[9] := 2.0000;
    Obj := pc.Objects;
    Obj.Add.Value := ar1;
    Obj.Add.Value := ar2;
    Obj.Add.Value := ar3;
    pc.Analysis.Type := AnalysisType.Correlation;
    Analysis := pc.Analysis;
    Analysis.Type := AnalysisType.Standardised;
    sc := New Double[3];
    sc[0] := 1.2;
    sc[1] := 2.5;
    sc[2] := 3.2;
    Analysis.StandartizationCoefficients := sc;
    pc.ScoreType := PCAScoreType.Stand;
    res := pc.Execute;
    If res <> 0 Then
        Debug.WriteLine(pc.Errors);
    Else
        Debug.WriteLine("Eigenvectors:");
        For i := 1 To 3 Do
            d0 := pc.P[0, i - 1];
            d1 := pc.P[1, i - 1];
            d2 := pc.P[2, i - 1];
            Debug.AssertMsg(False"Principal component №" + i.ToString + ": " +
                d0.ToString + " " + d1.ToString + " " + d2.ToString);
        End For;
        Debug.WriteLine("================================");
        Debug.WriteLine("Values of principal components:");
        Debug.AssertMsg(False"Principal component №1, №2, №3");
        For i := 1 To pc.v.GetUpperBound(1) + 1 Do
            d0 := pc.V[i - 10];
            d1 := pc.V[i - 11];
            d2 := pc.V[i - 12];
            Debug.AssertMsg(False"Observation №" + i.ToString + ": " +
                d0.ToString + " " + d1.ToString + " " + d2.ToString);
        End For;
    End If;
End Sub UserProc;

After executing the example the console window displays values of eigenvectors and values of principal components:

Module execution started
Eigenvectors: 
Principal component №1: -0.92077649209595513 -0.35985195392551339 0.15058958416656218
Principal component №2: 0.20622323551290711 -0.12135686560426749 0.97095030166599983
Principal component №3: -0.33112328329197255 0.92508328404889983 0.18595238324701854
================================
Values of principal components: 
Principal component №1, №2, №3
Observation 1: -0.060809859614934327 -0.2454876177488676 0.028147225845809285
Observation 2: 0.66860029745174931 0.19162338500533929 0.034715532141783134
Observation 3: 0.18618054751448709 -0.061246236909666622 0.045741724414850318
Observation 4: -0.34316225847182846 -0.44822528387430632 0.30484156623651032
Observation 5: -0.23843388081487207 0.26394983999230748 0.28784386374366361
Observation 6: 0.079280509769494828 0.48518379140398377 -0.28313931560677952
Observation 7: 0.35156470563011327 -0.3579537004102874 0.17276430429903653
Observation 8: -0.41537910325207889 0.44504416372953226 0.1146060944483282
Observation 9: -0.037687730971773109 -0.01426133822207557 0.12057760466810775
Observation 10: -0.19015322724035691 -0.25862700296595931 -0.82609860019130865
Module execution completed

See also:

ISlAnalysis