comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Newbie's question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Newbie's question [message #45901 is a reply to message #45898] Thu, 20 October 2005 15:08 Go to previous messageGo to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
ChiChiRuiz@gmail.com wrote:
> Poly_fit doesn't really give me what I need. I don't need the
> coefficients of a quadratic equation, I want to know the best fit of
> the scatter plot to some power of x. I know it's not exactly power
> square, but it should be in that neighborhood. Even if I shift all
> data to the positive axis, i.e. y = a* (x-x0)^b, any x values less than
> x0 is still considered "negative". I don't know what else...maybe I'll
> try change of variable or something... thank you for your help.

What leads you to believe that y is some power of x? Is it simply a
guess based upon the shape of the curve, or do you have some
theoretical reason for expecting a power relationship?

Theories that lead to a power-law relationship without fixing the power
to be a specific rational number generally apply only to data where the
dependent variable is guaranteed to be positive. The numerical problems
you have trying to fit such a relationship to data where x is sometimes
negative are directly related to the reasons why theories tend not to
imply the existence of such relationships.

For that same reason, if you're merely guessing at what the shape of
the curve is, rather than getting it from a theory, I suspect that your
guess is a bad one.

One possibility: the relationship isn't y = a*x^b; it's actually y =
a*|x|^b. I've seen situations where that is a reasonable model. That
will avoid the problems you've been having.

This is really a scientific problem, not a numerical one; figure out
the right model for your data and the curve-fitting routines shouldn't
have any problem fitting it to your data.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: map_set miracle II
Next Topic: Re: middle mouse button emulation in widget_draw

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 05:52:10 PDT 2025

Total time taken to generate the page: 1.23825 seconds