I am trying to simulate a (very) simple model of snow fall/accumulation using random walks in the following way:
sf =
Accumulate[RandomVariate[BernoulliDistribution[0.2], 100] *
RandomVariate[GammaDistribution[1, 2], 100] /. {0. -> -0.4}]
ListLinePlot[sf]
I generate Bernoulli trials with a success of probability of 0.2 to simulate days that it snows. On a day that it doesn't snow instead of a simple 0 entry I am introducing a negative drift term of -0.4 to emulate the melting of the snow.
Where I am having trouble is that you can't ever have negative snowfall. I want the walker to always remain bigger than or equal to 0. However, I can't just send all negative entries to 0 as that would eliminate the data of days where it snows but the drift term is larger than the snowfall.
Thanks.