[General Information]

Function Name=Bradley 	; name show up in the select function dialog
Brief Description=Bradley Model
Function Type=Built-in		; source type, built-in, user-defined, external dll
Function Form=Expression	; function form;
Function Source=fgroup.Bradley
Number Of Parameters=2
Number Of Independent Variables=1
Number Of Dependent Variables=1


[Fitting Parameters]

Naming Method=user-defined
Names=a,b
Lower bounds=--,--
Upper bounds=--,--
Meanings=unknown,unknown


[Independent Variables]

x =


[Dependent Variables]

y =


[Constants]


[Formula]

y = a*ln(-b*ln(x))

[Constraints]

p1 != p2


[Parameters Initialization]
sort( x_y_curve );
//smooth( x_y_curve, 2 ); 
Dataset xx;
x_y_curve.AttachX(xx);
xx = ln(xx);
double tmp;
xx.Sum(tmp);
if (tmp>0)
		xx = ln(xx);
else
		xx = ln(-xx);
double coeff[2];
fitpoly( x_y_curve, 1, coeff );
a = coeff[1];
b = (tmp>0) ? -exp( coeff[0] / coeff[1] ) : exp(coeff[0] / coeff[1]);


[Initializations]


[After fitting]


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