Statistics tool

Use this forum to post Vensim related questions.
Post Reply
SionC
Member
Posts: 39
Joined: Tue Nov 18, 2008 8:44 am

Statistics tool

Post by SionC »

Hi,

I was wondering if you can help....

I am doing lots of sensitivity runs and I want to be able to export the median value of the simulations to a datafile.

I can use the Vensim statistics tool to get the summary statistical information for the sensitivity run for a particular time, and I can then copy and paste the resulting table elsewhere.

Is there a way I can automate the acquisition and export of the summary data generated using the Statistics tool (for a range of variables and times), eg using a command file or DLL?

Many thanks for your help with this

Siôn
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Statistics tool

Post by Administrator »

I cannot think of any way of doing it.

The only real option is to get the individual values for the parameter you are interested in via the DLL, and then calculate the stats manually.
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
nhoward
Member
Posts: 23
Joined: Wed Oct 05, 2011 2:24 pm

Re: Statistics tool

Post by nhoward »

Why not export your results to excel and automate with a macro? I've done this recently for a model's monte carlo results.
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Re: Statistics tool

Post by LAUJJL »

Hi

Everything that is done via the statistic tool can be done via the dll in excel VBA or another compatible environment.

For instance if you want to do a multivariate sensibility analysis for 2 parameters, you build one set of parameter value (two values) in excel with VBA, export them to vensim, run the model in Vensim
once (not the Vensim statiscical tool) , and import back the results of that single run you are interested in back to excel and then repeat the process building another set of values, the number of times you want, and then analyze the results in excel via the excel statistics tools or with VBA.

If you are not familiar with the process, practice it with a very simple model first, but it works very well once you get familiar with the process.

You can probably too use the menu run sensitivity function from excel and get back the results from a sensitivity run vensim back to excel exporting the results to a tab delimited file first and then to excel. But you must use a preexistent .vsc and .lst file. All this must be controlled from excel VBA through the dll functionnality.

You have a better control with the first method but you can too build the .vsc and .lst files outside of Vensim as they are text files.

The best is to test both methods and choose the most practical.

Regards.
JJ
SionC
Member
Posts: 39
Joined: Tue Nov 18, 2008 8:44 am

Re: Statistics tool

Post by SionC »

Hi All,

Thanks you all for your thoughts - it is always useful to get gather expert opinion.

I am currently carrying out lots of sensitivity runs, exporting the results to large text files, importing the text files into a data analysis package (not Excel) and then calculating the summary stats I need (usual stuff medians, percentiles etc). The first 2 stages I have automated using a command file, but I could equally easily do it using the dll.

I want to streamline analysis stage, and it is frustrating because Vensim is obviously calculating the statistics I want to get hold for the sensitivity run. You can see them in the sensitivity graph, or calculate them using the statistics tool. Ideally, I would want Vensim to do the calculations for me (which it is already doing) and then grab them in some way, rather than repeating the calculations elsewhere.

Best wishes

Siôn
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Re: Statistics tool

Post by LAUJJL »

When you run a sensitivity, the results chosen in the .lst file are saved in the current .vdf file. You can export all the results from the .vdf file into a tab delimited file that you can import in most packages. To do that chose the model>export dataset and then chose your .vdf file where the sensitivity results are saved. It will tell you that the file is a sensitivity run and you must choose a name for the tab delimited file and press OK to generate the tab delimited file that will contain all the results of the multiple sensitivity simulations.

Joined an example of the syracuse compressed suite (an undemonstrated arithmetical conjecture). The sensitivity is run with the syracuse_compressé .vsc and .lst files. It generates the syracuse.vdf file that you can export into the syracuse.tab file. The files generated are included into the .vpm model, you can generate them by yourself chosing other names and verify that they deliver the same results.

Regards.

JJ
Attachments
syracuse_compressé.vpm
(30.32 KiB) Downloaded 223 times
Last edited by LAUJJL on Thu Apr 30, 2015 12:13 pm, edited 2 times in total.
SionC
Member
Posts: 39
Joined: Tue Nov 18, 2008 8:44 am

Re: Statistics tool

Post by SionC »

Hi JJ,

That is pretty much exactly what I am doing at the moment, and I am then analysing the multiple runs elsewhere.

What I want to do is get the values that Vensim calculates based on the multiple runs (e.g. median, percentiles etc.) without having to do this separate analysis elsewhere. Vensim calculate the percentiles, medians, etc in the statistics tool or the sensitivity chart. It is those values I want to extract.

Best wishes

Siôn
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Re: Statistics tool

Post by LAUJJL »

I do not know if Vensim saves the percentiles etc.. somewhere so that you can export them.

But analysing percentiles etc.. in another package is not difficult. I do not see why you want absolutely to get the Vensim analysis as it is very easy to do it elsewhere and probably much more provided that you have the detailed results. As to the detailed results you can automatize them totally via the dll.

Regards.

JJ
Post Reply