Precision

Use this forum to post Vensim related questions.
Post Reply
WRolls
Junior Member
Posts: 6
Joined: Mon Apr 23, 2018 7:47 pm
Vensim version: DSS

Precision

Post by WRolls »

Hi,

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

Thanks

tomfid
Administrator
Posts: 2959
Joined: Wed May 24, 2006 4:54 am

Re: Precision

Post 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.

WRolls
Junior Member
Posts: 6
Joined: Mon Apr 23, 2018 7:47 pm
Vensim version: DSS

Re: Precision

Post 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

tomfid
Administrator
Posts: 2959
Joined: Wed May 24, 2006 4:54 am

Re: Precision

Post 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.

Post Reply