Class NonlinearFit
- java.lang.Object
-
- dev.nm.stat.evt.evd.univariate.fitting.acer.NonlinearFit
-
public class NonlinearFit extends Object
Fit log-ACER function by sequential quadratic programming (SQP) minimization (of weighted RSS), usingLinearFit
'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 Description static class
NonlinearFit.Result
-
Constructor Summary
Constructors Constructor Description NonlinearFit()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
-
-
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 estimatestailMarker
- 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 levelsepsilon
- the ACER valuesconfWidth
- the confidence interval half-widths for the ACER valuespeakMean
- 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 levelsepsilon
- 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 leveltailMarker
- 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 valuesconfint
- the confidence interval half-width- Returns:
- the computed weights
-
computeWeightedRSS
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 functionbarrierLevels
- the barrier levelsepsilons
- the (positive) empirical epsilons for the corresponding barrier levelsweights
- the weights for the corresponding epsilon- Returns:
- the computed weighted RSS
-
-