- CohortPopVentityModels.zip
- (35.58 KiB) Downloaded 603 times
cohort modeling examples
cohort modeling examples
This archive contains some examples of cohort models. I explain how they work in a video/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: cohort modeling examples
Hi Tom
This is great! The models and your explanation helped me a lot to get the concept. Just as a test for myself I added in CohortPop1 and CohortPop2 the issue of the onset of a chronic disease (say diabetes, starting at a certain age). This is straightforward indeed (see attachment). In CohortPop2b I addressed the issue of diagnosing a certain disease (say coronary heart disease) with a certain fraction of positive and negative diagnoses (no false diagnoses assumed). All deaths rates have been remained the same as to test the total sum.
Justus
This is great! The models and your explanation helped me a lot to get the concept. Just as a test for myself I added in CohortPop1 and CohortPop2 the issue of the onset of a chronic disease (say diabetes, starting at a certain age). This is straightforward indeed (see attachment). In CohortPop2b I addressed the issue of diagnosing a certain disease (say coronary heart disease) with a certain fraction of positive and negative diagnoses (no false diagnoses assumed). All deaths rates have been remained the same as to test the total sum.
Justus
- Attachments
-
- CohortPop_Justus.zip
- (40.17 KiB) Downloaded 479 times
Re: cohort modeling examples
This is cool. I think it's also the very first working Ventity model submitted by an external user - a bit of a milestone for us. Thanks!
It would be cool to have an infectious disease variant of this, where each cohort is essentially an SIR model, with infection crossover among the cohorts. I'll have to cook one up.
It would be cool to have an infectious disease variant of this, where each cohort is essentially an SIR model, with infection crossover among the cohorts. I'll have to cook one up.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: cohort modeling examples
A good example might be AIDS, where infections start with a certain age, and decline after a certain age (sexual behavior). This could be described by a contact rate depending on age. What do you think about that? Yet, the population of the first "infected" is not clear to me.
Regards
Regards
Re: cohort modeling examples
A simple question: I wanted to create a subcollection of population in the CohortPop2 model for the sexual active population. I tried to create an attribute (sexual active), depending on Age (15< Age < 70). But this obviously didn't work and I was also not able to use this information to build the sum over this sexual active population. How should I proceed?
Re: cohort modeling examples
Selection by value is an unimplemented feature. There are a couple of possible workarounds - I'll test to see which works best.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: cohort modeling examples
I've added an attribute, "is childbearing age," that contains "yes" or "no". Then I created a collection, cohort[parent population, is childbearing age] that calculates some aggregates, like the population of child bearing age. The trick is that a normal attribute expression initializes it, but doesn't update it. For the updates, I created a trigger/action pair, "update childbearing." If you inspect the action, you'll see that it sets the attribute to yes or no according to the birth rate observed for the cohort. You could also look at age, but that's problematic if the user changes the birth rate lookup, so I think looking at de facto childbearing is safer.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: cohort modeling examples - leakage
Hi
I'm still working on the cohort modeling issue. I would be interested to have a stock with two outflows. One is related to deaths (mortality rate as a function of age), and the other as a function of the duration in that stock (incidence rate of cardiac symptoms). The first flow rate is straightforward. For the second I used as a first try a simple fractional outflow. However, one could think of a situation where this incidence starts only after a certain time. What could be a solution? Create a chain of stocks? Or is there an analogy to the leakage formulation in Vensim? Other solutions? The model included is still a conceptual model using hypothetical numbers.
Thanks
Justus
I'm still working on the cohort modeling issue. I would be interested to have a stock with two outflows. One is related to deaths (mortality rate as a function of age), and the other as a function of the duration in that stock (incidence rate of cardiac symptoms). The first flow rate is straightforward. For the second I used as a first try a simple fractional outflow. However, one could think of a situation where this incidence starts only after a certain time. What could be a solution? Create a chain of stocks? Or is there an analogy to the leakage formulation in Vensim? Other solutions? The model included is still a conceptual model using hypothetical numbers.
Thanks
Justus
- Attachments
-
- CohortPop2 with CHD with readmission.zip
- (14.84 KiB) Downloaded 448 times
Re: cohort modeling examples
We haven't implemented discrete delays and the like yet, mainly because there hasn't been a request.
My experience with conveyors with leakage and similar builtin functions is that I can never use them, because there's always some minor violation of the assumptions of the structure.
So, I can think of several options:
- chain of stocks, as you suggest
- we implement a discrete delay (useful for simple situations, without leakage)
- break the cohort into some sub-cohorts, so that you can have multiple instances, time stamped by the group's time in the "delayed incidence" state
I'll take a look at the model.
My experience with conveyors with leakage and similar builtin functions is that I can never use them, because there's always some minor violation of the assumptions of the structure.
So, I can think of several options:
- chain of stocks, as you suggest
- we implement a discrete delay (useful for simple situations, without leakage)
- break the cohort into some sub-cohorts, so that you can have multiple instances, time stamped by the group's time in the "delayed incidence" state
I'll take a look at the model.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: cohort modeling examples
Hi
Thanks for your reply. I can pretty well understand your point! I assume that the third option you mention is closest to my expectations. The incidence of cardiac symptoms should increase as a function of time elapsed since the last therapeutic intervention. Do you have already a sample model demonstrating this "time stamp" issue?
Best regards
Thanks for your reply. I can pretty well understand your point! I assume that the third option you mention is closest to my expectations. The incidence of cardiac symptoms should increase as a function of time elapsed since the last therapeutic intervention. Do you have already a sample model demonstrating this "time stamp" issue?
Best regards
Re: cohort modeling examples
Hi
I wanted to modify the model "CohortPop2" as to include gender (male, female), without changing the model structure otherwise.
However, I didn't manage. Is it correct to define another entity called "gender" and to use it later as an attribute for the cohorts (or for population)? However, the action for creating cohorts should now take place both for male and female. I don't understand how to formulate this. I'm struggling still with basic problems, I'm afraid.
Thanks for further explanations.
Best
I wanted to modify the model "CohortPop2" as to include gender (male, female), without changing the model structure otherwise.
However, I didn't manage. Is it correct to define another entity called "gender" and to use it later as an attribute for the cohorts (or for population)? However, the action for creating cohorts should now take place both for male and female. I don't understand how to formulate this. I'm struggling still with basic problems, I'm afraid.
Thanks for further explanations.
Best
Re: cohort modeling examples
Hi
I tried to introduce a new entity (gender) with properties (male, female). The model is running (somehow), but I didn't manage to sum male+female. It seems that I do something wrong with the references. The model is uploaded.
Best
I tried to introduce a new entity (gender) with properties (male, female). The model is running (somehow), but I didn't manage to sum male+female. It seems that I do something wrong with the references. The model is uploaded.
Best
- Attachments
-
- CohortPop2_gender.zip
- (9.4 KiB) Downloaded 413 times
Re: cohort modeling examples
I'll take a look ...
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: cohort modeling examples
OK ... here's a solution. There's a glitch: it may not run until you get the next beta (which I'm uploading right now).
When I built the original prototype for this, I shouldn't have put the top level in the Model entity, because that's a "singleton," i.e. there can be only one Model in a model. So I moved the infrastructure into a "group" entity, where a group might have attributes like gender and country, and owns a set of cohorts.
I left the age mortality rate lookup and the cohort interval in the Model, as globals, but if mortality differs by gender, I'd probably want to move that.
When I built the original prototype for this, I shouldn't have put the top level in the Model entity, because that's a "singleton," i.e. there can be only one Model in a model. So I moved the infrastructure into a "group" entity, where a group might have attributes like gender and country, and owns a set of cohorts.
I left the age mortality rate lookup and the cohort interval in the Model, as globals, but if mortality differs by gender, I'd probably want to move that.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: cohort modeling examples
BTW the new build needed for this to work is now available (see top announcement).
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: cohort modeling examples
Thanks, that helps!
Re: cohort modeling examples
Hi
coming back to the issue of having different lookups for mortality rates for e.g. gender, region at the group level. I tried to move the lookup to the group level and got the following error message:
Reference "Cohort" Missing condition for "CohortID" attribute.
I have two questions:
a) how to fix this problem?
b) once the problem is fixed, how can I initialize the different lookups?
Thanks and best regards
coming back to the issue of having different lookups for mortality rates for e.g. gender, region at the group level. I tried to move the lookup to the group level and got the following error message:
Reference "Cohort" Missing condition for "CohortID" attribute.
I have two questions:
a) how to fix this problem?
b) once the problem is fixed, how can I initialize the different lookups?
Thanks and best regards
- Attachments
-
- CohortPopGroups3 fixup mortality group.zip
- (11.62 KiB) Downloaded 425 times
Re: cohort modeling examples
I haven't had a chance to look at the model, but here's what that message probably means:
(a) Somewhere (probably your new "group" entitytype) you have a Reference that points to Cohort entities. If you open the inspector for the new entitytype, and switch to the references tab, you'll find it there. Edit that reference, and you'll find that its "value to match" field is empty. That's my guess anyway - I'll take a look later.
(b) It should be possible to put them in the entity initialization data, but there seems to be a bug with reading it. We're working on it.
(a) Somewhere (probably your new "group" entitytype) you have a Reference that points to Cohort entities. If you open the inspector for the new entitytype, and switch to the references tab, you'll find it there. Edit that reference, and you'll find that its "value to match" field is empty. That's my guess anyway - I'll take a look later.
(b) It should be possible to put them in the entity initialization data, but there seems to be a bug with reading it. We're working on it.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: cohort modeling examples
Hi
First, let me thank you for the wonderful videos with the SIR-model!
Today let me ask a question about a cohort model you posted previously (e.g. CohortPop4). Here the results depend strongly on the choice of the cohort creation interval (in case of endogenous births). Three questions:
a) What is the reason for this?
b) Is there a "right" choice?
c) how could the difference be eliminated? By choosing different input data specifically for a shorter interval?
First, let me thank you for the wonderful videos with the SIR-model!
Today let me ask a question about a cohort model you posted previously (e.g. CohortPop4). Here the results depend strongly on the choice of the cohort creation interval (in case of endogenous births). Three questions:
a) What is the reason for this?
b) Is there a "right" choice?
c) how could the difference be eliminated? By choosing different input data specifically for a shorter interval?
Re: cohort modeling examples
I think the answer probably has to do with the granularity of the input data, but I'll have to fire it up and take a look to be sure.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: cohort modeling examples
This turns out to be quite tricky.
I ran the model with 5 and 10 year cohorts, and got quite different results. The difference emerges with births from the earliest created cohorts (not the preexisting ones in the data). Here's the sum of births: The difference arises from the timing of the onset of births. If you pair up the 5 year cohorts and sum them to match the 10 year cohorts, they don't quite align: There are two reasons for this:
1. I calculated cohort age as (Model.Time-Creation Time) which is a bit sloppy - this is really the age of the edge of the cohort interval, not the middle. Hence the lag between series.
2. The birth rate reads from a single point on the age-birth lookup, rather than the average over the cohort's interval. This is really an abuse of the table. Either the lookup should read an average over a range of times, or the table data should be smoother for longer intervals.
I ran the model with 5 and 10 year cohorts, and got quite different results. The difference emerges with births from the earliest created cohorts (not the preexisting ones in the data). Here's the sum of births: The difference arises from the timing of the onset of births. If you pair up the 5 year cohorts and sum them to match the 10 year cohorts, they don't quite align: There are two reasons for this:
1. I calculated cohort age as (Model.Time-Creation Time) which is a bit sloppy - this is really the age of the edge of the cohort interval, not the middle. Hence the lag between series.
2. The birth rate reads from a single point on the age-birth lookup, rather than the average over the cohort's interval. This is really an abuse of the table. Either the lookup should read an average over a range of times, or the table data should be smoother for longer intervals.
- Attachments
-
- cohort_1_2_births.png (15.35 KiB) Viewed 15253 times
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: cohort modeling examples
Thanks
I tried now the model with constant exogenous births and intervals of 10 and 1 year, assuming that no differences in Sum Population should occur. However, they still prevail, presumably due to the same table issue with regard to mortality.
I tried now the model with constant exogenous births and intervals of 10 and 1 year, assuming that no differences in Sum Population should occur. However, they still prevail, presumably due to the same table issue with regard to mortality.