2.1.17.2.1.2 get_exponent


Description

This function evaluates the parameters' value in

y = y_0 + Ae^{R_0x}

Note: The function doesn't return the estimated scale value, A, but the natural logarithm value of A, \ln{A}.

Syntax

double get_exponent( vector & x_data, vector & y_data, double * pBase = NULL, double * pScaleExp = NULL, int * pScaleSign = NULL, bool bSortDataFirst = TRUE )

Parameters

x_data
[input] X-coordinates of input points
y_data
[input] Y-coordinates of input points
pBase
[output] Estimated value of y0
pScaleExp
[output] Estimated value of log(abs(A))
pScaleSign
[output] Indicate whether A is positive(1) or negative(-1)
bSortDataFirst
[input] Indicate whether need to sort the points before calculation

Return

Return the exponent.

Examples

EX1

void get_exponent_ex1(Curve& crv)
{
    vector vX, vY;  
    vY = crv;
    
	Dataset dsX;	
    crv.AttachX(dsX);    
    vX = dsX;      
    
    double dR0, y0, logA;
    int nScaleSign;
    dR0 = get_exponent(vX, vY, &y0, &logA, &nScaleSign);
    printf("dR0 = %.4lf, y0 = %.4lf, A = %.4lf.\n", dR0, y0, exp(logA)* nScaleSign);
}

Remark

The function used for fitting function parameter initialization.

See Also

fwhm, peak_pos

Header to Included

origin.h

Reference