matrixfit: Routine For A Factorising Matrix Fit

View source: R/matrixfit.R

matrixfitR Documentation

Routine For A Factorising Matrix Fit

Description

Performs a factorising fit on a correlation matrix

Usage

matrixfit(cf, t1, t2, parlist, sym.vec, neg.vec, useCov = FALSE,
  model = "single", boot.fit = TRUE, fit.method = "optim",
  autoproceed = FALSE, every)

Arguments

cf

correlation matrix obtained with a call to extrac.obs.

t1

lower bound for the fitrange in time (t1,t2). Counting starts with 0.

t2

upper bound for the fitrange in time (t1,t2). Counting starts with 0.

parlist

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.

sym.vec

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.

neg.vec

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.

useCov

use correlated or uncorrelated chisquare. Default is useCov=FALSE.

model

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.

boot.fit

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.

fit.method

Can be either "optim" or "lm". The latter works only if the library "minpack.lm" can be loaded. Default and fallback is "optim".

autoproceed

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.

every

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.

Details

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.

Value

returns an object of class matrixfit with entries:

CF

object of class cf which contains the mean correlation functions

M

inverse variance-covariance matrix for weighted Chi squared minimization

L

squre root of M.

parind

indices in the parameter vector used for the different matrix combinations

sign.vec

vector of signs

ii

vector of vector indices giving the columns of the correlation function arrays (CF above, say), which are contained in the fit range

opt.res

return value of the minimization (see ?optim) on the original data.

t0

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.

t

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.

se

Bootstrap estimate of standard error for all parameters. se is a vector of length npar, where npar the number of fit parameters.

useCov

whether covariances in the data were taken into account

invCovMatrix

inverse of covariance matrix or inverse variance weighted if useCov=FALSE

Qval

real number between 0 and 1 giving the "quality" of the fit

chisqr

total Chi squared of the fit

dof

fit degrees of freedom

mSize

integer size of the matrix which was fitted

cf

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)

boot.R

number of bootstrap samples

boot.l

block size for blocked bootstrap

t1

beginning of fit range

t2

end of fit range

parlist

array of parameter combinations for the matrix fit

sym.vec

vector of strings indicating the functional form of correlation functions which were fitted

seed

RNG seed for bootstrap procedure

model

see input.

fit.method

see input.

reference_time

The GEVP reference time for the principal correlator model

Author(s)

Carsten Urbach, curbach@gmx.de

References

C. Michael, hep-lat/9412087hep-lat/9412087

See Also

cf, bootstrap.cf

Examples


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)


hadron documentation built on Sept. 9, 2022, 5:06 p.m.