Random walk under changing conditions I have a random walk where by at certain times or conditions the increments follow one distribution, and then another distribution under different conditions - how can I model this random walk (states can have fixed or random probabilities)
For example,
An economy has a bull and bear state with transition probabilties of staying the same as 80% and moving to the other state as 20%. The increments of a random walk of exchange rates follow a t-distribution in a bull state and a lognormal distribution in a bear state. How would you go about modelling the exchange rate random walk?
 A: It sounds like a Hidden Markov model will do exactly what you want. A HMM assumes there is a discrete set of latent (unobservable) states which evolve according to a discrete time Markov process and generate observations which depend only on the current state. Thus a HMM is defined by a set of latent states $Q$, an initial distribution $p(q)$, a transition probability $p(q | q^\prime)$, and an emission probability $p(o|q)$. 
Given a state hidden state sequence $q_1 q_2 \cdots q_T$ and observation seqeunce $o_1 o_2 \cdots o_T$ the joint probability can be calculated as
$$
p(q_1, \ldots, q_T, o_1, \ldots, o_T) = p(q_1)P(o_1|q_1)\prod_{t=2}^T p(q_t|q_{t-1})P(o_t|q_t).
$$
For your particular example you would have 2 latent states (one for bear and the other for bull), with the emission distribution being t and normal respectively.
A: 
The increments of a random walk of exchange rates follow a
  t-distribution in a bull state and a lognormal distribution in a bear
  state

If by increment you mean the change from step to step, I don't understand how this can follow a lognormal distribution since these values will all be positive. The below R code uses a t distribution with 10 df and center=1 in the bull state and a normal distribution with mean=-1 and sd=3 in the bear state. Points are blue when in the bull state, and red in bear.

state<-1
duration<-1000
x<-matrix(nrow=duration, ncol=3)
x[1,]<-cbind(1,state,100)

for(t in 2:duration){
  transition<-rbinom(1,1,.2)

  if(transition==1){
    if(state==1){
      state=0
    }else{
      state=1
    }
  }
  if(state==0){
    x.new<-x[t-1,3]+rnorm(1,-1,2)
  }else{
    x.new<-x[t-1,3]+rt(1,10,1)
  }
  x[t,]<-cbind(t,state,x.new)

  plot(x[,1],x[,3],
       xlab="Time", ylab="Exchange Rate", 
       col=c("Red","Blue")[1+x[,2]])
}

