Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Fitting a function to a list (newbie)

  • To: mathgroup at
  • Subject: [mg21863] Re: Fitting a function to a list (newbie)
  • From: "Robert Nowak" <robert.nowak at>
  • Date: Wed, 2 Feb 2000 22:54:20 -0500 (EST)
  • Organization: (Vienna, Austria)
  • References: <872jej$>
  • Sender: owner-wri-mathgroup at

what you need is:

<< Statistics`NonlinearFit`
NonlinearFit[data, A + B*Sin[C*x+D], x, {A,B,C,D}]

Robert Nowak (robert.nowak at
Ionen Mikrofabrikations Systeme GmbH
A-1020 Wien, Schreygasse 3, Austria
Phone: (+43 1)2144894-32, Fax: (+43 1)2144894-99

<mathprof at> wrote in message news:872jej$civ at
> I'm new to Mathematica 4.0, so I apologize if this question is overly
> trivial (and please let me know if there's a place for trivial
> question).
> I have a list that I'd like to fit to the function:
> A + B*Sin[C*x+D]
> In other words, I'd like to find the (approximate numeric) values of
> A,B,C,D that yield the best fit to my data.
> I tried using Fit[], but it only applies to linear combinations of
> functions, and couldn't optomize the values of C and D.
> For this specific problem, I'm guessing some sort of Fourier transform
> might work, but I'm interested in a more general solution -- for example
> if Sin[] were replaced with a more complicated function.
> Any help appreciated!
> Sent via
> Before you buy.

  • Prev by Date: Re: Fitting a function to a list (newbie)
  • Next by Date: Re: How to Break[] out of nested loops?
  • Previous by thread: Re: Fitting a function to a list (newbie)
  • Next by thread: Re: Fitting a function to a list (newbie)