Advice on the right statistical distribution
Please move this to non-advanced stats if I have it in the wrong forum.
I am science degree qualified but not with a maths degree, what maths I have had is a bit rusty and i am looking for some advice on a statistical distribution.
I am looking to simulate a node in a network randomly going 'out of action' from time to time, but with a particular probability.
I am unsure of the best distribution and parameters to use.
For example I may want the node to be 'out of action' say 10% of the time, but I think a straight .1 chance to go off .9 chance to go back on will make the node to be going off for a lot of very short periods very short periods. I think I need another parameter may be and maybe the chance of going off increase around may be some average off time.
Can use the poisson or binomial some where here.
I wonder if I could have parameters frequency period fp (eg 1hr (24 times a day)) and mean percentage down time pdt then do something like
randomPoisonDist down(fp * pdt/100)
randomPoisonDist up(fp * (100-pdt)/100)
next_down_time = now+up.next()
next_up_time = now+down.next()
Re: Advice on the right statistical distribution
I would use an exponential distribution instead, this allows to take the limit fp->0, without changing the state too often or too predictable.
As approximation, you could use this algorithm every (small) timestep dt:
If it is on, set it to off with probability pdt*dt/fp.
If it is off, set it to on with probability (1-pdt)*dt/fp.
The equilibrium is "on" with probability p=(1-pdt*dt/fp)*p + (1-pdt)*dt/fp*(1-p). This is solved by p=1-pdt which is the result you want.
The probability of a change in dt is then given by 2(1-pdt)*pdt*dt/fp and the average time between changes is 2*(1-pdt)*dt/fp.