incubationtime | Methods for estimating the distribution of the incubation | Analytics library

 by   pietg C++ Version: Current License: No License

kandi X-RAY | incubationtime Summary

kandi X-RAY | incubationtime Summary

incubationtime is a C++ library typically used in Analytics applications. incubationtime has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

As a start we analyze the data of travelers from Wuhan, as analyzed by the Dutch Centre for Infectious Disease Control (RIVM): A sample of 88 people was used in the estimation of the distribution of the incubation time for COVID-19. The RIVM used (low dimensional) parametric maximum likelihood to analyze these data using, e.g., the Weibull distribution as a possible distribution for the incubation time. We use nonparametric maximum likelihood instead. The original data file is original_data_Wuhan.tsv. This was transformed into a data file transformed_data_Wuhan.txt. This, in turn, was transformed into the input file inputdata_Wuhan.txt, where the time, spent in Wuhan, was shifted making the left point equal to zero. For traveler number 67, who apparently had a connecting flight, the duration of stay in Wuhan was changed from 0 to 1 day. Using the Weibull maximum likelihood method, the estimate was computed by two methods. One is a very simple method using Weibull.cpp where one does not have to compute the derivatives of the log likelihood and can use the Hooke-Jeeves pattern search method. The other one can be found in R_Weibull_Estimation.R, where we use the R package lbfgs, and where the gradient (derivatives of the log likelihood) has to be provided. The results are remarkably similar. The parametric and nonparametric method are both present in analysis_EM.R and analysis_ICM.R, where we use the R package Rcpp, to connect to the files NPMLE_EM.cpp, NPMLE_ICM.cpp and Weibull.cpp, in which the nonparametric and parametric maximum likelihood estimators are computed. For instructions on how to use the R package Rcpp on Mac, Windows or Linux, see, e.g., At the end of the scripts analysis_EM.R and analysis_ICM.R a picture of the difference in the estimation of the density by the two methods is shown. The estimates of the first moments are similar, though. The nonparametric maximum likelihood estimator is computed by the EM algorithm and by the much more efficient iterative convex minorant algorithm. For the EM method, one has to run analysis_EM.R and for the iterative convex minorant algorithm one has to use analysis_ICM.R. The two methods give exactly the same result for the MLE, but the iterative convex minorant (ICM) algorithm needs much less iterations to get the result, with the necessary and sufficient (Fenchel) duality conditions satisfied at level 10^{-10}. This repository complements the paper in "Nieuw Archief voor Wiskunde" ("New Archive for Mathematics", a journal for the Dutch mathematicians), discussing the different ways of estimating the distribution of the incubation time. More details about the methods are given in incubation.pdf: Note that the computation of the MLE does not need a choice of kernel or bandwidth. The bandwidths for the SMLE and density estimate can be chosen by a data-adaptive method, described in incubation.pdf, using the smoothed bootstrap. We demonstrate this method for the density estimate in analysis_ICM.R, using 1000 bootstrap samples for each point on a grid. Usually the choice of the kernel does not make much difference, as long as the kernel is sufficiently smooth at the boundary (for this reason we have a preference for the triweight above the Epanechnikov kernel). I also consider the model in continuous time, avoiding the discretization. This is called "the continuous model" (Section 4 in incubation.pdf, see also and the asymptotic distribution theory for that model is given in the appendix of incubation.pdf. The model is simulated by generating data from a truncated Weibull distribution and combining this with a uniform distribution for the infection time. The simulations can be run by the R script simulations_continuous_model.R, which uses continuous_model.cpp in the main directory of the repository incubationtime. The 1000 lines of the 10 density estimates are in output$dens and an estimate of the MLE of the last sample in output$MLE. A plot of the MLE is shown in MLE.pdf. A C++ implementation of this is given in the subdirectory incubation_continuous which contains a makefile for the executable incub_continuous.exe, made from the C++ file main.cpp, which can be run in Linux or on a Mac. The executable can be run from a terminal window, typing ./incub_continuous.exe. It produces the file dens_values.txt, containing 1000 lines of the density estimate in the continuous incubation time model. In this model the data are not discretized to days, and the simulations produce the nonparametric estimates of the density of the incubation time at 2,3,...,11 days. The executable also produces the example of an input file for the computation of the density estimate produced by the simulation (data_exp.txt) and the MLE and its masses (MLE.txt and ICM_masses, resp.), based on the last sample taken in the simulations. Note that we simulate the incubation time here from a truncated Weibull distribution, giving (quite realistically) the incubation time distribution compact support (for which we chose 20 days) and not the infinite support of the ordinary Weibull distribution. The theory predicts the values of the variances of the estimates of the density, which can be found by running inteq.R in the main directory, which is presently set to evaluate the theoretic value at the point (number of days) 6, but can also be used to evaluate at another number of days between 2 and 11 or a number between these bounds that is not an integer. The executable incub_continuous.exe was tested on a Mac and using Linux (for which I have to thank my son Tim Groeneboom). The directory Lauer_analysis contains an R script for the analysis of a data file of 181 subjects corresponding to the paper "The Incubation Period of Coronavirus Disease 2019 (COVID-19) From Publicly Reported Confirmed Cases: Estimation and Application", Lauer et al., Annals of Internal Medicine, 2020, 577--582. These data are doubly censored (the time of becoming symptomatic is only known to belong to an interval). The R script analysis_IQM_Lauer.R gives the MLE, SMLE and density estimate of the incubation time distribution for this data set and compares this with the results, using the Weibull and log-normal distributions, coming from the R package coarseDataTools. Moreover, the R script analysis_IQM_testdata.R gives the analysis for a test data set of size n=500, where the incubation times are generated from a mixture of normal distributions.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              incubationtime has a low active ecosystem.
              It has 2 star(s) with 1 fork(s). There are 1 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              incubationtime has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of incubationtime is current.

            kandi-Quality Quality

              incubationtime has 0 bugs and 0 code smells.

            kandi-Security Security

              incubationtime has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              incubationtime code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              incubationtime does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              incubationtime releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of incubationtime
            Get all kandi verified functions for this library.

            incubationtime Key Features

            No Key Features are available at this moment for incubationtime.

            incubationtime Examples and Code Snippets

            No Code Snippets are available at this moment for incubationtime.

            Community Discussions

            QUESTION

            Angular / typescript compare numbers
            Asked 2021-Mar-09 at 02:36

            Hi I have a problem with comparing 2 variables:

            ...

            ANSWER

            Answered 2021-Mar-09 at 02:15

            You're having "problems" with simulation object and, first of all, you need to compare with === instead of == to compare values and types. Now, you have values on simulation object that represents a string and after that you're comparing string and numbers.

            Source https://stackoverflow.com/questions/66539633

            QUESTION

            Why is nothing happening when I implement travel in my infectious disease simulation?
            Asked 2020-Jul-20 at 19:36

            I have an issue with my infectious disease simulation. Here is the relevant code:

            ...

            ANSWER

            Answered 2020-Jul-20 at 19:36

            It seems to be a problem with how to define the counters of these loops:

            Source https://stackoverflow.com/questions/63002406

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install incubationtime

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/pietg/incubationtime.git

          • CLI

            gh repo clone pietg/incubationtime

          • sshUrl

            git@github.com:pietg/incubationtime.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link