Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

3D Planar Multiple Linear Regression?

by fraizerangus (Sexton)
on May 15, 2011 at 17:55 UTC ( [id://904980]=perlquestion: print w/replies, xml ) Need Help??

fraizerangus has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks I have an array of 3D cartesian co-ordinates (XYZ) which I need to fit a flat plane to, does anybody know of a module which would be able to do this for me? Muchos Gratious Dan x

Replies are listed 'Best First'.
Re: 3D Planar Multiple Linear Regression?
by LanX (Saint) on May 15, 2011 at 18:10 UTC
    Googling for you shows some results: cpan linear regression

    And the first hit even has the words "plane fitting" in it.

    So if they don't work, then you should be more explicit about the "why" and the "what".

    Cheers Rolf

Re: 3D Planar Multiple Linear Regression?
by BrowserUk (Patriarch) on May 15, 2011 at 21:18 UTC

    If you know that your plane will be close to horizontal (or can be reliably pre-transformed to make it so), then the Hough transform is a viably efficient approach.

    If you gave a description of how the points are gathered, or could post a (not too large) 'typical' dataset, then you might get better leads.

    But the more generalised an approach you need--ie. the less pre-constraints you can impose on the problem--the harder it is to solve efficiently. A fully generalised solution can be prohibitively expensive.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re: 3D Planar Multiple Linear Regression?
by ambrus (Abbot) on May 15, 2011 at 22:27 UTC

    You may try to use Math::GSL::Multifit which is a wrapper over the multi-dimensional least square fitting functions in GSL. You need the linear fit functions of course.

Re: 3D Planar Multiple Linear Regression?
by anonymized user 468275 (Curate) on May 16, 2011 at 14:26 UTC
    Statistics::Regression includes plane fitting capability.

    One world, one people

      Thanks Folks!

      I can't get my head round Statistics::Regression, can you simply input 3D cartesian co-ordinates and output an equation for the plane?

      Does anyone have an example please?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://904980]
Approved by LanX
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2024-04-19 12:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found