# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.evt.evd.univariate.fitting.acer

## Class NonlinearFit

• java.lang.Object
• com.numericalmethod.suanshu.stats.evt.evd.univariate.fitting.acer.NonlinearFit

• public class NonlinearFit
extends Object
Fit log-ACER function by sequential quadratic programming (SQP) minimization (of weighted RSS), using LinearFit's solution as the initial guess. The weights are computed as: $w_i = \frac{1}{(\log CI^+(\eta_i) - \log CI^-(\eta_i))^2}$ These weights measure the reciprocals of variances and are used to put less emphasis on the more uncertain values for the ACER function.
• ### Nested Class Summary

Nested Classes
Modifier and Type Class and Description
static class  NonlinearFit.Result
• ### Constructor Summary

Constructors
Constructor and Description
NonlinearFit()
• ### Method Summary

All Methods
Modifier and Type Method and Description
static double computeWeightedRSS(ACERFunction.ACERParameter param, double[] barrierLevels, double[] epsilons, double[] weights)
Measure how fit the estimated log-ACER function to the empirical epsilons by weighted sum of squared residuals (RSS).
static double[] computeWeights(double[] epsilon, double[] confint)
Compute weights from epsilon values and their corresponding confidence interval half-width.
NonlinearFit.Result fit(double[] eta, double[] epsilon, double[] confWidth, double peakMean, double tailMarker)
Fit the ACER function with the input values of barrier levels, epsilons, confidence intervals, and the mean of the peaks.
NonlinearFit.Result fit(EmpiricalACER estimates, double tailMarker)
Fit ACER function with empirical ACER estimates.
NonlinearFit.Result fitWithWeights(double[] eta, double[] epsilon, double[] weights, double peakMean, double minLevel, double tailMarker)
Fit the ACER function with the input values of barrier levels, epsilons, confidence intervals, and the mean of the peaks.
NonlinearFit.Result fitWithWeightsAndInitial(double[] eta, double[] epsilon, double[] weights, ACERFunction.ACERParameter initial, double minLevel, double tailMarker)
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### NonlinearFit

public NonlinearFit()
• ### Method Detail

• #### fit

public NonlinearFit.Result fit(EmpiricalACER estimates,
double tailMarker)
Fit ACER function with empirical ACER estimates. Weights are computed from the confidence intervals of the estimates.
Parameters:
estimates - the empirical ACER estimates
tailMarker - the tail marker
Returns:
the fitted ACER parameters
• #### fit

public NonlinearFit.Result fit(double[] eta,
double[] epsilon,
double[] confWidth,
double peakMean,
double tailMarker)
Fit the ACER function with the input values of barrier levels, epsilons, confidence intervals, and the mean of the peaks. Weights are computed from the input confidence intervals.
Parameters:
eta - the barrier levels
epsilon - the ACER values
confWidth - the confidence interval half-widths for the ACER values
peakMean - the mean of the events (or peaks)
tailMarker - the tail marker
Returns:
the fitted ACER parameters
• #### fitWithWeights

public NonlinearFit.Result fitWithWeights(double[] eta,
double[] epsilon,
double[] weights,
double peakMean,
double minLevel,
double tailMarker)
Fit the ACER function with the input values of barrier levels, epsilons, confidence intervals, and the mean of the peaks. Weights
Parameters:
eta - the barrier levels
epsilon - the ACER values (assume all positive as ACER represents a probability)
weights - the weighting for the ACER values (put more emphasis on more confident values)
peakMean - the mean of the events (or peaks)
minLevel - the minimum barrier level
tailMarker - the tail marker
Returns:
the fitted ACER parameters
• #### fitWithWeightsAndInitial

public NonlinearFit.Result fitWithWeightsAndInitial(double[] eta,
double[] epsilon,
double[] weights,
ACERFunction.ACERParameter initial,
double minLevel,
double tailMarker)
• #### computeWeights

public static double[] computeWeights(double[] epsilon,
double[] confint)
Compute weights from epsilon values and their corresponding confidence interval half-width.
Parameters:
epsilon - the epsilon values
confint - the confidence interval half-width
Returns:
the computed weights

public static double computeWeightedRSS(ACERFunction.ACERParameter param,
double[] barrierLevels,
double[] epsilons,
double[] weights)
Measure how fit the estimated log-ACER function to the empirical epsilons by weighted sum of squared residuals (RSS).
Parameters:
param - the estimated parameter for ACER function
barrierLevels - the barrier levels
epsilons - the (positive) empirical epsilons for the corresponding barrier levels
weights - the weights for the corresponding epsilon
Returns: