plot.FluJointHMM: Plot a FluJointHMM object

Description Usage Arguments Details Value

Description

This function plots the ILI/ARI rates and number of influenza-positive isolates stored in a FluJointHMM object, superimposing the model results. The input and output is mostly the same as plot.FluHMM, with an additional smaller sub-plot of the isolates at the bottom.

Usage

1
2
3
4
5
6
## S3 method for class 'FluJointHMM'
plot(x, xlab = "Week", ylab = "ILI rate",
  ylabIsol = "Influenza(+) samples", main = NA, xaxis = NA,
  showPs = TRUE, cexPs = 0.7, yexpand = 0.3, col = "red",
  mucol = "limegreen", hues = c(4, 0, 2, 5, 3)/6, rainbow = FALSE,
  ci = TRUE, alpha = 0.1)

Arguments

x

An object of class ‘FluJointHMM’ to be plotted.

xlab

Label for the x-axis.

ylab

Label for the y-axis of the ILI/ARI rate sub-plot.

ylabIsol

Label for the y-axis of the isolates sub-plot.

main

Main label of the plot.

xaxis

How to annotate the x-axis of the plot. If NULL, no axis is being drawn (equivalent to xaxt='n'). If xaxis=0, the axis names are taken from the names attribute of the seasonRates element of the FluHMM object. If xaxis=NA, the seasonRates names if treated as strings of format YYYYWW, and the week number is plotted. Otherwise, if a vector of length>1 is supplied, it is treated as the week numbers to be plotted at the x-axis.

showPs

If TRUE (the default), show the weekly posterior probabilities of each phase as a series of numbers too, instead of only a color representation.

cexPs

Character expansion factor (cex), i.e. size for plotting the posterior probabilities

yexpand

Factor (as a percentage of the original y-axis size) to expand the y-axis, so that the numbers of the posterior probabilities do not overlap with the rest of the plot.

col

Color for plotting the weekly ILI/ARI rates

mucol

Color for plotting the fitted weekly mean rates.

hues

A numeric vector of length 5, with values between 0 and 1, containing the hue values for each of the five phases in the model.

rainbow

If TRUE, the mean rates and mean number of isolates for each of the six chains are individually plotted as well.

ci

If TRUE, semi-transparent 95 provided the ‘FluJointHMM’ object includes a logSE element (the log Standard Errors of the rates).

alpha

Alpha transparency value for the confidence bands (a number between 0 and 1).

Details

This function plots the ILI/ARI rates with the week number on the x-axis. If the FluJointHMM object has a seasonRates element, this is plotted as a thin grey line and the rates are overlaid as a thick line with points, of color col.

A similar subplot (a bar plot) of the influenza-positive isolates is drawn under the ILI/ARI rates plot.

The posterior probabilities of the five epidemic phases per week (pre-epidemic, epidemic growth, epidemic plateau, epidemic decline and post-epidemic) are displayed with colored bars on the top of the plot and optionally as a vertical stack of numbers (if showPs=TRUE). The hue of each phase in the color representation is given in the hues argument, and the saturation is dependent on the posterior probability of each phase. If the vertical space of the plot is insufficient (especially if showPs=TRUE), expand it as necessary by increasing the yexpand argument.

The mean weekly rates fitted by the model is plotted as a thick dotted line. If rainbow=TRUE, the mean rates for each MCMC chain are plotted individually as well. These should be very close to each other; if very different, then the chains have probably not converged enough.

In any case, if full convergence (for all model parameters) has not been reached, a clear warning will be displayed on the plot.

Value

None


thlytras/FluHMM documentation built on May 31, 2019, 10:44 a.m.