[General Information]
Function Name=ExtremeCum
Brief Description=Non-Linear Extreme Value Cumulative Function
Function Source=fgroup.ExtremeCum
Function Type=Built-in
Function Form=Expression
Number Of Parameters=8
Number Of Independent Variables=2
Number Of Dependent Variables=1
Analytical Derivatives for User-Defined=Off


[Fitting Parameters]
Naming Method=User-Defined
Names=z0,B,C,D,E,F,G,H
Meanings=?
Initial Values=--(V)
Lower Bounds=--(X, OFF)
Upper Bounds=--(X, OFF)
Number Of Significant Digits=


[Formula]
z = z0 + B*exp(-exp(-(x - C)/D)) + E*exp(-exp(-(y - F)/G)) + 
    H*exp(-exp(-(x - C)/D) -exp(-(y - F)/G));


[Constraints]



[Constants]


[Parameters Initialization]
Curve x_curve, y_curve;
bool bRes = get_interpolated_xz_yz_curves_from_3D_data(x_curve, y_curve, x_data, y_data, z_data);
if(!bRes) return;

vector coeff;
fitpoly( x_z_curve, 2, coeff );
double dZmax, dZmin;
x_curve.GetMinMax(dZmin,dZmax);
if (coeff[2] < 0)
{
	z0 = dZmax;
	C = xatymax(x_curve);
	F = xatymax(y_curve);
	D = abs(xatymax(x_curve)-xatymin(x_curve))/2;   
	G = abs(xatymax(y_curve)-xatymin(y_curve))/2;
	B = max(x_curve)/2;
	E = max(x_curve)/2;
	H = max(x_curve);
}
else
{
	z0 = dZmin;  
	C = xatymin(x_curve);
	F = xatymin(y_curve);
	D = abs(xatymax(x_curve)-xatymin(x_curve))/2;   
	G = abs(xatymax(y_curve)-xatymin(y_curve))/2;
	B = max(x_curve)/2;
	E = max(x_curve)/2;
	H = max(x_curve);
}

[Initializations]



[After Fitting]



[On Param Change]



[Independent Variables]
x=
y=


[Dependent Variables]
z=


[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
Generate Curves After Fitting=Yes
Curve Point Spacing=Uniform on X-Axis Scale
Generate Peaks After Fitting=Yes
Generate Peaks During Fitting=Yes
Generate Peaks with Baseline=Yes
Paste Parameters to Plot After Fitting=Yes
Paste Parameters to Notes Window After Fitting=Yes
Generate Residuals After Fitting=No
Keep Parameters=No
Enable Parameters Initialization=0
Compile On Param Change Script=1


[Compile Function]
Compile=0
Compile Parameters Initialization=1
On Param Change Scripts Enabled=N/A


[Origin C Function Header]



[Origin C Parameter Initialization Header]
#include <origin.h>
#include <Nag_utils.h>


