Page 2 of 15

Re: Help with model calibration

Posted: Tue Apr 25, 2017 10:47 am
by Administrator
You need to look at the help system, it has examples on how to read data using the various functions

Re: Help with model calibration

Posted: Tue Apr 25, 2017 1:01 pm
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.

Re: Help with model calibration

Posted: Tue Apr 25, 2017 1:26 pm
by tomfid

Re: Help with model calibration

Posted: Tue Apr 25, 2017 1:29 pm
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?

Re: Help with model calibration

Posted: Tue Apr 25, 2017 2:09 pm
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?

Re: Help with model calibration

Posted: Tue Apr 25, 2017 2:51 pm
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?

Re: Help with model calibration

Posted: Tue Apr 25, 2017 3:15 pm
by tomfid

Re: Help with model calibration

Posted: Tue Apr 25, 2017 3:24 pm
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

Re: Help with model calibration

Posted: Tue Apr 25, 2017 5:59 pm
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?

Re: Help with model calibration

Posted: Tue Apr 25, 2017 8:09 pm
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

Re: Help with model calibration

Posted: Wed Apr 26, 2017 1:21 pm
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

Re: Help with model calibration

Posted: Wed Apr 26, 2017 1:39 pm
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

Re: Help with model calibration

Posted: Wed Apr 26, 2017 10:20 pm
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?

Re: Help with model calibration

Posted: Thu Apr 27, 2017 4:14 am
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

Re: Help with model calibration

Posted: Thu Apr 27, 2017 2:25 pm
by Administrator
What sample model did you try? I've just tried the GET XLS DATA sample, and it worked without issue.

Re: Help with model calibration

Posted: Thu Apr 27, 2017 2:43 pm
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

Re: Help with model calibration

Posted: Thu Apr 27, 2017 4:05 pm
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

Re: Help with model calibration

Posted: Thu Apr 27, 2017 4:06 pm
by tomfid
Xlsx should work. Not xlsm.

Re: Help with model calibration

Posted: Thu Apr 27, 2017 4:52 pm
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

Re: Help with model calibration

Posted: Fri Apr 28, 2017 3:40 am
by leon
I this the command? TIDY2VDF|datafile|vdffile
I've been through the help system, could not really find an example on this

Re: Help with model calibration

Posted: Fri Apr 28, 2017 4:01 am
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!

Re: Help with model calibration

Posted: Fri Apr 28, 2017 8:35 am
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?

Re: Help with model calibration

Posted: Fri Apr 28, 2017 3:06 pm
by leon
Please, find attached the file

Re: Help with model calibration

Posted: Fri Apr 28, 2017 3:08 pm
by leon
I don't see any spreadsheet example like the data I have

Re: Help with model calibration

Posted: Fri Apr 28, 2017 5:57 pm
by tomfid
Run the model. The spreadsheet will launch.