PoonLab / Kaphi

Kernel-embedded ABC-SMC for phylodynamic inference
GNU Affero General Public License v3.0
4 stars 2 forks source link

MASTER: R abort session from infinite Rejections of end conditions #119

Closed gtng92 closed 6 years ago

gtng92 commented 6 years ago

Stochastically, usually when nparticle > 3, printout from MASTER call becomes infinite:

Rejection end condition met at time 0.31206950547771256
Rejection end condition met at time 0.31378176369729716
Rejection end condition met at time 0.2785179708429142
Rejection end condition met at time 0.33230080829353104
Rejection end condition met at time 0.238955047263293
...

In the current XML template:

<lineageEndCondition spec='LineageEndCondition' population='@I' nLineages='0' isRejection='true'/>

Is this because the ancestors never coalesce?

ArtPoon commented 6 years ago

That statement halts the simulation when the infected subpopulation goes extinct. There is no coalescent process in these simulations -- they are run forward in time. My guess is that the parameter settings are such that the transmission rate is not sufficiently high to sustain the epidemic, at least to the point that you reach the required number of sampled infections.

gtng92 commented 6 years ago

Ok thanks, that seems to work for higher numbers of nparticles now.

ArtPoon commented 6 years ago

With SMC, there is always a chance that a particle will end up in a silly region of parameter space, so we should have some hard limit to simulation time that we can catch as an exception and return a big distance to spike that particle out of contention.

ArtPoon commented 6 years ago

In the MASTER XML InheritanceTrajectory specification, use the argument maxConditionRejects to set a limit to the number of attempts for a particle to generate a tree

gtng92 commented 6 years ago

Currently setting maxConditionRejects to 50 before exiting.