Some work in progress R functions related to the covid 19 epidemic

Version: 0.03

Generated: 2022-05-24T22:12:30.918083

Arguments

logLevel

optional - the slf4j log level as a string - one of OFF (most specific, no logging), FATAL (most specific, little data), ERROR, WARN, INFO, DEBUG, TRACE (least specific, a lot of data), ALL (least specific, all data)

Usage

 J = jepidemic::JavaApi$get(logLevel)
   

Author

rc538@exeter.ac.uk

Static methods and constructors


Method GrowthRateEstimator$new()

Produces a GrowthRateEstimator that is configured to behave in a sensible fashion, with sane defaults. In that it estimates an initial poisson rate prior from the first entry and returns a fixed window size and aggregates uncertain SI distributions with a random resampling strategy<br><br>

Usage

J = jepidemic::JavaApi$get()
J$GrowthRateEstimator$new(minWindow, maxWindow)
        

Arguments

minWindow - the smallest amount of data considered in estimating the growth rate, 4 is a sensible default unless you want bang up to date estimate. - (java expects a int) maxWindow - the largest amount of data considered in estimating the growth rate, 14 is a sensible amount. - (java expects a int)

Returns

R6 GrowthRateEstimator object:


Method GrowthRateEstimator$strictGrowthRateAndRtEstimator()

Produces a GrowthRateEstimator that will estimate growth rate and $R_t$, with sane defaults. The $R_t$ estimation is done using bootstrapping, and combining the results using a mixture distribution. This will be relatively slow.

Usage

J = jepidemic::JavaApi$get()
J$GrowthRateEstimator$strictGrowthRateAndRtEstimator(minWindow, maxWindow, infectivityProfiles)
        

Arguments

minWindow - the smallest amount of data considered in estimating the growth rate - 4 is a ssensible default unless you want bang up to date estimate. - (java expects a int) maxWindow - the largest amount of data considered in estimating the growth rate - 14 is a sensible amount. - (java expects a int) infectivityProfiles - a numeric matrix with each column containing a discrete probability distribution of the serial interval with \(P_(t=0) = 0\) - (java expects a RNumericArray)

Returns

R6 GrowthRateEstimator object: a strict growth rate and \(R_t\) estimator that accounts for uncertainty in the infectivity profile.


Method GrowthRateEstimator$defaultGrowthRateAndRtEstimator()

Produces a GrowthRateEstimator that will estimate growth rate and $R_t$, with sane defaults. The $R_t$ estimation is done using a single infectivity profile and does not account for infectivity profile uncertainty. This is comparatively fast.<br><br>

Usage

J = jepidemic::JavaApi$get()
J$GrowthRateEstimator$defaultGrowthRateAndRtEstimator(minWindow, maxWindow, initialIncidence)
        

Arguments

minWindow - the smallest amount of data considered in estimating the growth rate - 4 is a ssensible default unless you want bang up to date estimate. - (java expects a int) maxWindow - the largest amount of data considered in estimating the growth rate - 14 is a sensible amount. - (java expects a int) initialIncidence - a guess at the initial incidence of the time series - (java expects a double)

Returns

R6 GrowthRateEstimator object: a growth rate and \(R_t\) estimator that does not account for uncertainty in the infectivity profile.


Method GrowthRateEstimator$defaultGrowthRateEstimator()

Produces a GrowthRateEstimator that will estimate growth rate only, with sane defaults, unless an infectivity profile is lated added<br><br>

Usage

J = jepidemic::JavaApi$get()
J$GrowthRateEstimator$defaultGrowthRateEstimator(minWindow, maxWindow)
        

Arguments

minWindow - the smallest amount of data considered in estimating the growth rate - 4 is a ssensible default unless you want bang up to date estimate. - (java expects a int) maxWindow - the largest amount of data considered in estimating the growth rate - 14 is a sensible amount. - (java expects a int)

Returns

R6 GrowthRateEstimator object: a growth rate and \(R_t\) estimator that does not account for uncertainty in the infectivity profile.


Method GrowthRateEstimator$basicGrowthRateEstimator()

Produces a GrowthRateEstimator that will estimate growth rate only, with sane defaults, and estimating using windows between 4 and 14 days<br><br>

Usage

J = jepidemic::JavaApi$get()
J$GrowthRateEstimator$basicGrowthRateEstimator()
        

Arguments

none

Returns

R6 GrowthRateEstimator object: a growth rate and \(R_t\) estimator that does not account for uncertainty in the infectivity profile.


Method Serialiser$new()

the default no-args constructor

Usage

J = jepidemic::JavaApi$get()
J$Serialiser$new()
        

Arguments

none

Returns

R6 Serialiser object:


Method Serialiser$serialiseDataframe()

no description

Usage

J = jepidemic::JavaApi$get()
J$Serialiser$serialiseDataframe(dataframe, filename)
        

Arguments

dataframe - (java expects a RDataframe) filename - (java expects a String)

Returns

void:


Method Serialiser$deserialiseDataframe()

no description

Usage

J = jepidemic::JavaApi$get()
J$Serialiser$deserialiseDataframe(filename)
        

Arguments

filename - (java expects a String)

Returns

RDataframe:


Method Serialiser$serialiseList()

no description

Usage

J = jepidemic::JavaApi$get()
J$Serialiser$serialiseList(dataframe, filename)
        

Arguments

dataframe - (java expects a RList) filename - (java expects a String)

Returns

void:


Method Serialiser$deserialiseList()

no description

Usage

J = jepidemic::JavaApi$get()
J$Serialiser$deserialiseList(filename)
        

Arguments

filename - (java expects a String)

Returns

RList:


Method Serialiser$serialiseNamedList()

no description

Usage

J = jepidemic::JavaApi$get()
J$Serialiser$serialiseNamedList(dataframe, filename)
        

Arguments

dataframe - (java expects a RNamedList) filename - (java expects a String)

Returns

void:


Method Serialiser$deserialiseNamedList()

no description

Usage

J = jepidemic::JavaApi$get()
J$Serialiser$deserialiseNamedList(filename)
        

Arguments

filename - (java expects a String)

Returns

RNamedList:


Method InfectivityProfile$new()

no description

Usage

J = jepidemic::JavaApi$get()
J$InfectivityProfile$new(discretePdf, id)
        

Arguments

discretePdf - A discrete pdf of probabilities over time of secondary infection given priamry infection where probability at time 0 is 0 - (java expects a RNumericVector) id - a numeric index or id for this profile - (java expects a int)

Returns

R6 InfectivityProfile object:


Method CoriEstimator$new()

The Estimator is configured with the baseline \(R_0\) assumptions which are used as prior values for \(R_t\) when no other values are available, or the @link CoriEstimator#withDefaultPrior() option is used.

Usage

J = jepidemic::JavaApi$get()
J$CoriEstimator$new(r0Mean, r0SD, maxWindow)
        

Arguments

r0Mean - The mean of the gamma distribution of the baseline prior assumption about R0 - the theorerical reproduction number in an infinite pool of evenly mixing susceptible individuals - (java expects a double) r0SD - The SD of the prior gamma distribution - (java expects a double) maxWindow - The maximum sliding window over which to estimate \(R_t\). - (java expects a int)

Returns

R6 CoriEstimator object:


Method CoriEstimator$defaultEpiEstim()

Produces a CoriEstimator that is configured to behave like the default settings of EpiEstim. In that it uses a fixed prior for Rt and returns a fixed window size<br><br>

Usage

J = jepidemic::JavaApi$get()
J$CoriEstimator$defaultEpiEstim(infectivityProfile, meanR0, sdR0, window)
        

Arguments

infectivityProfile - a vector with the discrete probability distribution of the serial interval with \(P_(t=0) = 0\) - (java expects a RNumericVector) meanR0 - the mean prior of R0 - (java expects a double) sdR0 - the sd prior of R0 - (java expects a double) window - the window size - (java expects a int)

Returns

R6 CoriEstimator object: a default cori estimator


Method CoriEstimator$defaultUncertainEpiEstim()

Produces a CoriEstimator that is configured to behave like the default settings of EpiEstim. In that it uses a fixed prior for Rt and returns a fixed window size and aggregates uncertain SI distributions with a random resampling strategy<br><br>

Usage

J = jepidemic::JavaApi$get()
J$CoriEstimator$defaultUncertainEpiEstim(infectivityProfiles, meanR0, sdR0, window, n2)
        

Arguments

infectivityProfiles - a numeric matrix with the discrete probability distribution of the serial interval with \(P_(t=0) = 0\) - (java expects a RNumericArray) meanR0 - the mean prior of R0 - (java expects a double) sdR0 - the sd prior of R0 - (java expects a double) window - the window size - (java expects a int) n2 - the number of samples to use for estimating confidence limits on bootstrapped infectivity profiles - (java expects a int)

Returns

R6 CoriEstimator object: a default cori estimator