Maheu and McCurdy (2000)

If you are seeking RATS code for implementing a particular technique or replicating results from a paper, post your request here. Be sure to include complete citations for any papers or books.
fan
Posts: 215
Joined: Wed Jun 19, 2013 5:14 pm

Maheu and McCurdy (2000)

Unread post by fan »

HI Tom,

By any change, could you please kindly provide the example code for Maheu J, McCurdy TH. 2000. Identifying bull and bear markets in stock returns. Journal of Business and Economics Statistics 18:100-112? I am trying to replicate a MS model with duration-dependent transitions. Similar examples, like Durland, J. M. and T.H. McCurady(1994): Duration_Dependent Transition in a Markov Model of US GNP Growth, Journal of Business &Economic Statistics, 12(3),279-288, are also helpful. Thank you in advance.
fan
Posts: 215
Joined: Wed Jun 19, 2013 5:14 pm

Re: Maheu and McCurdy (2000)

Unread post by fan »

Anyone has put up some codes?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Maheu and McCurdy (2000)

Unread post by TomDoan »

I don't find that particularly convincing. Unlike a standard "hazard" model where you probably will have 100's if not 1000's of individuals, you have only a relative handful of transitions each way in the typical application, so the ability to tease out differences in transition probabilities due to timing is going to be quite weak. However, if you want to pursue it, the following will compute the runs of each regime given the expanded regime matrix. You can use that to fill in the expanded transition matrix.

Code: Select all

dec vect[vect[int]] MSRuns(nregimes)
do i=1,nregimes
   dim MSRuns(i)(nexpand)
end do i
do i=1,nregimes
   do j=1,nexpand
      compute MSRuns(i)(j)=0
      do k=1,nlags+1
         if MSLagRegimeX(j,k)==i
            compute MSRuns(i)(j)+=1
         else
            break
      end do k
   end do j
end do i
fan
Posts: 215
Joined: Wed Jun 19, 2013 5:14 pm

Re: Maheu and McCurdy (2000)

Unread post by fan »

TomDoan wrote:I don't find that particularly convincing. Unlike a standard "hazard" model where you probably will have 100's if not 1000's of individuals, you have only a relative handful of transitions each way in the typical application, so the ability to tease out differences in transition probabilities due to timing is going to be quite weak. However, if you want to pursue it, the following will compute the runs of each regime given the expanded regime matrix. You can use that to fill in the expanded transition matrix.

Code: Select all

dec vect[vect[int]] MSRuns(nregimes)
do i=1,nregimes
   dim MSRuns(i)(nexpand)
end do i
do i=1,nregimes
   do j=1,nexpand
      compute MSRuns(i)(j)=0
      do k=1,nlags+1
         if MSLagRegimeX(j,k)==i
            compute MSRuns(i)(j)+=1
         else
            break
      end do k
   end do j
end do i
Thank you for your code.
Post Reply