Search found 2590 matches

by tomfid
Wed Apr 07, 2010 1:31 am
Forum: Vensim
Topic: The question of optimization function
Replies: 3
Views: 953

I always thought it was a direction set method. Doesn't conjugate gradient require derivatives (hence the name)?
by tomfid
Tue Apr 06, 2010 10:00 pm
Forum: Vensim
Topic: The question of optimization function
Replies: 3
Views: 953

A good start is to take a look at the online help; look in the index for "Payoff Computation" In short, for calibration optimization, the payoff is the sum over time of weight*(model-data)^2. For policy optimization, it's just the sum of weight*modelvar. Kalman filter payoffs are slightly more compl...
by tomfid
Mon Apr 05, 2010 7:03 pm
Forum: Vensim
Topic: New user with newbie problems..please help
Replies: 17
Views: 4036

Incidentally, the array trick works for other things that you might normally accomplish with a For...Next loop. For example, if you want to find the maximum of 20 draws from a random distribution, just define

i : (i1-i20)
draw = RANDOM SOMETHING(...)
max val = VMAX(draw[i!])

Tom
by tomfid
Mon Apr 05, 2010 3:50 pm
Forum: Vensim
Topic: Rounding the value of levels.
Replies: 3
Views: 919

If you're using Vensim DSS, it's handy to put JJ's formula in a macro, like :MACRO: ROUND(x,digits) ROUND = INTEGER(x*10^digits+0.5)/10^digits ~ x ~ | :END OF MACRO: a test: digits= 1 ~ [-2,2,1] ~ | test x= ROUND(453.123,digits) ~ ~ | Note that precision is also limited by the floating point format.
by tomfid
Thu Apr 01, 2010 9:53 pm
Forum: Vensim
Topic: Rainfall probabilities
Replies: 30
Views: 4198

I posted a version of the Pink Noise generator that includes a :MACRO: version here: http://models.metasd.com/2010/03/pink-noise/

Tom
by tomfid
Tue Mar 30, 2010 8:20 pm
Forum: Vensim
Topic: New user with newbie problems..please help
Replies: 17
Views: 4036

I'd strongly urge you to reconsider. The basic stock-flow structure here seems quite well articulated. Revising the rates so that they rely only on information actually available ( e.g., stock/processingTime ) would be a quite simple change here. A look at the sample project model in Vensim>Models>M...
by tomfid
Tue Mar 30, 2010 1:28 pm
Forum: Vensim
Topic: New user with newbie problems..please help
Replies: 17
Views: 4036

JJ is correct on the level-rate sequence. If you connect rate A to rate B directly, that's a formal statement that the causal effect of A on B is instantaneous. If you connect rates circularly, A -> B -> C -> A as you've done in the draft model, then A, B, C represent a system of simultaneous equati...
by tomfid
Tue Mar 30, 2010 12:01 am
Forum: Vensim
Topic: New user with newbie problems..please help
Replies: 17
Views: 4036

A few other observations: Generally it's easier to think of systems like this in continuous time (the limit as TIME STEP gets small) rather than discrete x(t) = f( x(t-1) ) notation. For most purposes, a test of a good model with an appropriate time step is to simply halve the time step and see if t...
by tomfid
Mon Mar 29, 2010 11:35 pm
Forum: Vensim
Topic: New user with newbie problems..please help
Replies: 17
Views: 4036

I took a look at the model. The basic conceptual problem is the rate-to-rate connections from Rework Error Generation Rate to Rework Error Detection Rate to Rework Rate (and back). Making a rate to rate connection amounts to saying that the relationship is instantaneous, which would imply that error...
by tomfid
Mon Mar 29, 2010 2:17 pm
Forum: Vensim
Topic: New user with newbie problems..please help
Replies: 17
Views: 4036

One more reference on project models: David Ford's thesis: http://dspace.mit.edu/handle/1721.1/11105

Tom
by tomfid
Mon Mar 29, 2010 2:15 pm
Forum: Vensim
Topic: New user with newbie problems..please help
Replies: 17
Views: 4036

Another good reference is Tarek Abdel-Hamid's dissertation. It's in a book, with Stu Madnick: http://www.amazon.com/Software-Project-Dynamics-Integrated-Approach/dp/0138220409/ref=sr_1_1?ie=UTF8&s=books&qid=1269871961&sr=8-1 (cheap if you buy a used copy) The original thesis is free here: http://hdl...
by tomfid
Thu Mar 25, 2010 3:03 pm
Forum: Vensim
Topic: Subscript ranges
Replies: 2
Views: 759

One way to do this is to forget about mapping and use a matrix to capture all possible interactions between age groups. Here's an outline of a simplified version of your problem: age: (age1-age4) fromAge <-> age toAge <-> age totalInfections[toAge] = sum(infections[fromAge!,toAge]) infections[fromAg...
by tomfid
Thu Mar 25, 2010 2:52 pm
Forum: Vensim
Topic: Rainfall probabilities
Replies: 30
Views: 4198

Along the lines of JJ's thinking: Discreteness probably matters, in the sense that daily rain of 1mm is different from 30mm once a month. However, it's possible that randomness in rainfall arrival is not important, or hides insight. In that case, you could model the short-term rain process as a PULS...
by tomfid
Wed Mar 24, 2010 9:34 pm
Forum: Vensim
Topic: Rainfall probabilities
Replies: 30
Views: 4198

Here's a model that's close to what I had in mind (no SAMPLE IF TRUE though). Rainfall variation is decomposed into two bits: Long term, year-to-year variability (drought, ENSO, or whatever) is a lognormal term applied to the mean seasonal distribution. Short term, day-to-day variation in rainfall i...
by tomfid
Wed Mar 24, 2010 9:06 pm
Forum: Vensim
Topic: Rainfall probabilities
Replies: 30
Views: 4198

Another possible approach here would be to get some real daily rainfall data, and use that as a driver - that way you'd be sure not to miss any stochastic structure that you inadvertently failed to model.
by tomfid
Wed Mar 24, 2010 9:04 pm
Forum: Vensim
Topic: Rainfall probabilities
Replies: 30
Views: 4198

I think a key question here is, what is the time time constant of the soil evaporation process? It seems like it'd be important to model rainfall at frequencies up to some cutoff given by that, and no more.
by tomfid
Wed Mar 24, 2010 4:17 pm
Forum: Vensim
Topic: Rainfall probabilities
Replies: 30
Views: 4198

Looking at rainfall_testing_4, a few observations: The Sterman pink noise structure isn't as good as Ed Anderson's version. I'll post the latter when I get a chance. It's weird that "effect of drought" goes negative - seems unphysical. The realized rainfall doesn't track the input lookup "rainfall p...
by tomfid
Tue Mar 23, 2010 2:43 pm
Forum: Vensim
Topic: Rainfall probabilities
Replies: 30
Views: 4198

Another sampling approach, simpler than pink noise, is: rainfall = rainfall amount*rainfall occurs rainfall occurs = IF THEN ELSE( rainfall random input > rainfall prob, 1, 0) rainfall random input = SAMPLE IF TRUE( PULSE TRAIN(...) > 0, RANDOM UNIFORM( ... ), RANDOM UNIFORM( ... ) ) rainfall amount...
by tomfid
Sat Mar 13, 2010 1:50 pm
Forum: Vensim
Topic: Move items from one view to another
Replies: 2
Views: 687

Cut & paste is the way to do this.

When you cut, you want to choose the "remove from this view but do not change models structure" option.

When you paste, select the "Picture" mode rather than "Replicate". Replicate creates new variables; picture pastes the existing ones.

Tom
by tomfid
Wed Mar 10, 2010 12:14 am
Forum: Vensim
Topic: Optimize for particular value at a specific time
Replies: 15
Views: 2119

Originally posted by karankhosla Thanks Tom! I'm going to try it out. I presume the logic behind it is that, as the weight is multiplied to the payoff at each time step, the pulse function forces the value of the payoff to be "x" at a particular time and zero elsewhere, which forces the optimizer t...
by tomfid
Wed Mar 10, 2010 12:05 am
Forum: Vensim
Topic: using reality checks to build models
Replies: 6
Views: 1525

I think the idea of using RCs in a more automated fashion for model specification is interesting. In a way, the usual SD approach to specifying lookups is a bit like RCs. Good practitioners ask a series of questions: what happens at 0? what happens at high values? ... Those get at SME knowledge abou...
by tomfid
Fri Mar 05, 2010 3:33 pm
Forum: Vensim
Topic: Extract data from subscripts
Replies: 4
Views: 945

If you right-click the table tool, and check the "2d subscripting" option at top right, you can get it to present array tables rather than tables vs. time.

If your arrays have more than two dimensions, your best option is probably to export the data to Excel or use the ODBC tools.
by tomfid
Tue Mar 02, 2010 10:51 pm
Forum: Vensim
Topic: Optimize for particular value at a specific time
Replies: 15
Views: 2119

pen.k = pen.j +dt*(Desired Population - Population)^2: pen0 = 0. You don't need to perform the integration step in Coyle's formula, because Vensim integrates payoffs for you. The equivalent would be: *C population|desired population/weight If you make your weight something like PULSE( target_time, ...
by tomfid
Thu Feb 18, 2010 4:42 pm
Forum: Vensim
Topic: Monte-Carlo output
Replies: 2
Views: 766

I think what you'll need to do is export the output to a spreadsheet using Model>Export Dataset..., so you can perform those calculations externally.
by tomfid
Thu Feb 18, 2010 4:40 pm
Forum: Vensim
Topic: Allocate Available function
Replies: 18
Views: 2707

A basic assumption of the ALLOCATE logic, as I understand it, is that the quantities allocated are essentially an undifferentiated commodity. Given that the substitution relationships among resources are not symmetric, I think that assumption is violated. Therefore it does make sense to me to use a ...