[GENERAL INFORMATION]
Function Name=DoseResp
Brief Description=Dose-response curve with variable Hill slope given by parameter 'p'.
Function Source=fgroup.Response1
Function Type=Built-in
Function Form=Expression
Number Of Parameters=4
Number Of Independent Variables=1
Number Of Dependent Variables=1


[FITTING PARAMETERS]
Naming Method=User-Defined
Names=A1,A2,LOGx0,p
Meanings=bottom asymptote,top asymptote, center, hill slope
Lower Bounds=--(I,Off),--(I,Off),0(I,Off),0(I,Off)
Upper Bounds=--(I,Off),--(I,Off),--(I,Off),--(I,Off)
Number Of Significant Digits=


[FORMULA]

y = A1 + (A2-A1)/(1 + 10^((LOGx0-x)*p))


[CONSTRAINTS]


[Parameters Initialization]
sort(x_y_curve);
//smooth(x_y_curve);
A1 = min( y_data );
A2 = max( y_data );
LOGx0 = xaty50( x_y_curve );
double xmin, xmax;
x_data.GetMinMax(xmin, xmax);
double range = xmax - xmin;
if ( yatxmax(x_y_curve) - yatxmin(x_y_curve) > 0) 
	p = 5.0 / range;
else
	p = -5.0 / range;


[CONSTANTS]


[INITIALIZATIONS]



[AFTER FITTING]



[INDEPENDENT VARIABLES]
x=


[DEPENDENT VARIABLES]
y=


[CONTROLS]
General Linear Constraints=Off
Initialization Scripts=Off
Scripts After Fitting=Off
Number Of Duplicates=N/A
Duplicate Offset=N/A
Duplicate Unit=N/A


[Derived Parameters]
span = abs(A1-A2);
EC20 = 10^(LOGx0 + log(0.25)/p);
EC50 = 10^LOGx0;
EC80 = 10^(LOGx0 + log(4)/p);
