three consecutive values

Use this forum to post Vensim related questions.
Post Reply
bahri
Senior Member
Posts: 61
Joined: Wed May 11, 2016 4:43 am
Vensim version: DSS

three consecutive values

Post by bahri »

Hi,

I want to set "fluctuated price1" to be "1" as long as "randomized prices" are not zero in three-consecutive time.
(otherwise set "fluctuated price1" to be "0" )

What shall I do?

I attach the model.
Attachments
example_vensim.mdl
(1.18 KiB) Downloaded 161 times
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: three consecutive values

Post by Administrator »

I don't understand what you want to do.

Do you want to take a random sample and make it last for a certain amount of time?
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
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: three consecutive values

Post by tomfid »

If you want to test for price = 0, that event is incredibly unlikely, even if the mean of the distribution is 0, and three in a row will probably never happen, even if you run the model for years. Your Normal distribution is truncated at 1, and in any case 0 is 14 standard deviations below the mean, so it will definitely never happen.

However, if you change the distribution and the test so that there's some likelihood of price<=0, you could count those instances with a stock:
count price 0.mdl
(2.31 KiB) Downloaded 163 times
bahri
Senior Member
Posts: 61
Joined: Wed May 11, 2016 4:43 am
Vensim version: DSS

Re: three consecutive values

Post by bahri »

Great!.
Thanks Tom.
Cheers,
Bahri
Post Reply