Help with model calibration

Use this forum to post Vensim related questions.
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Help with model calibration

Post by Administrator »

You need to look at the help system, it has examples on how to read data using the various functions
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
leon
Senior Member
Posts: 192
Joined: Tue Feb 21, 2017 11:11 pm
Vensim version: PRO

Re: Help with model calibration

Post by leon »

Administrator wrote:You need to look at the help system, it has examples on how to read data using the various functions
Could you please share any specific links that might help? Sorry I can't find it.
leon
Senior Member
Posts: 192
Joined: Tue Feb 21, 2017 11:11 pm
Vensim version: PRO

Re: Help with model calibration

Post by leon »

Administrator wrote:You need to look at the help system, it has examples on how to read data using the various functions
Is it this page? https://www.vensim.com/documentation/in ... ?22300.htm
Am I going to write the function at the place of my model equations?
leon
Senior Member
Posts: 192
Joined: Tue Feb 21, 2017 11:11 pm
Vensim version: PRO

Re: Help with model calibration

Post by leon »

I start to have a sense of where I'm going.

Few questions:
1) I have historical data on 3 variables from my model on each driver (monthly driving, errors/mile, and errors/month). Can I just import data on 2 variables: errors/mile and monthly driving? Just because the third variable (errors/month) is a product of the other 2 variables. Or is it better to import in the data on the 3 variables)
2) The function used to import the data is written at the place of the equation editor. Is this imported data the baserun? Do do I need to now write in my model equations for the next run?
leon
Senior Member
Posts: 192
Joined: Tue Feb 21, 2017 11:11 pm
Vensim version: PRO

Re: Help with model calibration

Post by leon »

I went through the electric example. It looks like I need to calibrate driver by driver, and maybe average the model parameters. Is that what you were suggesting?
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Help with model calibration

Post by tomfid »

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

Re: Help with model calibration

Post by tomfid »

Few questions:
1) I have historical data on 3 variables from my model on each driver (monthly driving, errors/mile, and errors/month). Can I just import data on 2 variables: errors/mile and monthly driving? Just because the third variable (errors/month) is a product of the other 2 variables. Or is it better to import in the data on the 3 variables)
I tend to import as few things as possible (then there's less to break), and use data equations to calculate things that are products of other variables.

However, in this case, your data is so simple, I'd just import it all - you can always ignore some of it.
2) The function used to import the data is written at the place of the equation editor. Is this imported data the baserun? Do do I need to now write in my model equations for the next run?
If you're using GET XLS DATA, you'll want two separate things: the modeled value in one equation, and the data value in a different equation. I normally prefix the later with "data" to make it clear what's what. So, you might have:
error rate = f( miles driven, other stuff ) ~ errors/month
data error rate := GET XLS DATA( ... ) ~ errors/month
leon
Senior Member
Posts: 192
Joined: Tue Feb 21, 2017 11:11 pm
Vensim version: PRO

Re: Help with model calibration

Post by leon »

Thanks so mcu for your help.
Since it's data series for a set of drivers, do I have to import data series for each driver, calibrate, record the parameters till I finish the set of drivers? Then average the model parameters? Or is there a way to import and calibrate all drivers at once?
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Help with model calibration

Post by tomfid »

Definitely do it all at once if possible. I think what you want to do is add an array dimension to the model for the Driver ID. See https://www.vensim.com/documentation/usr17.htm
leon
Senior Member
Posts: 192
Joined: Tue Feb 21, 2017 11:11 pm
Vensim version: PRO

Re: Help with model calibration

Post by leon »

I got stuck on the array. I couldn't find the Edit>Set Subscripts. I've emailed you the model and also wanted to make sure I have the right format for the data
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Help with model calibration

Post by Administrator »

I'd really urge you to start looking in the help system, it's all in there.
http://www.vensim.com/documentation/ind ... ?21220.htm
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
leon
Senior Member
Posts: 192
Joined: Tue Feb 21, 2017 11:11 pm
Vensim version: PRO

Re: Help with model calibration

Post by leon »

I worked through the array.

I'm still struggling with the GET XLS DATA.
You mentioned that XLS files are blocked because they contain macros. What extension should I use? XLSX? ELSE?

I'm still not sure how the data should be formatted given that I have array set up. Let's assume I have 2 drivers and 2 data variables, and time scale is 1-3.
DriverID Month var1 var2
Driver1 1 data data
Driver1 2 data data
Driver1 3 data data
Driver2 1 data data
Driver2 2 data data
Driver2 3 data data

Is this how the data should be structured to be imported?
leon
Senior Member
Posts: 192
Joined: Tue Feb 21, 2017 11:11 pm
Vensim version: PRO

Re: Help with model calibration

Post by leon »

If the data format above is correct, how would you write the equation?
Please help, I've followed the example in the help system and it did not work
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Help with model calibration

Post by Administrator »

What sample model did you try? I've just tried the GET XLS DATA sample, and it worked without issue.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
leon
Senior Member
Posts: 192
Joined: Tue Feb 21, 2017 11:11 pm
Vensim version: PRO

Re: Help with model calibration

Post by leon »

I've tried these 2 examples:
https://www.vensim.com/documentation/in ... s_data.htm
http://www.ventanasystems.co.uk/forum/v ... php?t=6136

I'm wondering if it's not because I have a set of drivers. I'm not sure how Vensim will know when to stop on each driver
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Help with model calibration

Post by tomfid »

Your data is in Tidy Data format, so you could use TIDY2VDF (in a command script) to import it. It won't work with GET XLS as is.
https://www.vensim.com/documentation/tidy2vdf.htm
https://www.vensim.com/documentation/tidy2vdf.htm
GET XLS requires a single array for each variable, with time on one axis and driverID on the other. So, you could also reformat your data that way.

Look up GET XLS DATA in the help system, and take a look at the sample model GET XLS DATA[ss].mdl that's linked to the topic.
https://www.vensim.com/documentation/in ... s_data.htm
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Help with model calibration

Post by tomfid »

Xlsx should work. Not xlsm.
leon
Senior Member
Posts: 192
Joined: Tue Feb 21, 2017 11:11 pm
Vensim version: PRO

Re: Help with model calibration

Post by leon »

Yeah the data seems in the Tidy Data format but in Excel file. The way the command TIDY2VDF should be used is not explained. Is it a function?
I'm sorry I'm new to this
leon
Senior Member
Posts: 192
Joined: Tue Feb 21, 2017 11:11 pm
Vensim version: PRO

Re: Help with model calibration

Post by leon »

I this the command? TIDY2VDF|datafile|vdffile
I've been through the help system, could not really find an example on this
leon
Senior Member
Posts: 192
Joined: Tue Feb 21, 2017 11:11 pm
Vensim version: PRO

Re: Help with model calibration

Post by leon »

I also went through the GET XLS DATA[ss].mdl you sent. I can only see functions written there; I have no idea about the data structure for which those functions were applied to. Your help would be much appreciated!
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Help with model calibration

Post by Administrator »

If you upload the data you do have, we can take a look.
I have no idea about the data structure for which those functions were applied to
The example also has an Excel spreadsheet, have you looked in that?
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
leon
Senior Member
Posts: 192
Joined: Tue Feb 21, 2017 11:11 pm
Vensim version: PRO

Re: Help with model calibration

Post by leon »

Please, find attached the file
Attachments
icdata2.xls
(29 KiB) Downloaded 110 times
leon
Senior Member
Posts: 192
Joined: Tue Feb 21, 2017 11:11 pm
Vensim version: PRO

Re: Help with model calibration

Post by leon »

I don't see any spreadsheet example like the data I have
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Help with model calibration

Post by tomfid »

Run the model. The spreadsheet will launch.
Post Reply