Re: fit by varying the data

Hans-Bernhard Bröker <[email protected]>
Newsgroups gmane.comp.graphics.gnuplot.user
Message-ID <[email protected]>
Am 18.06.2019 um 21:33 schrieb Patrick Dupre:
> Sorry,
> 
> Why it does not make sense?

Because it doesn't.  Assigning data to 'x' makes no sense because that's
what giving those data as the first "using" specifier already does, and
because 'x is not available to be assigned.

> 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)

No, you don't know that combination.  Which is why you're looking for it.

> There is no fundamental glitch.

I'm not convinced you've quite reached the point where you should be the
sole judge on that.

> The 2 set of data are issue from the same experiment.
> Typically, it is vector whose you want to fit the direction.

As given, no, it's not.  You have a cloud of points in 3D.  What you're
trying to fit is, for all practical intents and purposes, a plane
through that cloud.  Except that, for some reason, you want to express
the orientation of that plane partially as an angle, partially as a slope.

And the easiest way of doing that may well be to turn things around:
express $1 as a function of $2 and $3, and fit that.

fit (cos(theta)*x+sin(theta)*y)/a + x0 'data' using 2:3:1 via a, x0, theta


> I need to re-read the datasets which are stored in $DATA

No, you don't.  You need to re-format your problem statement to
eliminate that apparent need.


_______________________________________________
gnuplot-info mailing list
[email protected]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.