zaneveld / karenina

Simulation and modeling tools for studying Anna Karenina effects in animal microbiomes
2 stars 6 forks source link

Fix Cohort size-checks #44

Open SLPeoples opened 6 years ago

SLPeoples commented 6 years ago

Currently, cohort support only checks the size of the input X, which originally has dimensions [1,2,3], where they are separated by timepoints (as a cohort) like so: [[1,2],[1,2,3],[1]], which allows for optimization, avoiding overlapping timepoints. The check for the length of x in make_ou_objective_fn which throws a value error if len(x)<=1 does not get thrown for single-point observations within the nLogLik loop. Checks for single-point observations within the loop need to be added, and either ignore the observation, or throw a ValueError.

Moving Pictures is a good example of this, where the antibiotic treatment is provided at timepoint zero, and all other time points have no reported antibiotic usage. In this instance, the values passed in for the treatment are of the form [[pc_value],[pc_value],...], with timepoints [[0],[0],...]. These single-point observations are not supported, and thus Moving Pictures (and similar experiments) will not properly run at this time.

Further testing is necessary on the 2485 obesity data to determine the functionality/ universality of the cohort separation/ optimization.