Page 1 of 1

Quantiles

Posted: Tue Jul 28, 2009 3:47 pm
by marcow
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

Posted: Wed Jul 29, 2009 11:31 am
by bob@vensim.com
This is done with the stats tool which is not available in PLE Plus. You can, of course, export the results and compute quantiles in another program.

Re: Quantiles

Posted: Thu Dec 11, 2014 6:32 pm
by beatrixb
Is the stats tool available in any of the VenSim versions?

Re: Quantiles

Posted: Thu Dec 11, 2014 7:03 pm
by Administrator
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.

Re: Quantiles

Posted: Thu Dec 11, 2014 8:20 pm
by beatrixb
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.

Re: Quantiles

Posted: Thu Dec 11, 2014 8:46 pm
by Administrator
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.

Re: Quantiles

Posted: Fri Dec 12, 2014 1:47 am
by tomfid
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.

Re: Quantiles

Posted: Fri Dec 12, 2014 3:08 pm
by beatrixb
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.

Re: Quantiles

Posted: Sat Dec 13, 2014 2:28 am
by tomfid
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.