death rate as a function of birth rate

41 views
Skip to first unread message

Erfan Sayyari

unread,
Jun 27, 2016, 7:54:50 PM6/27/16
to SimPhy
Hi Diego,

Is there a way to control the sampling of the death rate to be a function of the birth rate?

Imagine we want to draw both the birth and death rates from similar distributions, but by chance, a lot of times, the death rate will be larger than the birth rate. In such situations, simphy seems to stop, with an error.

Two solutions come to mind:

1- Simphy could ignore such cases and draw again (instead of terminating with an error)

2- Simphy could allow us to cap the distribution for death rate by the value sampled for the birth rate in each iteration. For example, you could enable the user to define the death rate as -sd lu:0.0000001,SB where the second SB tells simphy that it should cap the death rate draw by the current sb value.

Are any of these solutions currently possible in simphy?

Do you have any other suggestions?

Thanks
Erfan

Erfan Sayyari

unread,
Jun 27, 2016, 7:58:40 PM6/27/16
to SimPhy
sorry, right after posting to the group, I realized that the following syntax actually works:

-sd lu:0.0000001,SB

This solves my problem.

Thanks again!

Erfan

Diego M.

unread,
Jun 29, 2016, 2:18:24 PM6/29/16
to SimPhy
Hi Erfan,

You could also link the two values. This will make SD to be equal to SB for any value sampled for SB.

Example:

-sd f:SB

I hope this helps,

         Diego M.

siavash mirarab

unread,
Jun 29, 2016, 2:25:09 PM6/29/16
to Diego M., SimPhy
Thanks Diego! 

One more question. Is it possible to make one value depend on *a simple function* of another value? You can obviously do this manually by simulating one replicate at a time. But I am wondering if simphy has a built-in system for this. An example would be:

-sd lu:0.0000001,SB/2

or 

-sb lu:SD*2:SB*10

I understand this can get complicated quickly, and probably not easy to implement directly in simphy. But in case it is possible, it would be good to know. 

Thanks
Siavash

--
You received this message because you are subscribed to the Google Groups "SimPhy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simphy+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/simphy.
To view this discussion on the web visit https://groups.google.com/d/msgid/simphy/81b8c90f-2990-4889-9a91-6df26b3c8c79%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Siavash Mirarab


Diego M.

unread,
Jun 29, 2016, 2:36:02 PM6/29/16
to sim...@googlegroups.com
This is something I was looking forward to implementing since it will increase SimPhy's flexibility a lot, but so far I have had no time to do it. As you say, it could get complicated quickly and therefore it requires a completely generalized version (working like a calculator). It is conceptually easy but time consuming to implement (mainly in C).
If I ever implement it would constitute a major update (SimPhy 2, I guess).

BTW: If anyone wants to implement it I'd be glad to accept a pull request in github.

Diego M.

On Wednesday, June 29, 2016 at 11:25:09 AM UTC-7, Siavash mirarab wrote:
Thanks Diego! 

One more question. Is it possible to make one value depend on *a simple function* of another value? You can obviously do this manually by simulating one replicate at a time. But I am wondering if simphy has a built-in system for this. An example would be:

-sd lu:0.0000001,SB/2

or 

-sb lu:SD*2:SB*10

I understand this can get complicated quickly, and probably not easy to implement directly in simphy. But in case it is possible, it would be good to know. 

Thanks
Siavash
To unsubscribe from this group and stop receiving emails from it, send an email to simphy+unsubscribe@googlegroups.com.



--
Siavash Mirarab


siavash mirarab

unread,
Jun 29, 2016, 3:58:33 PM6/29/16
to Diego M., SimPhy
Thanks Diego!

If you or someone else decided to implement it, I would suggest using an existing parser. Examples include:

The most flexible and easy to implement solution is probably to create small python wrapper around simphy. The python wrapper would use any strategy the user wants to generate distribution parameters, and would then call simphy to generate one replicate at a time. 

Thanks
Siavash


On Wed, Jun 29, 2016 at 11:36 AM, Diego M. <adam...@gmail.com> wrote:
This is something I was looking forward to implement since it will increase SimPhy's flexibility a lot, but so far I have had no time to do it. As you say, it could get complicated quickly and therefore it requires a completely generalized version (working like a calculator). It is conceptually easy but time consuming to implement (mainly in C).
To unsubscribe from this group and stop receiving emails from it, send an email to simphy+un...@googlegroups.com.



--
Siavash Mirarab


--
You received this message because you are subscribed to the Google Groups "SimPhy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simphy+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Siavash Mirarab


Reply all
Reply to author
Forward
0 new messages