curve fitting problem
- From: mdekauwe@xxxxxxxxx
- Date: 24 Mar 2006 05:02:32 -0800
Hi,
This might be quite complicated to explain so please bear with me! I
have a fucntion which requires that 9 values are calibrated so that it
best matches estimates from a data file.
The data file simply has:
day of year estimated values
57 -0.35
63 -0.45
74 -0.56 etc
The function with the 9 values should produce similar values to the
estimated values given other inputs - the function is quite complex ...
f(x) = (((((a7 * $11**2) / ($11**2 + a9)) * $6 * ((abs($7)**a10) /
((0.5 * 15.22) + (a6 * $9)))) * ($8 - (0.5 * (($8 + (a3 - a4) - (((a1 *
$10 * $11) / ((abs($7)**a10) / ((0.5 * 15.22) + (a6 * $9)))) * exp ($3
* a8))) + (sqrt((($8 + (a3 - a4) - (((a1 * $10 * $11) / ((abs($7)**a10)
/ ((0.5 * 15.22) + (a6 * $9)))) * exp ($3 * a8)))**2) - (4 * (($8 * (a3
- a4)) - ((((a1 * $10 * $11) / ((abs($7)**a10) / ((0.5 * 15.22) + (a6 *
$9)))) * exp ($3 * a8)) * a3))))))))) / (((a7 * $11**2) / ($11**2 +
a9)) * $6) + (((abs($7)**a10) / ((0.5 * 15.22) + (a6 * $9))) * ($8 -
(0.5 * (($8 + (a3 - a4) - (((a1 * $10 * $11) / ((abs($7)**a10) / ((0.5
* 15.22) + (a6 * $9)))) * exp ($3 * a8))) + (sqrt((($8 + (a3 - a4) -
(((a1 * $10 * $11) / ((abs($7)**a10) / ((0.5 * 15.22) + (a6 * $9)))) *
exp ($3 * a8)))**2) - (4 * (($8 * (a3 - a4)) - ((((a1 * $10 * $11) /
((abs($7)**a10) / ((0.5 * 15.22) + (a6 * $9)))) * exp ($3 * a8)) *
a3)))))))))) * ((a2 * ((24 * acos ((-tan(45 * (3.14159265 /180))) *
(tan(-0.408 * cos (((360.0 * ($2 + 10.0)) / 365.0) *
(3.14159265/180)))))) / (3.14159265))) + a5)
I couldn't see how you could enter it as seperate equations into
gnuplot so I made it into one large function.
So I set up the initial guesses at the 9 values - a1 -a9
gnuplot > a1 = 2.155; a2 = 1.1; a3 = 2.9; a4 = 2.3; a5 = 1.6; a6 =
2.653; a7 = 4.309; a8 = 3.2; a9 = 1.062; a10 = 2.2;
entered the above function
and then asked gnuplot to fit the function
gnuplot> fit f(x) "filename" using 2:1 via a1, a2, a3, a4, a5, a6, a7,
a8, a9, a10
and GNUPLOT said --> Undefined value during function evaluation
Now I think I may have misunderstood how this works ? when above I said
using 2:1 thats where in the data file I have
day of year estimated values
57 -0.35
63 -0.45
74 -0.56 etc
Any help would be much appreciated
thanks,
Martin.
.
- Follow-Ups:
- Re: curve fitting problem
- From: Hans-Bernhard Broeker
- Re: curve fitting problem
- From: Steve Bickerton
- Re: curve fitting problem
- Prev by Date: splot matrix
- Next by Date: Re: splot matrix
- Previous by thread: splot matrix
- Next by thread: Re: curve fitting problem
- Index(es):
Relevant Pages
|