Search found 2353 matches

by tomfid
Thu Sep 20, 2018 6:21 pm
Forum: Vensim
Topic: Edit MCMC options in .voc or user interface?
Replies: 3
Views: 25

Re: Edit MCMC options in .voc or user interface?

If the optimizer runs into errors starting up the model, it won't run. I'd plug in these values and see why they cause an error. In the 2-step approach, the best way to get confidence bounds is to open up the runname_sample.tab file and look at the 2.5% and 97.5% quantiles of the results. Also, scat...
by tomfid
Thu Sep 20, 2018 6:16 pm
Forum: Vensim
Topic: How to use Markov Chain Monte Carlo in Vensim?
Replies: 31
Views: 6082

Re: How to use Markov Chain Monte Carlo in Vensim?

If there's a statistically principled way to do this, I'm not familiar with it. I would model the losses as an approximation, with sd error = sqrt(losses/unit losses). I think there's another issue, which is that errors are integrated into the stock of survivors, so you should be using the Kalman fi...
by tomfid
Thu Sep 20, 2018 2:25 pm
Forum: Vensim
Topic: Installing Compiler in Vensim
Replies: 2
Views: 14

Re: Installing Compiler in Vensim

Also, I'd recommend updating to version 7.3, which has an improved mdl.bat.
by tomfid
Wed Sep 19, 2018 6:16 pm
Forum: Vensim
Topic: Edit MCMC options in .voc or user interface?
Replies: 3
Views: 25

Re: Edit MCMC options in .voc or user interface?

I think it's actually better to keep things separate - do a Powell optimization, then restart from the optimal point and do a separate MCMC. Or, skip Powell altogether and go straight to MCMC.
by tomfid
Wed Sep 19, 2018 5:07 pm
Forum: Vensim
Topic: How to use Markov Chain Monte Carlo in Vensim?
Replies: 31
Views: 6082

Re: How to use Markov Chain Monte Carlo in Vensim?

The other problem with using Weibull is that it makes scrap=f(time) which is not robust or generally applicable. If you're planning to use the scrap submodel in more general conditions, you really need scrap=f(state). Options would be: - an explicit stock-flow aging chain, - DELAY N as a shortcut fo...
by tomfid
Wed Sep 19, 2018 5:01 pm
Forum: Vensim
Topic: How to use Markov Chain Monte Carlo in Vensim?
Replies: 31
Views: 6082

Re: How to use Markov Chain Monte Carlo in Vensim?

This gets a beyond my area of expertise. I know there's a whole literature on hazard rate estimation that's relevant here. My naive implementation would be something like the following: - the Weibull distribution gives you the expected failure rate and surviving population at any given point in time...
by tomfid
Wed Sep 19, 2018 4:23 pm
Forum: Vensim
Topic: System of differential equations-- estimating parameters
Replies: 22
Views: 88

Re: System of differential equations-- estimating parameters

Generically, the idea of subdividing the problem into smaller estimation problems works. You lose feedback of course, which is a negative particularly if you're doing Kalman filtering. In this case, I'm not sure it would help, because there seem to be several distinct parameterizations of the model ...
by tomfid
Wed Sep 19, 2018 4:13 pm
Forum: Vensim
Topic: Use subscript with existing variable and level in the model
Replies: 17
Views: 35

Re: Use subscript with existing variable and level in the model

You can select existing variables and use Edit>Set Subscripts to add dimensions to them. Or, you can just manually edit the equations one by one.
by tomfid
Tue Sep 18, 2018 3:40 pm
Forum: Vensim
Topic: System of differential equations-- estimating parameters
Replies: 22
Views: 88

Re: System of differential equations-- estimating parameters

Files attached above: - wrong.cin = changes file for deliberately wrong starting point - states.vpd = payoff comparing model state to data from a base run - states-log.vpd = same, with log transform - params-single.voc = a single Powell search - params-multi.voc = RRandom multistart - params-SA.voc ...
by tomfid
Tue Sep 18, 2018 3:03 pm
Forum: Vensim
Topic: How to use Markov Chain Monte Carlo in Vensim?
Replies: 31
Views: 6082

Re: How to use Markov Chain Monte Carlo in Vensim?

Iteration to estimate the SD of the errors is fine.

The term log(sd) itself is invariant as long as you aren't changing sd in the optimization. It affects other terms, but that's captured already in other terms.

None of this is ever trivial or easy!
by tomfid
Tue Sep 18, 2018 2:59 pm
Forum: Vensim
Topic: System of differential equations-- estimating parameters
Replies: 22
Views: 88

Re: System of differential equations-- estimating parameters

I'd guess that most of the floating point errors are simply cases in which there's explosive exponential growth. Using double precision helps with that, though only briefly at high rates. It also helps to use the log transform in the payoff, to reduce scale differences. If I repeat the experiment wi...
by tomfid
Tue Sep 18, 2018 2:20 pm
Forum: Vensim
Topic: System of differential equations-- estimating parameters
Replies: 22
Views: 88

Re: System of differential equations-- estimating parameters

Robustness implies that any reasonable input or parameterization of the model should result in a reasonable output - i.e. bounded (not infinite), no negative physical quantities, etc. Having an abstract model makes that rather hard to assess or enforce, because none of the parameters correspond with...
by tomfid
Tue Sep 18, 2018 12:24 am
Forum: Vensim
Topic: System of differential equations-- estimating parameters
Replies: 22
Views: 88

Re: System of differential equations-- estimating parameters

I don't think you've exhausted all the options yet! I think improving the robustness of the model should be a high priority. If multiple optima and floating point errors within the parameter bounds are the issue, other software's going to have the same kinds of problems.
by tomfid
Tue Sep 18, 2018 12:19 am
Forum: Vensim
Topic: How to use Markov Chain Monte Carlo in Vensim?
Replies: 31
Views: 6082

Re: How to use Markov Chain Monte Carlo in Vensim?

I think the shrinkage from the non-informative prior is fine. The standard deviation is indeed the sd of the error. The log(sd) term can be omitted if you're not estimating the sd in the optimization, because it just shifts the payoff by a constant amount that's invariant with respect to the paramet...
by tomfid
Mon Sep 17, 2018 7:03 pm
Forum: Vensim
Topic: How to use Markov Chain Monte Carlo in Vensim?
Replies: 31
Views: 6082

Re: How to use Markov Chain Monte Carlo in Vensim?

Try the attached: Weibull calibration 2.mdl The default has 0 weight to priors. I get: Maximum payoff found at: Shape parameter = 2.00946 *Scale parameter = 9.82314 Simulations = 70 Pass = 3 Payoff = -289.904 ... very close to the true parameters. If you turn on the prior weight (=1), I get: Maximum...
by tomfid
Mon Sep 17, 2018 6:29 pm
Forum: Vensim
Topic: How to use Markov Chain Monte Carlo in Vensim?
Replies: 31
Views: 6082

Re: How to use Markov Chain Monte Carlo in Vensim?

A couple things: In the attached model, I still use the explicit expression of the log likelihood (instead of the mixed payoff that you mentioned), just to help myself better understand the logic behind it. Often a good idea! (1) If I did this correctly, the result of maximizing the payoff seems to ...
by tomfid
Mon Sep 17, 2018 6:07 pm
Forum: Vensim
Topic: System of differential equations-- estimating parameters
Replies: 22
Views: 88

Re: System of differential equations-- estimating parameters

I think there are a multiple challenges here. There seem to be a lot of local optima. The usual approach to that would be to use random multistart to explore a lot of starting points, or to use MCMC as a simulated annealer. However, both of those approaches do poorly for me, because parameter bounds...
by tomfid
Mon Sep 17, 2018 4:14 pm
Forum: Vensim
Topic: System of differential equations-- estimating parameters
Replies: 22
Views: 88

Re: System of differential equations-- estimating parameters

Much easier to comment if you can post the model.
by tomfid
Mon Sep 17, 2018 4:10 pm
Forum: Vensim
Topic: System of differential equations-- estimating parameters
Replies: 22
Views: 88

Re: System of differential equations-- estimating parameters

As a check, do you get a better payoff if you run the model with the known true parameters?

Have you tried random multistart? Do you have bounds on your parameters in the control file?
by tomfid
Mon Sep 17, 2018 12:57 pm
Forum: Vensim
Topic: System of differential equations-- estimating parameters
Replies: 22
Views: 88

Re: System of differential equations-- estimating parameters

Twelve is not unreasonably large - this should work.

What do you mean by "not even close" - poor fit, or is this a synthetic data experiment with a known answer?
by tomfid
Fri Sep 14, 2018 12:47 pm
Forum: Vensim
Topic: How to use Markov Chain Monte Carlo in Vensim?
Replies: 31
Views: 6082

Re: How to use Markov Chain Monte Carlo in Vensim?

I used likelihood interchangeably with "prior pdf" which is probably a bit more accurate. The INITIAL TIME check is used because you only compute the prior once, not every time. The first method of computation, using IF THEN ELSE statements, is obsolete now that you can create a mixed payoff. You pr...
by tomfid
Thu Sep 13, 2018 2:53 pm
Forum: Vensim
Topic: System of differential equations-- estimating parameters
Replies: 22
Views: 88

Re: System of differential equations-- estimating parameters

Also, data's always discrete. You can calibrate a continuous model against discrete measurements, even if they're irregular in time.
by tomfid
Thu Sep 13, 2018 2:50 pm
Forum: Vensim
Topic: System of differential equations-- estimating parameters
Replies: 22
Views: 88

Re: System of differential equations-- estimating parameters

Discrete doesn't matter - you just run your model with time step = 1, and exercise appropriate caution: http://metasd.com/2017/11/discrete-time-stinks/
by tomfid
Tue Sep 11, 2018 1:40 pm
Forum: Vensim
Topic: How to run simulation with lookup table change
Replies: 3
Views: 33

Re: How to run simulation with lookup table change

Hopefully a lot of this is covered in https://vensim.com/building-a-simple-vensim-model/

Glad it's working!