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


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

NonlinearModelFit and assumptions on fit parameters

From Niles <niels.martinsen@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject NonlinearModelFit and assumptions on fit parameters
Date 2012-09-23 07:00 +0000
Message-ID <k3mc32$72m$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


Hi

I have a set of data (x, y) that I can succesfully fit a nonlinear function to using NonlinearModelFit:


data = {{1, 1}, {2, 2}, {3, 3.2}};
fitFuncExactNoLosses[a_, b_, x_] := a*x^2 + b + x;
nlm = NonlinearModelFit[data, fitFuncExactNoLosses[a, b, x],
  {
   {a, 1},
   {b, 1}},
  x]


However, the paramter "b" comes out negative and it *must* be positive. Is there a way to utilize assumptions such that b is constrained to be grater than zero?

Best,
Niels.

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

NonlinearModelFit and assumptions on fit parameters Niles <niels.martinsen@gmail.com> - 2012-09-23 07:00 +0000
  Re: NonlinearModelFit and assumptions on fit parameters DC <b.gatessucks@gmail.com> - 2012-09-24 04:47 +0000
  Re: NonlinearModelFit and assumptions on fit parameters Frank K <fkampas@gmail.com> - 2012-09-24 04:48 +0000

csiph-web