Code Monkey home page Code Monkey logo

Comments (6)

bleckers avatar bleckers commented on August 27, 2024

Aha!

It seems to only happen when using a third position (altitude) in the Positions array. When you remove this it calculates both of these just fine.

Creating a separate function to calculate the error with only a two element position (lat/lng) allows you to calculate this just fine.

from trilateration.

lemmingapex avatar lemmingapex commented on August 27, 2024

Hi Blair,

I have seen this exception before when requesting the error information. It likely means that this information is meaningless.

When you request sigma, the covariance of the Jacobian matrix is determined in a QRDecomposition. The double threshold argument you provide to getSigma is a way for the caller to specify that the result of this computation should be considered meaningless, and thus trigger an exception. In your above example, change optimum.getSigma(0); and optimum.getCovariances(0); to optimum.getSigma(-1); and optimum.getCovariances(-1); respectively. This will likely cause you to obtain NaN entries in your results. Meaningless, right?

Do you think if the above information was better documented, this would avoid confusion in the future? What do you think?

Thanks,
Scott

from trilateration.

bleckers avatar bleckers commented on August 27, 2024

I think a brief explanation in the readme on the threshold value and an example on how to handle a meaningless result/exception should suffice. It just threw me because the optimum was calculated just fine.

from trilateration.

lemmingapex avatar lemmingapex commented on August 27, 2024

@bleckers, I put a short comment in the README. Take a look, let me know what you think. Can I close this issue?

from trilateration.

bleckers avatar bleckers commented on August 27, 2024

Maybe something about what input variables might constitute a SingularMatrixException? Most people will be using this library without going into detail about the maths involved and it would be useful to know when they might experience the error (like for example above when using a 3D coordinate space).

from trilateration.

lemmingapex avatar lemmingapex commented on August 27, 2024

Everything related to SingularMatrixException is well documented in apache's docs:
https://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math3/fitting/leastsquares/LeastSquaresProblem.Evaluation.html#getSigma(double)

Users looking to find out more about how these methods should look there.

from trilateration.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.