Search Results for

    Show / Hide Table of Contents

    Class SvdAndPca

    contains methods and test example to do Singular Value decomposition and Principal Components Analysis

    IMPORTANT NOTE: The underlying storage of the Matrix class is a one dimensional array in column-major order (column by column). NOT Row by row!!.

    Inheritance
    Object
    SvdAndPca
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: TowseyLibrary
    Assembly: TowseyLibrary.dll
    Syntax
    public static class SvdAndPca

    Methods

    | Improve this Doc View Source

    EigenVectors(Double[,])

    returns the eigen values and eigen vectors of a matrix IMPORTANT: THIS METHOD NEEDS DEBUGGING. IT RETURNS THE NEGATIVE VALUES OF THE EIGEN VECTORS ON A TOY EXMAPLE double[,] matrix = { { 3.0, -1.0 }, { -1.0, 3.0 } }; eigen values are correct ie, 2.0, 4.0; but in the wrong order.

    Declaration
    public static Tuple<double[], double[, ]> EigenVectors(double[, ] matrix)
    Parameters
    Type Name Description
    Double[,] matrix
    Returns
    Type Description
    Tuple<Double[], Double[,]>
    | Improve this Doc View Source

    ExampleOfSVD_1()

    Declaration
    public static void ExampleOfSVD_1()
    | Improve this Doc View Source

    ExampleOfSVD_2()

    Declaration
    public static void ExampleOfSVD_2()
    | Improve this Doc View Source

    ExampleOfSVD_3()

    These examples are used to do Wavelet Packet Decomposition and then do SVD on the returned WPD trees.

    Declaration
    public static void ExampleOfSVD_3()
    | Improve this Doc View Source

    SingularValueDecompositionOutput(Double[,])

    Declaration
    public static Tuple<Vector<double>, Matrix<double>> SingularValueDecompositionOutput(double[, ] matrix)
    Parameters
    Type Name Description
    Double[,] matrix
    Returns
    Type Description
    Tuple<MathNet.Numerics.LinearAlgebra.Vector<Double>, MathNet.Numerics.LinearAlgebra.Matrix<Double>>
    | Improve this Doc View Source

    SingularValueDecompositionVector(Double[,])

    The singular value decomposition of an M by N rectangular matrix A has the form A(mxn) = U(mxm) * S(mxn) * V'(nxn) where U is an orthogonal matrix, whose columns are the left singular vectors; S is a diagonal matrix, whose min(m,n) diagonal entries are the singular values; V is an orthogonal matrix, whose columns are the right singular vectors; Note 1: the transpose of V is used in the decomposition, and that the diagonal matrix S is typically stored as a vector. Note 2: the values on the diagonal of S are the square-root of the eigenvalues.

    THESE TWO METHODS HAVE BEEN TESTED ON TOY EXAMPLES AND returned correct values.

    Declaration
    public static double[] SingularValueDecompositionVector(double[, ] matrix)
    Parameters
    Type Name Description
    Double[,] matrix
    Returns
    Type Description
    Double[]
    | Improve this Doc View Source

    TestEigenValues()

    Declaration
    public static void TestEigenValues()
    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • EigenVectors(Double[,])
      • ExampleOfSVD_1()
      • ExampleOfSVD_2()
      • ExampleOfSVD_3()
      • SingularValueDecompositionOutput(Double[,])
      • SingularValueDecompositionVector(Double[,])
      • TestEigenValues()
    Generated by DocFX AP docs version: 21.7.0.4-master-e26127a50d7bd7472d47288f10e61014fb981f7f-DIRTY-CI:144 Back to top