Calculate model fit
chisqFit(resObserved, data, DstarM = FALSE, tt = NULL, formula = NULL)
either output from estObserved
or a matrix containing custom densities to calculate the fitness for.
A dataframe containing data.
Logical. Should the DstarM fit measure be calculated or the traditional fit measure?
time grid custom densities where calculated on. Should only be supplied if resOberved
is a matrix containing custom densities
Optional formula argument, for when columns names in the data are different from those used to obtain the results.
This function allows a user to manually calculate a chi-square goodness of fit measure for model densities. This is useful for comparing a traditional analysis and a D*M analysis. For completion, this function can also calculate a D*M fit measure. We do not recommend usage of the D*M measure. While the chi-square fit measure is identical to the value of the optimizer when fitting, the DstarM fit measure is not equal to that of a DstarM analysis. This is because this function calculates the DstarM fit measure on the complete distribution, not on the model distributions, as is done during the optimization.