Sensitivity analysis using the file option in a subscripted model
-
- Junior Member
- Posts: 6
- Joined: Thu Aug 24, 2023 7:00 pm
- Vensim version: DSS
Sensitivity analysis using the file option in a subscripted model
How to run sensitive analyses using the file option when the model is subscripted? I get errors when using subscripted parameters.
-
- Super Administrator
- Posts: 4827
- Joined: Wed Mar 05, 2003 3:10 am
Re: Sensitivity analysis using the file option in a subscripted model
What errors are you getting?
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: Sensitivity analysis using the file option in a subscripted model
What error are you seeing?
I'm guessing that you're putting varname[range] in the headers. I don't think that works - you need to provide a separate column for each varname[element].
I'm guessing that you're putting varname[range] in the headers. I don't think that works - you need to provide a separate column for each varname[element].
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Junior Member
- Posts: 6
- Joined: Thu Aug 24, 2023 7:00 pm
- Vensim version: DSS
Re: Sensitivity analysis using the file option in a subscripted model
This is the error:
Bad constant-"FracDWI[Male.Age15]" in file MCMC4.txt.
Bad constant-"FracDWI[Male.Age15]" in file MCMC4.txt.
-
- Junior Member
- Posts: 6
- Joined: Thu Aug 24, 2023 7:00 pm
- Vensim version: DSS
Re: Sensitivity analysis using the file option in a subscripted model
Yes, I inserted the varnames like fracDWI[Male,Age15] in the headers (in a separate column for each of them). How they should be entered?
-
- Super Administrator
- Posts: 4827
- Joined: Wed Mar 05, 2003 3:10 am
Re: Sensitivity analysis using the file option in a subscripted model
Male.Age15 cannot be a correct subscript for Vensim, any subscript elements with a "." need to be quoted.
So the correct syntax would be
FracDWI["Male.Age15"]
So the correct syntax would be
FracDWI["Male.Age15"]
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
-
- Super Administrator
- Posts: 4827
- Joined: Wed Mar 05, 2003 3:10 am
Re: Sensitivity analysis using the file option in a subscripted model
Or try the following, replace the "." with a ",".
FracDWI[Male,Age15]
FracDWI[Male,Age15]
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
-
- Junior Member
- Posts: 6
- Joined: Thu Aug 24, 2023 7:00 pm
- Vensim version: DSS
Re: Sensitivity analysis using the file option in a subscripted model
sorry for the typo. I used [Male,Age15].Administrator wrote: ↑Fri Aug 25, 2023 2:56 pm Male.Age15 cannot be a correct subscript for Vensim, any subscript elements with a "." need to be quoted.
So the correct syntax would be
FracDWI["Male.Age15"]
The model is fine; the only problem is when I use sensitivity analyses using the file option. I have separate columns for my parameters in the text file. For example fracDWI[Male,Age15], fracDWI[Male,Age16],...
I am not sure how the headers should be changed to run the sensitivity analysis using the file option.
-
- Super Administrator
- Posts: 4827
- Joined: Wed Mar 05, 2003 3:10 am
Re: Sensitivity analysis using the file option in a subscripted model
If you can upload what you have, we can take a look.
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
-
- Super Administrator
- Posts: 4827
- Joined: Wed Mar 05, 2003 3:10 am
Re: Sensitivity analysis using the file option in a subscripted model
Maybe the best thing to do is get a simple example working using the sensitivity wizard, that will give you a working file that you can then edit using a text editor.
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
-
- Junior Member
- Posts: 6
- Joined: Thu Aug 24, 2023 7:00 pm
- Vensim version: DSS
Re: Sensitivity analysis using the file option in a subscripted model
I used a simple version (parameters without any subscript) and I did not get any error. As soon as I add a parameter with subscript, I get error.
I would like to share my text file that I use in my sensitivity analysis but the attachment cannot be a text file so I am attaching an excel file that I use to convert to text.
- Attachments
-
- MCMC5.xls
- (61.5 KiB) Downloaded 601 times
Re: Sensitivity analysis using the file option in a subscripted model
When I save this as tab-delimited text, Excel quotes the column headers like
"fracDWI[Male,Age15]"
This is a nonstandard behavior, because quotes are not needed when the delimiter is tab (only csv).
Unfortunately this is not legitimate quoting in Vensim (the subscript brackets should not be included).
A quick search/replace of the text file to delete the " should solve the problem.
"fracDWI[Male,Age15]"
This is a nonstandard behavior, because quotes are not needed when the delimiter is tab (only csv).
Unfortunately this is not legitimate quoting in Vensim (the subscript brackets should not be included).
A quick search/replace of the text file to delete the " should solve the problem.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: Sensitivity analysis using the file option in a subscripted model
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Junior Member
- Posts: 6
- Joined: Thu Aug 24, 2023 7:00 pm
- Vensim version: DSS
Re: Sensitivity analysis using the file option in a subscripted model
tomfid wrote: ↑Mon Sep 04, 2023 2:49 pm When I save this as tab-delimited text, Excel quotes the column headers like
"fracDWI[Male,Age15]"
This is a nonstandard behavior, because quotes are not needed when the delimiter is tab (only csv).
Unfortunately this is not legitimate quoting in Vensim (the subscript brackets should not be included).
A quick search/replace of the text file to delete the " should solve the problem.
Thank you Tom. Editing the text file (deleting " that excel generated and extra spaces) resolved the problem. Thanks for your help.