Page 1 of 1

Statistics tool

Posted: Wed Apr 29, 2015 10:59 am
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

Re: Statistics tool

Posted: Wed Apr 29, 2015 12:04 pm
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.

Re: Statistics tool

Posted: Wed Apr 29, 2015 2:37 pm
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.

Re: Statistics tool

Posted: Wed Apr 29, 2015 6:12 pm
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

Re: Statistics tool

Posted: Thu Apr 30, 2015 9:39 am
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

Re: Statistics tool

Posted: Thu Apr 30, 2015 11:42 am
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

Re: Statistics tool

Posted: Thu Apr 30, 2015 12:02 pm
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

Re: Statistics tool

Posted: Thu Apr 30, 2015 12:20 pm
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