--- title: "BayesGP: COVID-19 Example" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{BayesGP: COVID-19 Example} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} oldpar <- par(no.readonly = TRUE) # Save current settings knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.height=3, fig.width=5, margins=TRUE ) knitr::knit_hooks$set(margins = function(before, options, envir) { if (!before) return() graphics::par(mar = c(1.5 + 0.9, 1.5 + 0.9, 0.2, 0.2), mgp = c(1.45, 0.45, 0), cex = 1.25, bty='n') }) ``` ```{r setup} library(BayesGP) ``` # COVID-19 Example ## Data and Model We will illustrate the use of BayesGP using the `covid_canada` dataset, which contains the daily death count of COVID-19 in Canada. ```{r} head(covid_canada) ``` For simplicity, let's consider the following model: \[Y_i|\lambda_i \sim \text{Poisson}(\lambda_i)\] \[\log(\lambda_i) = \mathbf{x}_i^T\boldsymbol{\beta} + f(t_i)\] where $\mathbf{x}_i$ denotes the fixed effect of weekdays, and $f$ is an unknown function to be inferred. To make inference of the unknown function $f$, we use the $\text{IWP}_3(\sigma)$ model: \[\frac{\partial^p{f}(t)}{\partial t^p} = \sigma \xi(t),\] with the boundary (initial) conditions that $\frac{\partial^q{f}(0)}{\partial t^q} = 0$ for all $0\leq q