Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #16629

Re: FindFit and LeastSquares

From Costa Bravo <q13a27tt@aol.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: FindFit and LeastSquares
Date 2014-03-10 08:40 +0000
Message-ID <lfjtq2$hke$1@smc.vnet.net> (permalink)
References <lfehp1$5lv$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


Alexandra Lipson wrote:
>
> data = {{1.02, .39}, {.95, .32}, {.87, .27}, {.77, .22}, {.67, .18}, {.56, \
> .15}, {.44, .13}, {.3, .12}, {.16, .13}, {.01, .15}}
>
> model = a*y^2 + b*x*y + c*x + d*y + e - x^2
> FindFit[data, model, {a, b, c, d, e}, {x, y}]
...
>
> I've been getting the error that FindFit is not a list or a rectangular
> array, among others.

FindFit  data <-> x,y,f error !!

should be
  data1 = Join[#, {0}] & /@ data
now
  w = FindFit[data1, model, {a, b, c, d, e}, {x, y}]

  out {a -> -2.6356255, b -> 0.14364618, c -> 0.55144696, d -> 3.2229403,
  e -> -0.43289427}

verification
  model1 = model /. w
(#[[3]] - (model1 /. {x -> #[[1]], y -> #[[2]]})) & /@ data1
  ListPlot[%]

-- 
  Costa

Back to comp.soft-sys.math.mathematica | Previous | NextPrevious in thread | Find similar


Thread

FindFit and LeastSquares Alexandra Lipson <lipson.alexandra@gmail.com> - 2014-03-08 07:44 +0000
  Re: FindFit and LeastSquares Costa Bravo <q13a27tt@aol.com> - 2014-03-10 08:40 +0000

csiph-web