You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a<- order(as.numeric(rownames(theta.mat))) # reorder by cases
270
270
suppressWarnings(theta.mat<-matrix(as.integer(floor(theta.mat[a,a])), n, n))
271
+
#suppressWarnings(theta.mat <- matrix(as.integer(theta.mat[a,a])), n, n)
271
272
diag(theta.mat) <-NA
272
273
273
274
# Return theta matrix for unit testing
@@ -505,6 +506,7 @@ est.transdist <- function(
505
506
##' @param max.sep maximum number of time steps allowed between two cases (passed to the \code{get.transdist.theta} function)
506
507
##' @param max.dist maximum spatial distance between two cases considered in calculation
507
508
##' @param n.transtree.reps number of time to simulate transmission trees when estimating the weights of theta (passed to the \code{est.transdist.theta.weights} function, default = 10). Warning: higher values of this parameter cause significant increases in computation time.
509
+
##' @param mean.equals.sd logical term indicating if the mean and standard deviation of the transmission kernel are expected to be equal (default = FALSE)
508
510
##' @param theta.weights use external matrix of theta weights. If NULL (default) the matrix of theta weights is automatically estimated by calling the \code{est.transdist.theta.weights} function
509
511
##' @param boot.iter the number of bootstrapped iterations to perform
510
512
##' @param ci.low low end of the confidence interval (default = 0.025)
##' @param max.sep maximum number of time steps allowed between two cases (passed to the \code{get.transdist.theta} function)
621
632
##' @param max.dist maximum spatial distance between two cases considered in calculation
622
633
##' @param n.transtree.reps number of time to simulate transmission trees when estimating the weights of theta (passed to the \code{est.transdist.theta.weights} function, default = 10). Higher values of this parameter cause significant increases in computation time.
634
+
##' @param mean.equals.sd logical term indicating if the mean and standard deviation of the transmission kernel are expected to be equal (default = FALSE)
623
635
##' @param theta.weights use external matrix of theta weights. If NULL (default) the matrix of theta weights is automatically estimated by calling the \code{est.transdist.theta.weights} function
624
636
##' @param parallel run time steps in parallel (default = FALSE)
625
637
##' @param n.cores number of cores to use when \code{parallel} = TRUE (default = NULL, which uses half the available cores)
626
638
##'
627
-
##' @return a vector containing the point estimate for mean transmission distance for each unique time step of the epidemic.
639
+
##' @return a numeric matrix containing the point estimate for mean transmission distance for each unique time step of the epidemic and the sample size $n$ used to make the estimate
628
640
##' NAs are returned for time steps which contain fewer than three cases
629
641
##'
630
642
##' @author Justin Lessler, Henrik Salje, and John Giles
##' @param max.sep maximum number of time steps allowed between two cases (passed to the \code{get.transdist.theta} function)
739
754
##' @param max.dist maximum spatial distance between two cases considered in calculation
740
755
##' @param n.transtree.reps number of time to simulate transmission trees when estimating the weights of theta (passed to the \code{est.transdist.theta.weights} function, default = 10). Warning: higher values of this parameter cause significant increases in computation time.
756
+
##' @param mean.equals.sd logical term indicating if the mean and standard deviation of the transmission kernel are expected to be equal (default = FALSE)
741
757
##' @param theta.weights use external matrix of theta weights. If NULL (default) the matrix of theta weights is automatically estimated by calling the \code{est.transdist.theta.weights} function
742
758
##' @param boot.iter the number of bootstrapped iterations to perform
743
759
##' @param ci.low low end of the confidence interval (default = 0.025)
744
760
##' @param ci.high high end of the confidence interval (default = 0.975)
745
761
##' @param parallel run bootstraps in parallel (default = FALSE)
746
762
##' @param n.cores number of cores to use when \code{parallel} = TRUE (default = NULL, which uses half the available cores)
747
763
##'
748
-
##' @return a three-column matrix containing the point estimate for mean transmission distance and low and high bootstrapped confidence intervals
764
+
##' @return a four-column numeric matrix containing the point estimate for mean transmission distance, low and high bootstrapped confidence intervals, and the sample size up to each time step
749
765
##'
750
766
##' @author Justin Lessler, Henrik Salje, and John Giles
0 commit comments