npsi::MinuitSemiparametricFitFcn1D< Numeric, DensityConstructor, NumIn > Class Template Reference
Inheritance diagram for npsi::MinuitSemiparametricFitFcn1D< Numeric, DensityConstructor, NumIn >:
Detailed Descriptiontemplate<typename Numeric, class DensityConstructor, typename NumIn = double>
|
|
inline |
The constructor arguments are as follows:
histo – Naturally, the histogram to fit. It is assumed that the histogram bins are not scaled and contain the actual unweighted event counts.
densityMaker – This object will generate AbsDistribution1D objects for the signal model from the vector of signal parameters.
fb – "Filter builder". This object will generate local polynomial filters using densities from the symmetric beta family as weights. A reference implementation of such a class is provided with the NPStat software: "SimpleSymbetaFilterProvider". It may be possible to construct more efficient implementations which will reuse filters constructed for different bandwidth values.
bm – Method for handling LOrPE weight function at the boundaries of density support region.
symmetricBetaPower – This parameter determines the choice of the kernel. If it is negative, Gaussian kernel will be used, truncated at +- 12 sigma. If it is positive or 0, the kernel from the symmetric beta family will be used, proportional to (1 - x^2)^symmetricBetaPower. In my experience, most useful values of this parameter are -1 and 4.
minimumBgFeatureSize – Minimum feature size (like sigma of the Gaussian) of the background distribution that the nonparametric component of the fit should attempt to represent in full detail. Together with other things such as the number of events, this parameter will affect the smallest LOrPE bandwidth considered in the fit.
initialApproximation – Initial approximation for the background density (one array element per input histogram bin). Can be specified as NULL in which case the uniform density will be used as the initial approximation.
lenApproximation – Length of the initial approximation array. If not 0 (and if initialApproximation is not NULL), the code will verify that it equals the number of histogram bins.
polyDegreeLimit – The maximum polynomial degree to consider during cross validation (will be used as a limiting value of the corresponding MIGRAD parameter). Due to the round-off errors in calculating orthogonal polynomials, this number should not exceed 20 or so. The default value of -1 (and any other negative number) means that a reasonable limit estimate will be made automatically.
verbose – If "true", some info will be printed on the standard output while the fit is in progress.
cvmode – Mode for cross validation calculations. See comments to the "lorpeBackground1D" function for more detail on the meaning of this argument.
useLeastSquaresCV – "true" means use least squares cross validation. "false" means use pseudo likelihood.
refitBandwidth – If "true", the code will refit the bandwidth of the background model by cross validation for every value of signal parameters. In this case the user should fix the bandwidth parameter in the fit (it will be used as the initial guess only).
refitPolyDegree – If "true", the code will refit the polynomial degree of the background model by cross validation for every value of signal parameters. In this case the user should fix the polynomial degree parameter in the fit (it will be used as the initial guess only).
regularizationParameter – If this parameter is non-negative, the code will attempt to figure out the minimum reasonable value of the density estimate in cases that density is estimated to be zero at some point where data is present. This minimum density will be inversely proportional to pow(N, regularizationParameter). This will be applied during the likelihood calculation and in cross validation (limited to pseudo-likelihood CV, not done for least squares CV).
nIntegrationPoints – How many points to use in order to integrate the parametric signal density across each histogram bin. If this argument is specified as 0 then the difference of cumulative densities at the bin edges will be used, otherwise Gauss-Legendre quadrature will be employed (so that the number of points must be either 1 or one of the numbers supported by the "GaussLegendreQuadrature" class). For properly implemented densities, 0 should be the best option.
bandwidthUpperLimitFactor – This parameter determines the maximum kernel bandwidth which will be considered during cross validation. For Gaussian kernels, the maximum sigma will be set to the width of the histogram times this factor. For other kernels the maximum width will be adjusted accordingly (technically, the additional adjustment factor is determined by the "canonical bandwidth" ratio evaluated for the initial degree of the model polynomial).
pseudoFitCycles – Sometimes, when the initial guess of the bandwidth and polynomial degree is far away from optimal, Minuit has problems navigating towards the minimum in this 2-d space (the "narrow valley" problem). In this case it may be helful to make a number of steps at the beginning optimizing each variable in turn while keeping the other variable fixed. This parameter determines how many pairs of such initial steps to make during cross validation.
convergenceEpsilon – The background density is refitted iteratively by the relevant algorithm until convergence is achieved. The convergence criterion is that the L1 distance between the background distributions obtained in two successive iterations is less than this number. Must be non-negative. A reasonable value will be selected automatically in case default value of 0.0 is given.
pseudoFitPrecision – The Minuit working precision for maximizing the cross validation pseudo likelihood. Should be higher than the convergenceEpsilon by about an order of magnitude or so. Note that you will need to adjust precision of this fit as well. A reasonable value of "pseudoFitPrecision" will be selected automatically in case default value of 0.0 is given.
bandwidthScanPoints – If Minuit fails to optimize the quantity used in cross validation, the optimum will be found by simply scanning the bandwidth and the polynomial degree. This parameter determines the number of bandwidth points to scan.
minlog – This parameter limits the contribution of non-empty histogram bins into the log-likelihood in case the density was estimated to be 0 for that bin.
up – The Minuit "up" parameter which affects the definition of uncertainties. See the Minuit manual for details.
upRefit – The "up" parameter to use in the cross validation step.
maxIterations – The hard limit on the number of iterations that can be used for background determination. If convergence is not achieved after this number of iterations, an exception will be thrown.
This class will not assume ownership of any references. However, an internal copy will be made of the "initialApproximation" array if this array is not NULL.
|
inline |
The number of bins for which the background density was actually adjusted during the most recent run
|
inlinevirtual |
This method returns the negative log likelihood.
Parameters must be given in a specific order:
x[0] – Value of the LOrPE bandwidth. Should be fixed in the fit if "refitBandwidth" was set "true" in the constructor.
x[1] – Degree of the LOrPE polynomial. Should be fixed in the fit if "refitPolyDegree" was set "true" in the constructor.
x[2] – Signal fraction. Can be either fixed or fitted.
x[3...] – These parameters will be passed to the density maker for building the signal density.