Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: FindFit

  • To: mathgroup at smc.vnet.net
  • Subject: [mg92743] Re: FindFit
  • From: psycho_dad <s.nesseris at gmail.com>
  • Date: Sun, 12 Oct 2008 04:31:27 -0400 (EDT)
  • References: <200810100835.EAA07169@smc.vnet.net> <gcq097$c2k$1@smc.vnet.net>

Hi,
Since you have to deal with quite large numbers, one way to do it is
to use logarithms:

data=Table[{n,Log[(1/2) ((1+Sqrt[13])^(2^n)+(1-Sqrt[13])^(2^n))]},{n,
1,6}]//Simplify;

FindFit[data,Log[(1/2) ((a+Sqrt[b])^(2^x)+(a-Sqrt[b])^(2^x))],{{a,2},
{b,10}},x,WorkingPrecision\[Rule]10]

Out: {a\[Rule]1.000000000,b\[Rule]13.00000000}

The only reason that I have specified a direction {{a,2},{b,10}} is
because your model is degenerate with respect to a. If I didn't do it
then you might get the other minimum (equivelent but not the one you
want)   {a\[Rule]-1.000000000,b\[Rule]13.00000000}. Note also that
now, you no longer require such large working precision.

Cheers


  • Prev by Date: Re: Mathematica Plot Functions
  • Next by Date: Variable amount of Buttons in Mathematica
  • Previous by thread: Re: FindFit
  • Next by thread: Re: FindFit