Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8957291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:57:20+00:00 2026-06-15T14:57:20+00:00

I am searching for a Matlab implementation of the Moore-Penrose algorithm computing pseudo-inverse matrix.

  • 0

I am searching for a Matlab implementation of the Moore-Penrose algorithm computing pseudo-inverse matrix.

I tried several algoithm, this one

http://arxiv.org/ftp/arxiv/papers/0804/0804.4809.pdf

appeared good at the first look.

However, the problem it, that for large elements it produces badly scaled matrices and some internal operations fail. It concerns the following steps:

L=L(:,1:r);
M=inv(L'*L);

I am trying to find a more robust solution which is easily implementable in my other SW. Thanks for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:57:22+00:00Added an answer on June 15, 2026 at 2:57 pm

    I re-implemented one in C# using the Mapack matrix library by Lutz Roeder. Perhaps this, or the Java version, will be useful to you.

    /// <summary>
    /// The difference between 1 and the smallest exactly representable number
    /// greater than one. Gives an upper bound on the relative error due to
    /// rounding of floating point numbers.
    /// </summary>
    const double MACHEPS = 2E-16;
    
    // NOTE: Code for pseudoinverse is from:
    // http://the-lost-beauty.blogspot.com/2009/04/moore-penrose-pseudoinverse-in-jama.html
    
    /// <summary>
    /// Computes the Moore–Penrose pseudoinverse using the SVD method.
    /// Modified version of the original implementation by Kim van der Linde.
    /// </summary>
    /// <param name="x"></param>
    /// <returns>The pseudoinverse.</returns>
    public static Matrix MoorePenrosePsuedoinverse(Matrix x)
    {
        if (x.Columns > x.Rows)
            return MoorePenrosePsuedoinverse(x.Transpose()).Transpose();
        SingularValueDecomposition svdX = new SingularValueDecomposition(x);
        if (svdX.Rank < 1)
            return null;
        double[] singularValues = svdX.Diagonal;
        double tol = Math.Max(x.Columns, x.Rows) * singularValues[0] * MACHEPS;
        double[] singularValueReciprocals = new double[singularValues.Length];
        for (int i = 0; i < singularValues.Length; ++i)
            singularValueReciprocals[i] = Math.Abs(singularValues[i]) < tol ? 0 : (1.0 / singularValues[i]);
        Matrix u = svdX.GetU();
        Matrix v = svdX.GetV();
        int min = Math.Min(x.Columns, u.Columns);
        Matrix inverse = new Matrix(x.Columns, x.Rows);
        for (int i = 0; i < x.Columns; i++)
            for (int j = 0; j < u.Rows; j++)
                for (int k = 0; k < min; k++)
                    inverse[i, j] += v[i, k] * singularValueReciprocals[k] * u[j, k];
        return inverse;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm searching for an implementation of the matlab gradient function in python. An example
I am searching for an algorithm or C++/Matlab library that can be used to
Searching something on SO, I stumbled across this question and one of the comments
Searching around I haven't found any recent answers to this question. The other answers
Searching here I found that this question was already asked , but I think
Searching for information about Flash/Flex + REST yields several many years old blog posts
Searching for a way to add this code, after the <head> (or some <link
In MATLAB there is the function clear to delete all current variables. This is
Searching on Stackoverflow and writing this question has taken more time than the change
Searching for solutions for my problem, I got this question , suggesting composite grammars

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.