I need to find a computationally simple process for the movement of interest rates. In this simplified model, an interest rate can have 3--5 possible values, and its movement is characterized by a matrix of transition probabilities (ie, it is a Markov process). I would like to estimate this process from a given set of data. For example, let the interest rate time series be: 7 3 8 2 5 9 6 Assume that the discretized variable can take the following values: (3, 5, 8), then we find the nearest discrete point and give its index: 3 1 3 1 2 3 2 Then estimate the transition probabilities. I have the following questions: - how should I select the discrete set of values that the variable can assume? Eg simply get the maximum and minimum, and divide this interval into, say, three pieces? Or estimate the mean, and make the other two values mean plus-minus one standard deviation? - once the variable is discretized, how do I transform each data point to its discretized value (its index)? - the most important: how should I estimate the transition probabilities? References to introductory literature on estimating Markov chains like this would be welcome. Most importantly, I need to know how robust an estimation is to selecting the discrete points, or is there a simple "goodness of fit" estimation. Thanks, Tamas Papp -- Tam?s K. Papp E-mail: tpapp at axelero.hu (preferred, especially for large messages) tpapp at westel900.net Please try to send only (latin-2) plain text, not HTML or other garbage.
On 1 Oct 2003 at 17:14, Tamas Papp wrote:> I need to find a computationally simple process for the movement of > interest rates. In this simplified model, an interest rate can have > 3--5 possible values, and its movement is characterized by a matrix of > transition probabilities (ie, it is a Markov process). > > I would like to estimate this process from a given set of data. > > For example, let the interest rate time series be: > > 7 3 8 2 5 9 6 > > Assume that the discretized variable can take the following values: > (3, 5, 8), then we find the nearest discrete point and give its index: > > 3 1 3 1 2 3 2 > > Then estimate the transition probabilities. > > I have the following questions: > > - how should I select the discrete set of values that the variable can > assume? Eg simply get the maximum and minimum, and divide this > interval into, say, three pieces? Or estimate the mean, and make the > other two values mean plus-minus one standard deviation? >?Try with simulation what is best, after yuou have solved the estimation problem?> - once the variable is discretized, how do I transform each data point > to its discretized value (its index)? > > - the most important: how should I estimate the transition > probabilities? > > References to introductory literature on estimating Markov chains like > this would be welcome.A good reference covering this is U. Narayan Bhat: "Elements of Applied Stochastic Processes". For an almost ML solution, condition on the first observation, then take each transition i -> somewhere as an observation from the multinomial distribution given by the i'th row of the transition matrix, and use the multinomial estimates. Kjetil Halvorsen Most importantly, I need to know how robust an> estimation is to selecting the discrete points, or is there a simple > "goodness of fit" estimation. > > Thanks, > > Tamas Papp > > -- > Tam?s K. Papp > E-mail: tpapp at axelero.hu (preferred, especially for large messages) > tpapp at westel900.net > Please try to send only (latin-2) plain text, not HTML or other garbage. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
On 01-Oct-03 Tamas Papp wrote:> I need to find a computationally simple process for the movement of > interest rates. In this simplified model, an interest rate can have > 3--5 possible values, and its movement is characterized by a matrix of > transition probabilities (ie, it is a Markov process). > > I would like to estimate this process from a given set of data. > > For example, let the interest rate time series be: > 7 3 8 2 5 9 6 > Assume that the discretized variable can take the following values: > (3, 5, 8), then we find the nearest discrete point and give its index: > 3 1 3 1 2 3 2 > Then estimate the transition probabilities. > > I have the following questions: > - how should I select the discrete set of values that the variable can > assume? Eg simply get the maximum and minimum, and divide this > interval into, say, three pieces? Or estimate the mean, and make the > other two values mean plus-minus one standard deviation?I would suggest dividing the interval, trying to get equal numbers in each interval. If (e.g. because the originals are discrete) this can't quite be done, try to find an similar arrangement which maximises the minimum count.> - once the variable is discretized, how do I transform each data point > to its discretized value (its index)?? Something like a<-c(0,1,2,3,4);b<-c(1,2,3,4,5) x<-3.5;which((a<x)&(x<=b)) [1] 4 x<-1.5;which((a<x)&(x<=b)) [1] 2> - the most important: how should I estimate the transition > probabilities?Most simply as Nij/Ni. where Ni. is the number of times the system has been in state i, and Nij is the number of transitions from i to j. Statistical properties of even this estimator can be a bit elusive because the "sample sizes" Ni. are random; the above recommendation about how to select intervals will probably help on this front. Also, after grouping the system is no longer a Markov Chain (even assuming it really was in the first place) since the probability of transition from i to j will depend somewhat on which member within i was arrived at, and this will depend (though hopefullly not much) on where it was before. By refining your grouping you can diminish this effect, though you will also reduce the Ni. and hence the quality of estimation. To discuss such issues one really need to know more about your data, in particular how long the series are, what groupings are you thinking of, and how the series behave. Also, you don't seem to be thinking about trends, cycles etc. ... Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 167 1972 Date: 01-Oct-03 Time: 17:49:21 ------------------------------ XFMail ------------------------------
>>>>> "Tamas" == Tamas Papp <tpapp at axelero.hu> >>>>> on Wed, 1 Oct 2003 17:14:51 +0200 writes:Tamas> I need to find a computationally simple process for the movement of Tamas> interest rates. In this simplified model, an interest rate can have Tamas> 3--5 possible values, and its movement is characterized by a matrix of Tamas> transition probabilities (ie, it is a Markov process). Tamas> I would like to estimate this process from a given set of data. Tamas> For example, let the interest rate time series be: Tamas> 7 3 8 2 5 9 6 Tamas> Assume that the discretized variable can take the following values: Tamas> (3, 5, 8), then we find the nearest discrete point and give its index: Tamas> 3 1 3 1 2 3 2 Tamas> Then estimate the transition probabilities. Tamas> I have the following questions: Tamas> - how should I select the discrete set of values that the variable can Tamas> assume? Eg simply get the maximum and minimum, and divide this Tamas> interval into, say, three pieces? Or estimate the mean, and make the Tamas> other two values mean plus-minus one standard deviation? (see below) Tamas> - once the variable is discretized, how do I Tamas> transform each data point to its discretized value Tamas> (its index)? that's the trivial part of answering your questions: Use cut() Tamas> - the most important: how should I estimate the transition Tamas> probabilities? We (mainly Peter Buhlmann and his coworkers) have had good experiences with discretizing such financial time series and then fitting so called "Variable Length Markov Chains" (VLMCs). To your 1st question: When doing so, one easy (and robust!) approach was to use the sample quantiles (of the marginal distribution), e.g. use the three quartiles, quantile(x, prob = (1:3)/4) as cut points {in cut(), above}. Much less easy is to determine how *many* values you want to chose for cutting. I think they have rarely used many pieces, sometimes even had good results with binary discretization --- iff used with VLMCs. So this comes back to the question of model estimation. A VLMC does *not* assume first-order Markov {as you do above}, but rather allows to look further back into the past, something quite realistic in some cases. Now the "VL" part, "Variable Length" is the novel idea of a past the length of which *depends* on your current state (context). There's the CRAN package "VLMC" (http://cran.r-project.org/src/contrib/PACKAGES.html#VLMC) and we have an applied paper M?chler, M. and B?hlmann, P. (2003). Variable Length Markov Chains: Methodology, Computing and Software. To appear in Journal of Computational and Graphical Statistics. a pre-version of which you can get from http://stat.ethz.ch/Research-Reports/104.html The paper contains references to the fundamental (mathematical) research on this. Tamas> References to introductory literature on estimating Markov chains like Tamas> this would be welcome. Most importantly, I need to know how robust an Tamas> estimation is to selecting the discrete points, or is there a simple Tamas> "goodness of fit" estimation. Using quantiles instead of mean/sd for chosing cut points is certainly robust. one goodness of fit (GOF) measure we (also use with VLMCs) is `the' AIC (-2 log likelihood). However you can only use it to compare nested models; which doesn't help you here (I think) for chosing the number of cutpoints. More applied is to use predictions {from a fitted model} and compare them with the actual values. Because of discretization you get a confusion matrix on which you can consider quite a few different GOF measures. For realistic GOF measurement you also need to do something like crossvalidation which in its simplest case would be to work with "training" and "testing" data. The whole topic is not at all trivial. We had one Ph.D. thesis on this (plus extensions..). Hoping this helps.