Page 1 of 1

Precision

Posted: Wed Nov 13, 2019 10:52 am
by WRolls
Hi,

Could you let me know how many decimal places vensim calculates to?

Thanks

Re: Precision

Posted: Wed Nov 13, 2019 3:09 pm
by tomfid
There's no simple answer to this question.

A single precision float is about 7 decimals, and double precision is 15. (Most Vensim versions are now double precision.) However, the precision of the answer also depends on simulation method and specific equation choices.

Fortunately, this rarely matters, because the uncertainties in any social system model are far larger. In most systems it makes sense to talk about more like 2 significant figures.

Re: Precision

Posted: Wed Nov 13, 2019 7:11 pm
by WRolls
Thanks Tom. I've tried recreating a model in python (which calculates to 35dp) and I get really different answers - I'm thinking that it's a numerical instability problem

Re: Precision

Posted: Wed Nov 13, 2019 8:19 pm
by tomfid
It seems unlikely that the difference is numerics, unless the model is chaotic, or at least dominant positive feedback, and you're running for a long time. The xmile test suite includes a number of models that yield ~identical results in Vensim, ithink and Python (PySD).

Python storage is normally going to be double precision, which gives you a 53-bit mantissa. 53*log(2)/log(10) is the origin of the ~15 digit precision. But that's unlikely to be realized due to additional limitations from finite time step, integration method, etc.

I'd be looking for a difference in implementation.