Performs a factorising fit on a correlation matrix
matrixfit(cf, t1, t2, parlist, sym.vec, neg.vec, useCov = FALSE,
model = "single", boot.fit = TRUE, fit.method = "optim",
autoproceed = FALSE, every)
correlation matrix obtained with a call to extrac.obs
.
lower bound for the fitrange in time (t1,t2). Counting starts with 0.
upper bound for the fitrange in time (t1,t2). Counting starts with 0.
a two dimensional array of dimension 2 times number of correlators in cf. Every column assigns a pair of fit parameters to the corresponding correlator in cf. In case this is missing there are defaults provided for certain matrix sizes.
a vector of length number of correlators in cf indicating
whether the correlation function is a cosh, a sinh or an exponential.
Possible values are "cosh"
, "sinh"
and "exp"
. In case
this is missing there are defaults provided for certain matrix sizes.
a vector of length number of correlators in cf indicating whether the correlation function is to be multiplied globally with a minus sign. In case this is missing there are defaults provided for certain matrix sizes.
use correlated or uncorrelated chisquare. Default is
useCov=FALSE
.
Sets the fit model to be used in the fit. The default model
is \(0.5 p_i p_j (\exp(-Et) \pm c* \exp(-E(Time-t)))\) with sign
depending on "cosh"
or "sinh"
. c equals one except for the
"exp"
functional dependence. When model is set to "shifted"
,
the fit uses the function \(p_i p_j (\exp(-E(t+1/2)) \mp c*
\exp(-E(Time-(t+1/2))))\) which is useful when the original correlation
function or matrix is shifted, see e.g. bootstrap.gevp. In case
only a single principal correlator from a GEVP is to be fitted the
additional model "pc"
is available. It implements
\(\exp(-E(t-t_0))(A + (1-A)\exp(-DeltaE(t-t_0))\) with \(t_0\) the
reference timesclice of the GEVP. See bootstrap.gevp for details.
If set to FALSE
, the fit is not bootstrapped, even if
the bootstrapping parameters have been set and the correlation function has
been bootstrapped. This is a useful time-saver if error information is not
strictly necessary. Of course, this affects the return values related to
the bootstrap, which are set to NA
.
Can be either "optim"
or "lm"
. The latter
works only if the library "minpack.lm"
can be loaded. Default and
fallback is "optim"
.
When the inversion of the variance-covariance matrix
fails, the default behaviour is to abort the fit. Setting this to
TRUE
means that the fit is instead continued with a diagonal inverse
of the variance-covariance matrix.
Fit only a part of the data points. Indices that are not
multiples of every
are skipped. If no value is provided, all points
are taken into account.
returns an object of class matrixfit
with entries:
object of class cf which contains the mean correlation functions
inverse variance-covariance matrix for weighted Chi squared minimization
squre root of M
.
indices in the parameter vector used for the different matrix combinations
vector of signs
vector of vector indices giving the columns of the correlation function arrays (CF above, say), which are contained in the fit range
return value of the minimization (see ?optim) on the original data.
Result of the chisqr fit on the original data.
t0
is a vector of length npar+1, where npar
the number of fit
parameters. The last value is the chisqr value.
Bootstrap
samples of the R
Chi squared minimizations of length(par)+1. t
has dimension \(R x (npar+1)\), where R
is the number of bootstrap
samples and npar
the number of fit parameters. The last column
corresponds to the chisquare values.
Bootstrap estimate of
standard error for all parameters. se
is a vector of length
npar
, where npar
the number of fit parameters.
whether covariances in the data were taken into account
inverse of covariance matrix or inverse variance weighted if useCov=FALSE
real number between 0 and 1 giving the "quality" of the fit
total Chi squared of the fit
fit degrees of freedom
integer size of the matrix which was fitted
object of type cf which contains, amongst other objects, cf$cf which is a concatenated array of raw correlation functions where each row is one of N observations and there are mSize*Time columns (see ?extract.obs)
number of bootstrap samples
block size for blocked bootstrap
beginning of fit range
end of fit range
array of parameter combinations for the matrix fit
vector of strings indicating the functional form of correlation functions which were fitted
RNG seed for bootstrap procedure
see input.
see input.
The GEVP reference time for the principal correlator model
The routine expects in cf$cf
a set of correlation functions. The
mapping of this linear construct to a matrix or a part of a matrix is
achieved via parlist
. The symmetry properties of the individual
correlation functions must be encoded in sym.vec
.
matrixfit
will fit to every correlator in cf$cf
a function
\(p_i p_j f(t)\). The indices \(i,j\) are determined from parlist
and \(f\) is either \(cosh\) or \(sinh\), depending on
sym.vec
.
The inverse covariance matrix is computed using a singular value decomposition. If the sample size N is too small, only sqrt(N) eigenvalues of the matrix are kept exactly, while all others are replaced by the mean of the rest. This helps to reduce instabilities induced by too small eigenvalues of the covariance matrix.
C. Michael, hep-lat/9412087hep-lat/9412087
# NOT RUN {
data(samplecf)
samplecf <- bootstrap.cf(cf=samplecf, boot.R=99, boot.l=2, seed=1442556)
fitres <- matrixfit(cf=samplecf, t1=16, t2=24, useCov=FALSE,
parlist=array(c(1,1), dim=c(2,1)),
sym.vec=c("cosh"), fit.method="lm")
summary(fitres)
plot(fitres)
# }
Run the code above in your browser using DataLab