Description Usage Arguments Value See Also Examples
Simulates HAI titre readings to match the FluScape serosurvey protocol using the simplified boosting and waning model.
1 2 | fluscape_data_manipulation(fluscape_data, fluscape_strains,
removeOutliers = TRUE, fluscapeT0 = TRUE, plotSerology = FALSE)
|
fluscape_data |
the FluScape data frame, as returned by load.and.merge.part.V1.V2() |
fluscape_strains |
a vector of influenza strains to be used. Note that this should just be the strain ID. For example, "H3N2.2008". The function will create identifiers to access the V1 and V2 values. |
removeOutliers |
boolean value indicating whether or not sample time outliers from the fluscape data should be included. Defaults to TRUE |
fluscapeT0 |
boolean value indicating whether or not the V1 titres should be used as t0 titres in the simulation. If not, all startnig titres are set to 0. Defaults to TRUE |
plotSerology |
boolean value indicating whether or not the FluScape data and simulation data should be plotted. Defaults to FALSE. |
n |
Number of individuals to simulate. If NULL, uses the entire population |
mu_pars |
n x n matrix of boosting parameters, where n is the number of simulated strains. Each strain should provide some boost (may be 0) to each other strain. |
tp_pars |
n x n matrix of time to peak parameters |
m_pars |
n x n matrix of waning parameters. Waning rate may be set to zero. |
STOCHASTIC |
boolean value indicating whether or not boosting should be stochastic or deterministic. If stochastic, each boost is drawn from a poisson distribution. |
incidenceVectors |
a list of incidence vectors. Should match length of fluscape_strains (ie. each circulating strain has an incidence vector. Note that the range of these vectors should cover the FluScape study period. ie. go from 0 (the day of the first sample) to x (the day of the last sample). |
addNoise |
boolean value indicating whether or not observation error noise should be added to the simulation. Defaults to TRUE |
noiseParams |
vector of parameters to be passed to |
a dataframe of a similar format to the FluScape data frame.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | fluscape_dat <- load.and.merge.V1.V2()
mu_pars <- matrix(ncol=2,nrow=2)
mu_pars[1,] <- c(5,1)
mu_pars[2,] <- c(1,6)
tp_pars <- matrix(ncol=2,nrow=2)
tp_pars[1,] <- tp_pars[,2] <- c(21,21)
m_pars <- matrix(ncol=2,nrow=2)
m_pars[1,] <- m_pars[2,] <- c(0,0)
inc_vectors <- NULL
inc_vectors[[1]] <- generate_toy_inc(0.4,900,200,600)
inc_vectors[[2]] <- generate_toy_inc(0.1,900,500,750)
dat <- fluscape_data_manipulation(fluscape_data,fluscape_strains,TRUE,FALSE,TRUE)
Get given strains into format for fluscape data frame
Get only data that we need - sampling times and titres
Omit NA
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.