The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: NonlinearModelFit Problem
Replies: 3   Last Post: Jan 18, 2013 12:50 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Ray Koopman

Posts: 3,383
Registered: 12/7/04
Re: NonlinearModelFit Problem
Posted: Jan 18, 2013 12:50 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Jan 16, 8:15 pm, Frank K <> wrote:
> I suggest you use FindMinimum and minimize the sum of the
> square of the distances of your points from the spherical
> cap as a function of the parameters describing the cap.

That will give the centroid of the data, which could be quite far
from the center of the sphere. I would try something like this.

The initial guess is a closed-form solution for the center that
minimizes the variance of the squared distances of the points from
the center. Then FindMinimum minimizes the variance of the distances
of the points from the center.

data = {{x1,y1,z1},...,{xn,yn,zn}}; m = Mean@data
guess = m + .5 Total[#^2].PseudoInverse[#]&[Transpose@data - m]
Clear[x,y,z]; FindMinimum[
Variance[Norm[#-{x,y,z}]&/@data], Transpose@{{x,y,z},guess}]

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.