fit.cosh: Fits a sum of several 'cosh'-functions

View source: R/cosh_nlsfit.R

fit.coshR Documentation

Fits a sum of several cosh-functions

Description

Performs a correlated fit of a sum of several cosh-functions ∑_i a_i \cosh(m_i t) to data generated with bootstrap.effectivemass. Requires the same input and produces analogous output as fit.effectivemass. The fit itself is performed by bootstrap.nlsfit.

Usage

fit.cosh(effMass, cf, t1, t2, useCov = FALSE, m.init, par, n.cosh = 2,
  adjust.n.cosh = FALSE, every, ...)

Arguments

effMass

An object of class effectivemass generated by a call to bootstrap.effectivemass. Either effMass or cf has to be provided, but not both!

cf

An object of class cf_boot generated by a call to bootstrap.cf. Either cf or effMass has to be provided, but not both!

t1

The fit range. If several correlators are fitted, this is automatically replicated accordingly. The fit range is adjusted such that NAs are removed from the fit. They must fulfill t1<t2. For symmetric correlators, they must both run from 0 to T/2-1, otherwise from 0 to T-1.

t2

see t1

useCov

Use the correlated chisquare. This works only for not too noisy data.

m.init

Initial guess of the effective mass, i.e. the smallest m_i.

par

Array of length 2*n.cosh with initial guesses for the effective masses in the first n.cosh entries and initial guesses for the amplitudes in the last n.cosh entries.

n.cosh

Number of cosh-functions summed over.

adjust.n.cosh

Only relevant, if n.cosh=2. If set to TRUE, n.cosh can be adjusted to n.cosh=1 automatically in case the excited state cannot be resolved.

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.

...

Additional parameters passed to the fit function. But the fit function is fixed and does not accept any arguments, so it will just crash. Therefore, don't use this!

Value

An object with class coshfit is returned. It contains all the data of the input object effMass or the cf object as a member. The following member objects are added:

t0: the object returned by the optim on the original data. The format is as in par.

t: the bootstrap values of the results.

se: errors calculated via bootstrap on the results.

ii: the index array of data used in the fit.

invCovMatrix: the inverse covariance matrix.

dof: the degrees of freedom of the fit.

chisqr: Chi squared value of the fit.

Qval: p-value of the fit.

Author(s)

Johann Ostmeyer, ostmeyer@hiskp.uni-bonn.de

See Also

bootstrap.effectivemass, bootstrap.gevp, invertCovMatrix, bootstrap.nlsfit, fit.effectivemass

Examples


data(samplecf)
samplecf <- bootstrap.cf(cf=samplecf, boot.R=99, boot.l=2, seed=1442556)
effmass <- fit.cosh(bootstrap.effectivemass(cf=samplecf), t1=15, t2=23)
summary(effmass)
plot(effmass, ylim=c(0.14,0.15))

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