Units errors with Smooth functions

Use this forum to post Vensim related questions.
Post Reply
nhoward
Member
Posts: 23
Joined: Wed Oct 05, 2011 2:24 pm

Units errors with Smooth functions

Post by nhoward »

Please could you explain how to eliminate units errors when using a Smooth function in PLE+?
Units check within a variable using Smooth, says "Units OK", but Units Check produces an error for each variable using a smoothing function.
The variable is dimensionless: the result of the smoothed equation yields units of 'week', according to Units Check.
Dividing by 1 week reverses the result: Units error within the variable.
I've used Smooth and Smooth1.
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Units errors with Smooth functions

Post by tomfid »

Can you post an example?
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Units errors with Smooth functions

Post by tomfid »

Now that I think about it, I'm guessing that you've written,

Code: Select all

smoothed x = SMOOTH( x, 8 ) 
where 8 (or whatever) is the smoothing time. The problem is that Vensim doesn't know the units for 8, so it assumes dmnl. Make the 8 a parameter, which also exposes it to sensitivity analysis, and give it units of weeks, and you should be all set.

Code: Select all

smoothed x = smooth(x,smoothing time) ~ dmnl
x = ... ~ dmnl
smoothing time = 8 ~ weeks
Tom
nhoward
Member
Posts: 23
Joined: Wed Oct 05, 2011 2:24 pm

Re: Units errors with Smooth functions

Post by nhoward »

That's neat. Thanks.
Post Reply