[General Information]

Function Name=YldFert	; name show up in the select function dialog
Brief Description=Yeild-fertilizer model in Agriculture and Learning curve in psychology
Function Type=Built-in		; source type, built-in, user-defined, external dll
Function Form=Expression	; function form;
Function Source=fgroup.YldFert
Number Of Parameters=3
Number Of Independent Variables=1
Number Of Dependent Variables=1


[Fitting Parameters]

Naming Method=user-defined
Names=a, b, r
Lower bounds=--,--,0.0(X,ON)
Upper bounds=--,--,1.0(X,ON)
Meanings=offset, coefficient, coefficient


[Independent Variables]

x = 


[Dependent Variables]

y = 


[Constants]


[Formula]
y = a + b*r^x

[Constraints]
0<r<1

[Parameters Initialization]
sort( x_y_curve );
smooth( x_y_curve );
double flag = yatxmax( x_y_curve ) - yatxmin( x_y_curve );
a = yatxmax( x_y_curve );
if ( flag > 0 ) x_y_curve = ln( a - x_y_curve );
else x_y_curve = ln( x_y_curve - a );
double coeff[2];
fitpoly( x_y_curve, 1, coeff, 1, 3);
if (flag > 0 ) b = -coeff[0];
else b = coeff[0];
r = 0.5;

[Initializations]


[After fitting]


[Controls]
General Linear Constraints=Off
Initialization scripts=Off
Scripts After fitting=Off

