tfr.dl.coverage {bayesTFR} | R Documentation |
Goodness of Fit of the Double Logistic Function
Description
The function computes coverage, i.e. the ratio of observed data fitted within the given probability intervals of the predictive posterior distribution of the double logistic function, as well as the root mean square error and mean absolute error of the simulation.
Usage
tfr.dl.coverage(sim.dir, pi = c(80, 90, 95), burnin = 2000, verbose = TRUE)
Arguments
sim.dir |
Directory with the MCMC simulation results. If a prediction and its corresponding thinned MCMCs are available in the simulation directory, those are taken for assessing the goodness of fit. |
pi |
Probability interval. It can be a single number or an array. |
burnin |
Burnin. Only relevant if |
verbose |
Logical switching log messages on and off. |
Value
List with the following components:
total.coverage |
Vector of the coverage, one element per probability interval. For each |
time.coverage |
Matrix corresponding to the coverage computed per time period. (Rows correspond to probability intervals, columns correspond to time.) It is derived like |
country.coverage |
Matrix corresponding to the coverage computed per country. (Rows correspond to probability intervals, columns correspond to countries.) It is derived like |
total.rmse |
Root mean square error as |
time.rmse |
Like |
country.rmse |
Like |
total.mae |
Mean absolute error as |
time.mae |
Like |
country.mae |
Like |
pred.cdf |
|
n |
0-1 |
Note
To see the fit visually per country, use DLcurve.plot(..., predictive.distr=TRUE,...)
.
Author(s)
Hana Sevcikova
See Also
Examples
## Not run:
sim.dir <- file.path(find.package("bayesTFR"), "ex-data", "bayesTFR.output")
tfr <- get.tfr.mcmc(sim.dir)
# Note that this simulation is a toy example and thus has not converged.
gof <- tfr.dl.coverage(sim.dir)
gof$time.coverage
DLcurve.plot(tfr, country=608, predictive.distr=TRUE, pi=c(80, 90, 95))
## End(Not run)