I'm trying to find a formula which can plot points that move down one unit 60% of the time, and up two units 40% of the time, similar to how the stock markets move, in an up trend.
I started with the triangle wave formula, but I don't know exactly how to incorporate percentage chance, or compounding effects.
Thanks!
What you’re describing to me sounds like a 1D random walk with right step 2, left step -1, and right step probability 0.4. To define this formally, let ${X_1,X_2,...}$ be a sequence of independent, identically distributed random variables with common distribution given by $$P(X_1=2)=0.4$$ $$P(X_1=-1)=0.6.$$ Then your random function $F$ will be defined on the integers by $$F(n) = \sum_{i=1}^n X_i.$$
To fill in the gaps, following your triangle wave model, we would interpolate linearly by setting $$F(n+a)= (1-a)F(n)+aF(n+1)$$ for $n\ge 0$ any integer and $0<a<1$. But to really fill in the gaps properly, you would want to instead use Brownian motion, which is a reasonable model for how the stock market actually behaves.