Page 1 of 1
Error in Unit Check--I'm not even using that dimension!
Posted: Wed Mar 24, 2010 2:31 am
by RommelDAK
I'm having a strange problem when I do unit check. Here is the print out:
***********************************************
***********************************************
Error in units for the following equation:
Consecutive Quarters of High Realized Profit =
INTEG( high profits tracker
- low profits tracker ,
0)
Consecutive Quarters of High Realized Profit --> Dmnl
Analysis of units error:
Right hand and left hand units do not match
Consecutive Quarters of High Realized Profit
Has units: Dimensionless
INTEG( high profits tracker
- low profits tracker ,
0)
Has units: Quarter
***********************************************
Error in units for the following equation:
Speculative Expectation of Profits =
INTEG( exuberance
- disappointment ,
0)
Speculative Expectation of Profits --> Dmnl
Analysis of units error:
Right hand and left hand units do not match
Speculative Expectation of Profits
Has units: Dimensionless
INTEG( exuberance
- disappointment ,
0)
Has units: Quarter
***********************************************
***********************************************
Here's the problem--none of the variables actually has the dimension "Quarter." It did at one point, but I changed it. Here is the model:
http://www.econ.tcu.edu/harvey/JTHarvey.mdl
Please forgive the mess as I'm in the middle of a big revision. I actually might not even keep the portion where the error occurs (bottom left), but it's bothering me. Any idea what's wrong?
Thanks!
John
[Edited on 3-24-2010 by RommelDAK]
unit check
Posted: Wed Mar 24, 2010 7:45 am
by LAUJJL
Hi
You do not nedd to use the quarter unit to get the error.
The quarter unit is the time unit of your model.
Vensim calculated that the variable should have a quarter unit instead of a dimensionless one.
Analysis of units error:
Right hand and left hand units do not match
Consecutive Quarters of High Realized Profit
Has units: DIMENSIONLESS (the unit you assigned to the variable Consecutive Quarters of high Realized Profit)
INTEG( high profits tracker
- low profits tracker ,
0)
Has units: QUARTER (the unit that it should have taken into account the equatiion and the DMNL unit you assigned to high profits tracker and low profits tracker.
Regards.
JJ
Posted: Wed Mar 24, 2010 9:43 am
by bob@vensim.com
go to Model>Setting and check to see what units you are using for Time - Vensim thinks it is Quarter and that means a flow with units of xx will be associated with a level with units xx*Quarter. If the flow is dimensionless, the level will be Quarter. Normally profit has units Currency/Time (eg $/Quarter).
Posted: Wed Mar 24, 2010 4:53 pm
by RommelDAK
I think the problem may be a bit deeper than that, but it's definitely related. It's not Currency/Time, incidentally, because it's not profit, but a count of the number of consecutive quarters that profits have been "high" (a subjective value that agents use to determine how well investments have been performing). Maybe that's not a proper use of the flow/level structure? It works perfectly in terms of the behavior it creates, but that structure may be causing other problems.
Thanks all! That gives me something to go on.
Posted: Wed Mar 24, 2010 5:12 pm
by RommelDAK
As I look at this more closely, I'm beginning to see that that's the problem. I'm using the traditional flow-level structure for something other than that for which it was designed.
What I am after is to model the manner in which investors' spontaneous optimism rises cumulatively during an expansion. As realized profits exceed what they generally expect to earn, so investors become more and more excited. Their increasingly-unrealistic expectations are inevitably disappointed and panic and collapse result.
I made the increasingly-unrealistic expectations a nonlinear function of how many consecutive quarters profits have been "high." To get the latter, I created a "high profits tracker," which was simply an if-then that generated a 1 for a single high profits quarter. It is a flow that feeds into Consecutive Quarters of High Realized Profit. Thus, if there are three high-profits quarters in a row, high profits tracker would generate three 1's and Consecutive Quarters of High Realized Profit will equal three. If there is ever a low profits quarter, the if-then in low profits tracker is triggered and Consecutive Quarters of High Realized Profit is flushed empty to zero (by setting outflow at the current value of Consecutive Quarters of High Realized Profit).
I did something similar with disappointment/Speculative Expectations of Profit/exuberance, but it's the exact same structure so I won't go into that.
Sorry for so much detail, but my basic question is whether or not what I've done should be set up in a different format, or am I simply missing the obvious way to set the dimensions so as to eliminate the units check errors?
John
[Edited on 3-24-2010 by RommelDAK]
Posted: Wed Mar 24, 2010 8:40 pm
by RommelDAK
FYI, that was indeed, the problem. I have switched from the stock-flow to a series of fixed delays. It makes it much messier, but avoids (or so I hope--not done yet!) the units issue.
Thanks again!
Posted: Wed Mar 24, 2010 11:21 pm
by RommelDAK
Final update: that fixed it. It now looks like a spiderweb in the the bottom-left corner, but it eliminated the dimensional error.
Posted: Thu Mar 25, 2010 9:44 am
by bob@vensim.com
Hi John,
I would actually use something mode like the original formulation.
Consecutive Quarters of High Realized Profit= INTEG (
high profits tracker-low profits tracker, 0)
Units: Quarter (which is exactly right when you think about it)
Low profits tracker=
IF THEN ELSE(realized profits from investment>low profits defined, 0,
-Consecutive Quarters of High Realized Profit/TIME STEP)
Units: Quarter
This will actually work with a TIME STEP less than one, assuming that low profits defined is less than high profits defined. This does, require Euler Integration, but will probably be more readable than using the DELAY FIXED formulation.
Posted: Thu Mar 25, 2010 11:49 am
by RommelDAK
Thanks, Bob, I'll see if I can make that work.
John