|
From: Patrick D. <pd...@gm...> - 2019-06-18 19:33:43
|
Sorry, Why it does not make sense? I need to fit 3 parameters, x0, a and theta by minimizing the sum of the square root: The function depend only on x (and of the parameters, x0 and a) while I have 2 sets of that $2 and $3 (which depend on the same x). I only know a linear combination of this 2 sets that can be fitted y(x) = $2 (x) *sin(theta) + $3 (x) *cos(theta) There is no fundamental glitch. The 2 set of data are issue from the same experiment. Typically, it is vector whose you want to fit the direction. This direction is optimum when one of the components varies linearly. I just need to minimize \sum (y(x) - a*(x-x0))^2 I need to re-read the datasets which are stored in $DATA Any minimization program can potentially do it. =========================================================================== Patrick DUPRÉ | | email: pd...@gm... Laboratoire interdisciplinaire Carnot de Bourgogne 9 Avenue Alain Savary, BP 47870, 21078 DIJON Cedex FRANCE Tel: +33 (0)380395988 =========================================================================== > Sent: Tuesday, June 18, 2019 at 8:45 PM > From: "Hans-Bernhard Bröker" <HBB...@t-...> > To: "Patrick Dupre" <pd...@gm...>, gnuplot <gnu...@li...> > Subject: Re: [Gnuplot-info] fit by varying the data > > Am 18.06.2019 um 18:53 schrieb Patrick Dupre: > > Hello, > > > > Can I do this: > > fit a*(x-x0) $DATA u (x=$1):($2*sin(theta)+$3*cos(theta)) via x0,a,theta > ^^^^ > > That assignment operation makes no sense at all. > > And no, you can't do that. The parameters have to influence the > _function_, not the data. You really wouldn't want to re-read the > entire dataset on every iteration of 'fit', just to update the effect of > parameters on the data. > > |