Skip to content
This repository was archived by the owner on Nov 10, 2017. It is now read-only.
This repository was archived by the owner on Nov 10, 2017. It is now read-only.

SVD.pseudoSolve #45

Description

@fommil

e.g. (in Scala)

def pseudoSolve(m: Matrix, b: Vector) = {
    val svd = SVD.factorize(m)
    val ps = new BandMatrix(m.numRows(), 0, 0)
    // calculate pseudo-inverse of sigma
    svd.getS.zipWithIndex.foreach { case (v, i) =>
        if (v > 0.001) ps.set(i, i, 1 / v)
    }
    val tmpA = new DenseVector(b.size())
    svd.getU.transMult(b, tmpA)
    val tmpB = new DenseVector(b.size())
    ps.mult(tmpA, tmpB)
    tmpA
    svd.getVt.transMult(tmpB, tmpA)
  }

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions