Package de.gsi.math.fitter
Class NonLinearRegressionFitter2
- java.lang.Object
-
- de.gsi.math.fitter.NonLinearRegressionFitter2
-
@Deprecated public class NonLinearRegressionFitter2 extends java.lang.Object
Deprecated.need to fix the n-dimensional handling - do not use (yet)Non-linear regression class Nelder & Mead simplex algorithm being the primary back-bone of this implementation initial implementation based on the package provided by: Michael Thomas Flanagan at www.ee.ucl.ac.uk/~mflanaga, appears in all copies The code has been cleaned up and adapted to support true MxN multi-dimensional fits- Author:
- rstein
-
-
Field Summary
Fields Modifier and Type Field Description protected double[]
best
Deprecated.protected double[]
bestSd
Deprecated.protected double
cCoeff
Deprecated.protected double
chiSquare
Deprecated.protected int
constraintMethod
Deprecated.protected double[]
constraints
Deprecated.protected double
constraintTolerance
Deprecated.protected double[][]
corrCoeff
Deprecated.protected double[][]
covar
Deprecated.protected int
degreesOfFreedom
Deprecated.protected double
delta
Deprecated.protected double
dStep
Deprecated.protected double
eCoeff
Deprecated.protected boolean[]
fixed
Deprecated.protected double
fMin
Deprecated.protected double[]
fscale
Deprecated.protected double
fTol
Deprecated.protected double[][]
grad
Deprecated.protected static double
histTol
Deprecated.protected boolean
ignoreDofFcheck
Deprecated.protected boolean
invertFlag
Deprecated.protected int
konvge
Deprecated.protected int
kRestart
Deprecated.protected double
lastSSnoConstraint
Deprecated.protected boolean
linNonLin
Deprecated.protected int
maxConstraintIndex
Deprecated.protected int
minTest
Deprecated.protected boolean
multipleY
Deprecated.protected int
nConstraints
Deprecated.protected int
nData
Deprecated.protected boolean
nFactorOption
Deprecated.protected int
nIter
Deprecated.protected boolean
nlrStatus
Deprecated.protected int
nMax
Deprecated.protected int
nSumConstraints
Deprecated.protected int
nTerms
Deprecated.protected int
nYarrays
Deprecated.protected java.util.ArrayList<java.lang.Object>
penalties
Deprecated.protected boolean
penalty
Deprecated.protected int[]
penaltyCheck
Deprecated.protected int[]
penaltyParam
Deprecated.protected double
penaltyWeight
Deprecated.protected boolean
posVarFlag
Deprecated.protected double[]
pseudoSd
Deprecated.protected double[]
pValues
Deprecated.protected double
rCoeff
Deprecated.protected double
reducedChiSquare
Deprecated.protected VoxelArrayND
residual
Deprecated.protected VoxelArrayND
residualW
Deprecated.protected int
scaleOpt
Deprecated.protected double
simplexSd
Deprecated.protected double[]
startH
Deprecated.protected boolean
statFlag
Deprecated.protected double[]
step
Deprecated.protected double[]
sumConstraints
Deprecated.protected double
sumOfSquares
Deprecated.protected java.util.ArrayList<java.lang.Object>
sumPenalties
Deprecated.protected boolean
sumPenalty
Deprecated.protected int[]
sumPenaltyCheck
Deprecated.protected int[]
sumPenaltyNumber
Deprecated.protected int[][]
sumPenaltyParam
Deprecated.protected double[][]
sumPlusOrMinus
Deprecated.protected boolean
trueFreq
Deprecated.protected double[]
tValues
Deprecated.protected double[]
values
Deprecated.protected VoxelArrayND
weight
Deprecated.protected int
weightFlag
Deprecated.protected boolean
weightOpt
Deprecated.protected VoxelArrayND
xData
Deprecated.protected VoxelArrayND
yCalc
Deprecated.protected VoxelArrayND
yData
Deprecated.protected boolean
zeroCheck
Deprecated.
-
Constructor Summary
Constructors Constructor Description NonLinearRegressionFitter2(double[] xData, double[] yData, double[] weight)
Deprecated.Constructor with data with x as 1D array and weights providedNonLinearRegressionFitter2(VoxelArrayND xData, VoxelArrayND yData, VoxelArrayND weights)
Deprecated.Constructor with data with x as 1D array and weights provided
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addConstraint(int[] paramIndices, double[] plusOrMinus, int conDir, double constraint)
Deprecated.void
addConstraint(int[] paramIndices, int[] plusOrMinus, int conDir, double constraint)
Deprecated.void
addConstraint(int paramIndex, int conDir, double constraint)
Deprecated.protected VoxelArrayND
checkForZeroWeights(VoxelArrayND weights)
Deprecated.Check entered weights for zeros.void
checkZeroNeg(double[] xx, double[] yy, double[] ww)
Deprecated.double[]
getBestEstimates()
Deprecated.double[]
getBestEstimatesErrors()
Deprecated.double[]
getbestestimatesStandardDeviations()
Deprecated.double[]
getBestEstimatesStandardDeviations()
Deprecated.double
getChiSquare()
Deprecated.double
getchiSquareProb()
Deprecated.double[]
getCoeff()
Deprecated.double[]
getCoeffSd()
Deprecated.double[]
getCoeffVar()
Deprecated.double[][]
getCorrCoeffMatrix()
Deprecated.double[][]
getCovMatrix()
Deprecated.double
getDegFree()
Deprecated.double
getDelta()
Deprecated.double[][]
getGrad()
Deprecated.boolean
getInversionCheck()
Deprecated.int
getMinTest()
Deprecated.int
getNiter()
Deprecated.boolean
getNlrStatus()
Deprecated.int
getNmax()
Deprecated.double
getNMcontract()
Deprecated.double
getNMextend()
Deprecated.double
getNMreflect()
Deprecated.int
getNrestarts()
Deprecated.int
getNrestartsMax()
Deprecated.boolean
getPosVarCheck()
Deprecated.double[]
getPseudoErrors()
Deprecated.double[]
getPseudoSd()
Deprecated.double[]
getPvalues()
Deprecated.double
getReducedChiSquare()
Deprecated.double[]
getResiduals()
Deprecated.double[]
getScale()
Deprecated.double
getSimplexSd()
Deprecated.double
getSumOfSquares()
Deprecated.double
getTolerance()
Deprecated.boolean
getTrueFreq()
Deprecated.double[]
getTvalues()
Deprecated.double[]
getWeightedResiduals()
Deprecated.double[]
getXdata()
Deprecated.Get the input x valuesdouble[]
getYcalc()
Deprecated.double[]
getYdata()
Deprecated.Get the inputed y valuesprotected static double
halfWidth(double[] xData, double[] yData)
Deprecated.static double[][]
histogramBins(double[] data, double binWidth, double binZero)
Deprecated.static double[][]
histogramBins(double[] data, double binWidth, double binZero, double binUpper)
Deprecated.void
ignoreDofFcheck()
Deprecated.protected void
nelderMead(java.lang.Object regFun, double[] start, double[] step, double fTol, int nMax)
Deprecated.Nelder and Mead Simplex Simplex Non-linear Regressionprotected int
pseudoLinearStats(java.lang.Object regFun)
Deprecated.apply linear statistics to a non-linear regressionvoid
removeConstraints()
Deprecated.void
setConstraintTolerance(double tolerance)
Deprecated.void
setData(double[] xData, double[] yData, double[] weights)
Deprecated.void
setData(VoxelArrayND xData, VoxelArrayND yData, VoxelArrayND weights)
Deprecated.void
setDelta(double delta)
Deprecated.void
setMinTest(int n)
Deprecated.void
setNmax(int nmax)
Deprecated.void
setNMcontract(double con)
Deprecated.void
setNMextend(double ext)
Deprecated.void
setNMreflect(double refl)
Deprecated.void
setNrestartsMax(int nrs)
Deprecated.void
setScale(double[] sc)
Deprecated.void
setScale(int n)
Deprecated.void
setTolerance(double tol)
Deprecated.void
setTrueFreq(boolean trFr)
Deprecated.protected static boolean
setTrueFreqWeights(VoxelArrayND yData, VoxelArrayND weight)
Deprecated.void
simplex(Function1D g, double[] start)
Deprecated.void
simplex(Function1D g, double[] start, double fTol)
Deprecated.void
simplex(Function1D g, double[] start, double[] step)
Deprecated.void
simplex(Function1D g, double[] start, double[] step, double fTol)
Deprecated.void
simplex(Function1D g, double[] start, double[] step, double fTol, int nMax)
Deprecated.void
simplex(Function1D g, double[] start, double[] step, int nMax)
Deprecated.void
simplex(Function1D g, double[] start, double fTol, int nMax)
Deprecated.void
simplex(Function1D g, double[] start, int nMax)
Deprecated.void
simplex2(FunctionND g, double[] start)
Deprecated.void
simplex2(FunctionND g, double[] start, double fTol)
Deprecated.void
simplex2(FunctionND g, double[] start, double[] step)
Deprecated.void
simplex2(FunctionND g, double[] start, double[] step, double fTol)
Deprecated.void
simplex2(FunctionND g, double[] start, double[] step, double fTol, int nMax)
Deprecated.void
simplex2(FunctionND g, double[] start, double[] step, int nMax)
Deprecated.void
simplex2(FunctionND g, double[] start, double fTol, int nMax)
Deprecated.void
simplex2(FunctionND g, double[] start, int nMax)
Deprecated.protected static void
sort(double[] x, double[] y, double[] w)
Deprecated.protected double
sumSquares(java.lang.Object regFun, double[] testParameter)
Deprecated.Calculate the sum of squares of the residuals for non-linear regression
-
-
-
Field Detail
-
histTol
protected static double histTol
Deprecated.
-
nData
protected int nData
Deprecated.
-
nYarrays
protected int nYarrays
Deprecated.
-
nTerms
protected int nTerms
Deprecated.
-
degreesOfFreedom
protected int degreesOfFreedom
Deprecated.
-
xData
protected VoxelArrayND xData
Deprecated.
-
yData
protected VoxelArrayND yData
Deprecated.
-
yCalc
protected VoxelArrayND yCalc
Deprecated.
-
weight
protected VoxelArrayND weight
Deprecated.
-
residual
protected VoxelArrayND residual
Deprecated.
-
residualW
protected VoxelArrayND residualW
Deprecated.
-
weightOpt
protected boolean weightOpt
Deprecated.
-
weightFlag
protected int weightFlag
Deprecated.
-
best
protected double[] best
Deprecated.
-
bestSd
protected double[] bestSd
Deprecated.
-
pseudoSd
protected double[] pseudoSd
Deprecated.
-
tValues
protected double[] tValues
Deprecated.
-
pValues
protected double[] pValues
Deprecated.
-
chiSquare
protected double chiSquare
Deprecated.
-
reducedChiSquare
protected double reducedChiSquare
Deprecated.
-
sumOfSquares
protected double sumOfSquares
Deprecated.
-
lastSSnoConstraint
protected double lastSSnoConstraint
Deprecated.
-
covar
protected double[][] covar
Deprecated.
-
corrCoeff
protected double[][] corrCoeff
Deprecated.
-
linNonLin
protected boolean linNonLin
Deprecated.
-
trueFreq
protected boolean trueFreq
Deprecated.
-
nlrStatus
protected boolean nlrStatus
Deprecated.
-
scaleOpt
protected int scaleOpt
Deprecated.
-
fscale
protected double[] fscale
Deprecated.
-
zeroCheck
protected boolean zeroCheck
Deprecated.
-
penalty
protected boolean penalty
Deprecated.
-
sumPenalty
protected boolean sumPenalty
Deprecated.
-
nConstraints
protected int nConstraints
Deprecated.
-
nSumConstraints
protected int nSumConstraints
Deprecated.
-
maxConstraintIndex
protected int maxConstraintIndex
Deprecated.
-
constraintTolerance
protected double constraintTolerance
Deprecated.
-
penalties
protected java.util.ArrayList<java.lang.Object> penalties
Deprecated.
-
sumPenalties
protected java.util.ArrayList<java.lang.Object> sumPenalties
Deprecated.
-
penaltyCheck
protected int[] penaltyCheck
Deprecated.
-
sumPenaltyCheck
protected int[] sumPenaltyCheck
Deprecated.
-
penaltyWeight
protected double penaltyWeight
Deprecated.
-
penaltyParam
protected int[] penaltyParam
Deprecated.
-
sumPenaltyParam
protected int[][] sumPenaltyParam
Deprecated.
-
sumPlusOrMinus
protected double[][] sumPlusOrMinus
Deprecated.
-
sumPenaltyNumber
protected int[] sumPenaltyNumber
Deprecated.
-
constraints
protected double[] constraints
Deprecated.
-
sumConstraints
protected double[] sumConstraints
Deprecated.
-
constraintMethod
protected int constraintMethod
Deprecated.
-
nMax
protected int nMax
Deprecated.
-
nIter
protected int nIter
Deprecated.
-
konvge
protected int konvge
Deprecated.
-
kRestart
protected int kRestart
Deprecated.
-
fMin
protected double fMin
Deprecated.
-
fTol
protected double fTol
Deprecated.
-
rCoeff
protected double rCoeff
Deprecated.
-
eCoeff
protected double eCoeff
Deprecated.
-
cCoeff
protected double cCoeff
Deprecated.
-
startH
protected double[] startH
Deprecated.
-
step
protected double[] step
Deprecated.
-
dStep
protected double dStep
Deprecated.
-
grad
protected double[][] grad
Deprecated.
-
delta
protected double delta
Deprecated.
-
invertFlag
protected boolean invertFlag
Deprecated.
-
posVarFlag
protected boolean posVarFlag
Deprecated.
-
minTest
protected int minTest
Deprecated.
-
simplexSd
protected double simplexSd
Deprecated.
-
statFlag
protected boolean statFlag
Deprecated.
-
multipleY
protected boolean multipleY
Deprecated.
-
values
protected double[] values
Deprecated.
-
fixed
protected boolean[] fixed
Deprecated.
-
ignoreDofFcheck
protected boolean ignoreDofFcheck
Deprecated.
-
nFactorOption
protected boolean nFactorOption
Deprecated.
-
-
Constructor Detail
-
NonLinearRegressionFitter2
public NonLinearRegressionFitter2(double[] xData, double[] yData, double[] weight)
Deprecated.Constructor with data with x as 1D array and weights provided- Parameters:
xData
- x coordinate of input datayData
- y coordinate of input dataweight
- weighting vector
-
NonLinearRegressionFitter2
public NonLinearRegressionFitter2(VoxelArrayND xData, VoxelArrayND yData, VoxelArrayND weights)
Deprecated.Constructor with data with x as 1D array and weights provided- Parameters:
xData
- x coordinate of input datayData
- y coordinate of input dataweights
- weighting vector
-
-
Method Detail
-
addConstraint
public void addConstraint(int paramIndex, int conDir, double constraint)
Deprecated.
-
addConstraint
public void addConstraint(int[] paramIndices, double[] plusOrMinus, int conDir, double constraint)
Deprecated.
-
addConstraint
public void addConstraint(int[] paramIndices, int[] plusOrMinus, int conDir, double constraint)
Deprecated.
-
checkForZeroWeights
protected VoxelArrayND checkForZeroWeights(VoxelArrayND weights)
Deprecated.Check entered weights for zeros. If more than 40% are zero or less than zero, all weights replaced by unity If less than 40% are zero or less than zero, the zero or negative weights are replaced by the average of their nearest neighbours- Parameters:
weights
- weighting vector- Returns:
- the regularised weight vector
-
checkZeroNeg
public void checkZeroNeg(double[] xx, double[] yy, double[] ww)
Deprecated.
-
getBestEstimates
public double[] getBestEstimates()
Deprecated.
-
getBestEstimatesErrors
public double[] getBestEstimatesErrors()
Deprecated.
-
getbestestimatesStandardDeviations
public double[] getbestestimatesStandardDeviations()
Deprecated.
-
getBestEstimatesStandardDeviations
public double[] getBestEstimatesStandardDeviations()
Deprecated.
-
getChiSquare
public double getChiSquare()
Deprecated.
-
getchiSquareProb
public double getchiSquareProb()
Deprecated.
-
getCoeff
public double[] getCoeff()
Deprecated.
-
getCoeffSd
public double[] getCoeffSd()
Deprecated.
-
getCoeffVar
public double[] getCoeffVar()
Deprecated.
-
getCorrCoeffMatrix
public double[][] getCorrCoeffMatrix()
Deprecated.
-
getCovMatrix
public double[][] getCovMatrix()
Deprecated.
-
getDegFree
public double getDegFree()
Deprecated.
-
getDelta
public double getDelta()
Deprecated.
-
getGrad
public double[][] getGrad()
Deprecated.
-
getInversionCheck
public boolean getInversionCheck()
Deprecated.
-
getMinTest
public int getMinTest()
Deprecated.
-
getNiter
public int getNiter()
Deprecated.
-
getNlrStatus
public boolean getNlrStatus()
Deprecated.
-
getNmax
public int getNmax()
Deprecated.
-
getNMcontract
public double getNMcontract()
Deprecated.
-
getNMextend
public double getNMextend()
Deprecated.
-
getNMreflect
public double getNMreflect()
Deprecated.
-
getNrestarts
public int getNrestarts()
Deprecated.
-
getNrestartsMax
public int getNrestartsMax()
Deprecated.
-
getPosVarCheck
public boolean getPosVarCheck()
Deprecated.
-
getPseudoErrors
public double[] getPseudoErrors()
Deprecated.
-
getPseudoSd
public double[] getPseudoSd()
Deprecated.
-
getPvalues
public double[] getPvalues()
Deprecated.
-
getReducedChiSquare
public double getReducedChiSquare()
Deprecated.
-
getResiduals
public double[] getResiduals()
Deprecated.
-
getScale
public double[] getScale()
Deprecated.
-
getSimplexSd
public double getSimplexSd()
Deprecated.
-
getSumOfSquares
public double getSumOfSquares()
Deprecated.
-
getTolerance
public double getTolerance()
Deprecated.
-
getTrueFreq
public boolean getTrueFreq()
Deprecated.
-
getTvalues
public double[] getTvalues()
Deprecated.
-
getWeightedResiduals
public double[] getWeightedResiduals()
Deprecated.
-
getXdata
public double[] getXdata()
Deprecated.Get the input x values- Returns:
- array with x coordinates
-
getYcalc
public double[] getYcalc()
Deprecated.
-
getYdata
public double[] getYdata()
Deprecated.Get the inputed y values- Returns:
- array with input y coordinates
-
ignoreDofFcheck
public void ignoreDofFcheck()
Deprecated.
-
nelderMead
protected void nelderMead(java.lang.Object regFun, double[] start, double[] step, double fTol, int nMax)
Deprecated.Nelder and Mead Simplex Simplex Non-linear Regression- Parameters:
regFun
- test functionstart
- initial parameter valuesstep
- initial parameter step sizefTol
- regression tolerancenMax
- maximum number of iterations
-
pseudoLinearStats
protected int pseudoLinearStats(java.lang.Object regFun)
Deprecated.apply linear statistics to a non-linear regression- Parameters:
regFun
- test function- Returns:
- 0 if method fully successful; -1 posVarFlag or invertFlag is false; -2 posVarFlag and invertFlag are false
-
removeConstraints
public void removeConstraints()
Deprecated.
-
setConstraintTolerance
public void setConstraintTolerance(double tolerance)
Deprecated.
-
setData
public void setData(double[] xData, double[] yData, double[] weights)
Deprecated.
-
setData
public void setData(VoxelArrayND xData, VoxelArrayND yData, VoxelArrayND weights)
Deprecated.
-
setDelta
public void setDelta(double delta)
Deprecated.
-
setMinTest
public void setMinTest(int n)
Deprecated.
-
setNmax
public void setNmax(int nmax)
Deprecated.
-
setNMcontract
public void setNMcontract(double con)
Deprecated.
-
setNMextend
public void setNMextend(double ext)
Deprecated.
-
setNMreflect
public void setNMreflect(double refl)
Deprecated.
-
setNrestartsMax
public void setNrestartsMax(int nrs)
Deprecated.
-
setScale
public void setScale(double[] sc)
Deprecated.
-
setScale
public void setScale(int n)
Deprecated.
-
setTolerance
public void setTolerance(double tol)
Deprecated.
-
setTrueFreq
public void setTrueFreq(boolean trFr)
Deprecated.
-
simplex
public void simplex(Function1D g, double[] start)
Deprecated.
-
simplex
public void simplex(Function1D g, double[] start, double fTol)
Deprecated.
-
simplex
public void simplex(Function1D g, double[] start, double fTol, int nMax)
Deprecated.
-
simplex
public void simplex(Function1D g, double[] start, double[] step)
Deprecated.
-
simplex
public void simplex(Function1D g, double[] start, double[] step, double fTol)
Deprecated.
-
simplex
public void simplex(Function1D g, double[] start, double[] step, double fTol, int nMax)
Deprecated.
-
simplex
public void simplex(Function1D g, double[] start, double[] step, int nMax)
Deprecated.
-
simplex
public void simplex(Function1D g, double[] start, int nMax)
Deprecated.
-
simplex2
public void simplex2(FunctionND g, double[] start)
Deprecated.
-
simplex2
public void simplex2(FunctionND g, double[] start, double fTol)
Deprecated.
-
simplex2
public void simplex2(FunctionND g, double[] start, double fTol, int nMax)
Deprecated.
-
simplex2
public void simplex2(FunctionND g, double[] start, double[] step)
Deprecated.
-
simplex2
public void simplex2(FunctionND g, double[] start, double[] step, double fTol)
Deprecated.
-
simplex2
public void simplex2(FunctionND g, double[] start, double[] step, double fTol, int nMax)
Deprecated.
-
simplex2
public void simplex2(FunctionND g, double[] start, double[] step, int nMax)
Deprecated.
-
simplex2
public void simplex2(FunctionND g, double[] start, int nMax)
Deprecated.
-
sumSquares
protected double sumSquares(java.lang.Object regFun, double[] testParameter)
Deprecated.Calculate the sum of squares of the residuals for non-linear regression- Parameters:
regFun
- test functiontestParameter
- test parameter- Returns:
- the sum of all square values
-
halfWidth
protected static double halfWidth(double[] xData, double[] yData)
Deprecated.
-
histogramBins
public static double[][] histogramBins(double[] data, double binWidth, double binZero)
Deprecated.
-
histogramBins
public static double[][] histogramBins(double[] data, double binWidth, double binZero, double binUpper)
Deprecated.
-
setTrueFreqWeights
protected static boolean setTrueFreqWeights(VoxelArrayND yData, VoxelArrayND weight)
Deprecated.
-
sort
protected static void sort(double[] x, double[] y, double[] w)
Deprecated.
-
-