| Type: | Package |
| Title: | Bayesian Parameter Estimation and Forecasting for Epidemiological Models |
| Version: | 1.1.0 |
| Description: | Methods for Bayesian parameter estimation and forecasting in epidemiological models. Functions enable model fitting using Bayesian methods and generate forecasts with uncertainty quantification. Implements approaches described in <doi:10.48550/arXiv.2411.05371> and <doi:10.1002/sim.9164>. |
| License: | CC0 |
| Encoding: | UTF-8 |
| Imports: | bayesplot, readxl, xlsx, loo, openxlsx, rstan, ggplot2, stringr, gridExtra, dplyr |
| Depends: | R (≥ 3.5.0) |
| URL: | https://github.com/gchowell/BayesianFitForecast |
| BugReports: | https://github.com/gchowell/BayesianFitForecast/issues |
| RoxygenNote: | 7.3.2 |
| Suggests: | knitr, rmarkdown, testthat (≥ 3.0.0) |
| VignetteBuilder: | knitr |
| Config/testthat/edition: | 3 |
| NeedsCompilation: | no |
| Packaged: | 2025-08-10 22:01:35 UTC; hamed |
| Author: | Hamed Karami [aut], Amanda Bleichrodt [aut], Ruiyan Luo [aut], Gerardo Chowell [aut, cre] |
| Maintainer: | Gerardo Chowell <gchowell@gsu.edu> |
| Repository: | CRAN |
| Date/Publication: | 2025-08-19 15:00:22 UTC |
Run MCMC Analysis with Specified Option File
Description
This function runs an MCMC analysis based on the specified option file, sourcing auxiliary scripts, and executing the analysis.
Usage
Run_MCMC(option_file, excel_file = NULL, output_path = NULL)
Arguments
option_file |
The name of the option file (e.g., "option1.R") located in the current working directory. |
excel_file |
The path to the Excel file containing the data. |
output_path |
Directory where the output will be saved. If 'NULL', uses a temporary directory. |
Value
None. The function executes and saves results directly.
Examples
# Get path to the example option file included with package
option_file <- system.file("extdata", "option.R",
package = "BayesianFitForecast")
# Specify the path to the Excel file you want to analyze
excel_file <- system.file("extdata", "SanFrancisco.xlsx",
package = "BayesianFitForecast") # Modify this path accordingly
# Run the MCMC analysis
Run_MCMC(option_file = option_file, excel_file = excel_file, output_path = NULL)
Run Analyze Results with Specified Data and Options
Description
This function performs an analysis based on the specified data file, option_file, Excel file, and it saves the results in the output_path. It loads auxiliary data, executes analysis steps, and saves the results.
Usage
Run_analyzeResults(
data_file_location,
option_file,
excel_file,
output_path = NULL
)
Arguments
data_file_location |
The location of the data file which is generated after 'Run_MCMC'. |
option_file |
The name of the option file (e.g., "option1.R") located in the current working directory. |
excel_file |
The path to an Excel file containing additional data. This parameter is required and must be a valid path to an existing file. |
output_path |
Directory where the output will be saved. If 'NULL', a temporary directory will be created and used. |
Value
None. The function executes the analysis and saves the results to the specified 'output_path'.
Examples
# Define file paths
data_file <- system.file("extdata",
package = "BayesianFitForecast")
option_file <- system.file("extdata", "option.R",
package = "BayesianFitForecast")
excel_file <- system.file("extdata", "SanFrancisco.xlsx",
package = "BayesianFitForecast")
# Run the analysis
Run_analyzeResults(
data_file = data_file,
option_file = option_file,
excel_file = excel_file,
output_path = NULL)
# Results are saved in the specified directory or temporary directory if none is provided.