Does anybody know how to calculate the quantile of a variable in Vensim (PLE plus Version)?
I need to know under which value 5 % of the data of a certain variable are located.
Marco
Quantiles
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
Re: Quantiles
Is the stats tool available in any of the VenSim versions?
-
- Super Administrator
- Posts: 4842
- Joined: Wed Mar 05, 2003 3:10 am
Re: Quantiles
The stats tool is only available in Pro/DSS.
You can easily export the contents of a window to Excel and do the stats there.
You can easily export the contents of a window to Excel and do the stats there.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: Quantiles
Would it be easy to export and afterwards import that data? The whole point is to be able to do a calculate a quantile or inverse CDF and use it within the model I am running.
-
- Super Administrator
- Posts: 4842
- Joined: Wed Mar 05, 2003 3:10 am
Re: Quantiles
No. Even with Vensim Pro/DSS, you might need to write an external function to do it.
Can you post the model and a description of what you are trying to do? If we have something to look at, we might be able to spot a way of doing it.
Can you post the model and a description of what you are trying to do? If we have something to look at, we might be able to spot a way of doing it.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: Quantiles
Quantiles across an array dimension are fairly easy (using VECTOR RANK and similar). If you need time series quantiles, you can use an array dimension to store the time values, and get the quantiles from 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: Quantiles
Sure. It is going to be a bit intense looking at first, but my focus is on the box labeled Supply Capacity. We are trying to input an equation for Supply Capacity using the inverse CDF or quantile function, where mu="Total Procurement of DMPA"/"Number of Manufacturers", sigma="Variability of Demand"/sqrt("Number of Manufacturers"), and k=("Price"-"Manufacturing Cost")/"Price".
Does that make any sense? If not let me know and I can try to clarify some more.
Does that make any sense? If not let me know and I can try to clarify some more.
- Attachments
-
- public sector injectables model November 2014.mdl
- (9.34 KiB) Downloaded 690 times
Re: Quantiles
It seems like there's too much integration going on here. Check the use of level vs. auxiliary variables. Adding units to this model would help verification. Also, embedded constants should generally be pulled out as separate, named variables, both for clarity and units checking.
I can concoct an example of array bins for quantiles separately, but it'll take a couple days because I'm traveling.
I can concoct an example of array bins for quantiles separately, but it'll take a couple days because I'm traveling.
/*
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
*/