Hi All,
I would like to normalize a variable output from 0 to 1. The formula for this is normalized_var = (var - min_var) / (max_var - min_var)
How do I implement this in DSS? The subscript protocol is not entirely clear to me for iterating. MIN and MAX take two variables and their use is not appropriate in this case.
I found very little on the forum about this, but it is a pretty standard operation. Perhaps I missed something. I just need to know the implementation formulas in Vensim DSS.
Thanks!
Normalizing Variables
-
- Senior Member
- Posts: 136
- Joined: Tue Mar 14, 2023 2:05 am
- Vensim version: DSS
-
- Super Administrator
- Posts: 4829
- Joined: Wed Mar 05, 2003 3:10 am
Re: Normalizing Variables
I think we need more info.
When you mention min_var and max_var, are you referring to the min/max of a variable over the entire simulation?
The following is perfectly valid Vensim syntax, so I'm not sure why it's troublesome to just use this.
normalized_var = (var - min_var) / (max_var - min_var)
When you mention min_var and max_var, are you referring to the min/max of a variable over the entire simulation?
The following is perfectly valid Vensim syntax, so I'm not sure why it's troublesome to just use this.
normalized_var = (var - min_var) / (max_var - min_var)
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
-
- Senior Member
- Posts: 136
- Joined: Tue Mar 14, 2023 2:05 am
- Vensim version: DSS
Re: Normalizing Variables
The problem is that there is no way to search for the min and max, from what I can see in the documentation. If someone could provide the built-in formula for how to find the min and max of a variable output, then I could use the equation.
Thank you!
Thank you!
-
- Super Administrator
- Posts: 4829
- Joined: Wed Mar 05, 2003 3:10 am
Re: Normalizing Variables
You use MIN or MAX
https://www.vensim.com/documentation/fn_min.html
https://www.vensim.com/documentation/fn_max.html
https://www.vensim.com/documentation/fn_min.html
https://www.vensim.com/documentation/fn_max.html
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
-
- Senior Member
- Posts: 136
- Joined: Tue Mar 14, 2023 2:05 am
- Vensim version: DSS
Re: Normalizing Variables
Interesting. The MIN(A, B) must be MIN(self1,self1) for that to work. The “minimum of two alternatives.” That is a bit of nonsense but I can guess and check.
-
- Super Administrator
- Posts: 4829
- Joined: Wed Mar 05, 2003 3:10 am
Re: Normalizing Variables
I'm very confused by this thread.
If you want the min/max during a simulation, you can use those two functions.
If you want the min/max once a simulation has ended, the stats tool will give you these.
Does this solve the problem?
If you want the min/max during a simulation, you can use those two functions.
If you want the min/max once a simulation has ended, the stats tool will give you these.
Does this solve the problem?
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