A Markov Chain Model for Vegetable Price Movement in Jaffna

The modeling of random movement events is an important aspect of stochastic analysis. Developing a stochastic model to represent the price movement at various time intervals has long been a nature of interest in stock market, business processes and others. The daily price data of vegetables at Thirunelvelly market for 1704 days (Jan 2009-Sept 2013) have been collected from Vallampuri paper corporation, Jaffna, Sri Lanka. The data were analyzed to classify the price movement change on two successive days. Many scholars showed that modeling a market as a random walk was applicable and that a market may be viewed as having the Markov property. The objective of this paper is to construct the Markov chain model for daily vegetable price movement in Jaffna. Two models are highlighted, where the price movement is considered as being in a state of (1) gain or loss and (2) large gain, or small gain or loss, or large loss. Twelve different types of vegetables are considered and above two models are used to analyze the price movement of each vegetable. These models were used to obtain transitional probabilities, steady state probabilities and mean recurrence times. Our results indicate that the pattern of price movement of brinjal (eggplant) is similar to price movements of other vegetables, both in models (1) and (2). The investor is encouraged to invest in the vegetable market at any time in a way which leads to a greater chance of getting more gain than loss.


Introduction
As vegetable is one of the most important consumer goods for residents, the fluctuation of the prices has a direct impact on people"s daily life. Especially in recent years, the continuous increase in vegetable prices has drawn much attention of the government as well as the people. Jaffna is still considered as an agricultural district because majority of village people are occupied in vegetable farming which is their main livelihood. Vegetables are produced on a year round basis and a large number of farmers are involved in the production process. Vegetables are being cultivated throughout the year with the help of lift irrigation from the dug wells. Low country vegetables such as Brinjals, Tomato, Long beans, Okra, Snake gourd, Bitter gourd and other leafy vegetables are being cultivated and available in the market throughout the year. Also up-country vegetables like Cabbage, Leeks, Beet, Beans, and Carrots are also cultivated in large areas. But in Jaffna vegetable markets, availability of both low-country and up-country vegetable have significantly increased during the last few years because the A9 highway connecting the north and south was opened in 2010. Vegetable marketing in Jaffna is generally in the supplies by entrepreneur, individual farmers from different areas of Jaffna district and few middlemen from other part of the country (particularly from Dambulla market and other areas in the northern province of the region). The marketing system has played an important role in deciding the vegetable prices in Jaffna markets. Marketing channel is a chain of middlemen who are involved in the process of selling different vegetables at different stages. Consumer price will be increased when the number of middlemen in the market channels increase. In this scenario, middlemen are the key persons in the Jaffna markets who decide the daily vegetable prices. Agwuegbo et al. (2010) have analyzed Nigerian stock market price trends by determining probabilities of the market transitions between various states. A similar study was conducted by Doubleday et al. (2011). According to Kendall (1953), stock prices following a random walk implies that the price changes are as independent of one another as the gains and losses. Zhang et al. (2009) Zhang (1997) has suggested that, in China, the increases of the vegetable prices are due to two reasons. First, it is because of the change of the production cost and planting structure. The second reason is that the market and circulation is more open after the vegetable price becomes open. Sandika (2011) has studied impact of middlemen on vegetable marketing channels in Sri Lanka.
The idea of using Markov chains to forecast the behavior of market prices is popular since prospective investors are interested in market movements (or trends) which might lead to an optimum investment strategy.  To obtain the expected (or mean) transition recurrent time of daily vegetable price movement based on the constructed Markov model. The paper is organized as follows. The daily vegetable prices of the market are considered so that analysis can be approached in a discrete manner. In section 2, First, Markov theory and properties of Markov chains are discussed. The concept of random variable, a random movement and two models of a specific strategy of price movements in the market are also introduced in section 2. Finally, the results of the Markov chain models and their implications are discussed in Section 3.

Methodology
This study was mainly done by using secondary data which were collected from secondary source such as newspaper published by the Vallampuri paper corporation, Jaffna. Availability of the data, daily market prices of vegetables: brinjals, carrot, etc. were collected from Thirunelvelly market which is one of the most important markets in Jaffna. This study includes the time period from 2009 to 2013 covering 1704 days. Prices are the outcome of the functioning of the market and are determined by supply and demand which, in turn, is constrained by the costs of production, the costs of marketing and consumer preferences, among other things. Generally, the vegetable price movement means that today"s price value has increased or decreased or unchanged vis-a-vis the previous day"s price. Vegetable prices of the market are considered discretely so that the daily vegetable price fluctuation of the market seems to be in a random movement. As a consequence of this manner one could obtain a basic method of analyzing this system, adopting the Markov processes. A Markov process whose state space is discrete is called a Markov chain. In order to keep the parameter space, only discrete parameter Markov chains are treated. In this study, based on the daily price changes, states could be classified into increased or decreased. Moreover three states are considered, where the price change belonged as being in a state of large increased, small changed, or large decreased. A random movement (or walk) is said to exhibit the Markov property if the position of the movement at time ( ) depends only upon the position of the movement at time . Let denote the position of the random movement at time , then equation (1): is independent of so that the state of at time ( ) depends only upon the state of at time . Here each for is a probability row vector describing every possible transition from state to any other existing in possible states in the process. Then equation (2): Generally, a random movement exists in possible states in the system. Then, in chains, ( ) will depend on the whole sequence of random variables starting with the initial value (Jones and Smith, 2001); it leads to equation (3): Intuitively, one interprets equation (3) to means that, given the "present" of the process, the "future" is independent of its "past" (Parzen, 1962). The random process of moving from one state of the system to another with the associated probabilities of each transition is known as the chain. It is said that every step taken in a chain possessing the Markov property depends only on immediately preceding step.
This expresses the fact that if the system is in one of the states at one observed value, it will with certainty be in one of the states at the next observed value. With these transition probabilities, a matrix, ( ), called the first step transition probability matrix of the Markov chain.

( ) [ ]
Each row of is the probability distribution relating to a transition from state to state . ( ) ( ) in matrix notation for the finite state homogeneous Markov chain can be written as; Therefore, the future state vector ( ) can be evaluated if the initial state vector and the transition matrix are known.
Classifying the states of a finite Markov chain according to certain basic properties, such a classification can be based on the definitions as follows: State is said to be accessible from state if can be reached from in a finite number of steps. If two states and are accessible to each other, then they are said to communicate. The period of a state is defined as the greatest common divisor of all integers , for which ( ) . When the period is one, the state is referred to as aperiodic. If all states of a chain communicate and are aperiodic, then the chain is said to be ergodic (Bhat, 1972 This stationary probability vector can be viewed as the unique distribution of a random variable in the long-run. Consequently expected (or mean) recurrent times are given by: ( ) for every .

Construction of Models:
The daily market prices of 12 different types of vegetables namely Brinjal, Potato, Green chillies, Cassava, Cabbage, Carrot, Onion, Bitter gourd, Long beans, Drumstick, Lemon, and Coconut (which produces a "vegetable" oil) at the Thirunelvelly market were used in this modeling study. The period January 1 st 2009 to September 29 th 2013 was chosen in the estimation of the model, but the chain took into account the behavior of the market price for consecutive days, each classified as increase or decrease or remains the same. The data was set up into two types of models and studied separately. One of the main assumptions in Markov chain is stationarity. That is ( ) for where is the time interval taken to calculate the transitional probabilities. This assumes that within the time period of T the chance of price change is nil. Let denote the price of vegetable at the market during the day. Then the random variable is defined as: .
( ) Here vegetable price changes are taken as the first order of the chain since the nature of the perishable and particular vegetable cannot permit selling after a day. Therefore the first order change is only appropriate for study related to vegetable markets. So that, for this study, two models of Markov chain analysis will be considered as follows: For Model 1: Each day was classified as having price value higher or lower than the previous day for this experiment, considering the movement from a category of gain, or loss on a day to a category of gain or loss the next, thus letting classification of two states, namely: State 1 (gain): Today"s price value is greater than or equal to the price value of the previous day State 2 (loss): Today"s price value is less than price value of the previous day A sequence of daily observations on the state of the system may be able to form a binary random variable denoted by

{ ( )
The random variable * + defined by equation ( ) is known as a Markov chain with state space * +.
For Model 2: Each day was classified as having price value higher than or lower than or within " " rupees from the previous day for this experiment considering the movement from a category of large gain, or small gain/ loss, or large loss a day to a category of large gain, or small gain/ loss, or large loss the next, thus letting classification of three states, namely: State 1 (large gain): Today"s price value is greater by more than" " rupees than the price value of the previous day; State 2 (small gain/ loss): Today"s price value change is within or equal to " " rupees vis-a-vis the price value of the previous day; State 3 (large loss): Today"s price value is lower than the price value of the previous day by more than " " rupees.
The state of this system may be able to form a trinary random variable denoted by The random variable * + defined by equation ( ) is known as a Markov chain with state space * +.
Here " " is treated as threshold value of absolute price changes. There is no unique way of determining the threshold in this nature of studies. Generally researchers used common parameters like measures of central tendency to find the threshold point. In this study, the main focus is only on the changes of the price pattern not on the price values. Here threshold value was fixed by determining the absolute median of the market daily changes of each vegetable separately.

Results and Discussion
The maximum likelihood method has been applied to estimate the transition probability matrix under the certain assumptions (Bhat, 1971). Therefore the transition probability can be obtained by the relative frequencies observed in the sample. i.e., ̂ ⁄ , where denotes the number of transitions from state to state and ∑ . The transition from one state to another (that is the vegetable price movement pattern, which could be that an increase in price can be followed by another increase or an increase followed by no change or an ISSN 2424-6271 IASSL increase followed by a decrease) was observed from the data collected and the result for each vegetable for the period (1704 days) under study was compiled. The transition frequencies can be represented in the Tables 1 and 2 below, which takes into account the data for brinjal for two models separately:   (2) 252 175 140 567 Based on the data, here threshold for the state category value " " is Rs.10 Consequently, from the transition frequency table, the following are estimated as follows: the first-step transition probability matrix ( ) , long-run invariant distribution ( ) and mean recurrence times ( ) of the Markov chain. The transition matrix for model 1was found to be:

State
Gain-0 Loss-1 , -Each row of this matrix is a probability vector and is a precise statement of probability for change in the behavior of the brinjal"s price movement for two successive days. Also this matrix indicates that a given day irrespective of being in either state, there is a greater chance of transitioning to a state of gain than a state of loss. For example, the actual transition probability is interpreted as 62.5 % of the days, where brinjal"s price that is on increase will still increase. According to the probability matrix , all states are communicated and aperiodic, then chain is an ergodic chain. Therefore, , , say that in a large number of days 66.8% of the time the price change is predicted to move to a gain state and 33.2% of the time price change is predicted to move to a loss state. Further, the good news for investors is that the steady state probability vector shows that there is a greater probability of a day being a day of gain than a day of loss. Regarding the mean recurrence time vector specifies that the expected recurrent days of gain state is ( days) half of that of loss state ( days).

IASSL ISSN 2424-6271 101
For the second model, the transition matrix was found to be: Each row of this matrix is a probability vector and is a specific value of proportion for change in the behavior of the brinjal"s price movement in two successive days. This matrix seems that in a given day of large gain state, there is a higher chance of transitioning to a state of large loss than the other states. Also, the second row vector indicates that there is a greater chance of transitioning to a state small gain/ loss than other states. If a given day is in large loss state, there is a better chance of transitioning to a state of large gain than other states. Probability values, for each vector movement of the Model 2 is described as follows: First vector ( ), indicates that if a given day has increased price value, then the next day"s price will increase or remain within the threshold limits or decrease in the following percentages 24.6%, 28.5%, 46.9% respectively. Second vector ( ), indicates that if a given day remains within the threshold limits of price value, then the next day"s price will increase or remain within the threshold limits or decrease in the following percentages 25.9%, 45.1%, 29.0% respectively. The last vector ( ), indicates that if a given day has decreased price value, then the next day"s price will increase or remain within the threshold limits or decrease in the following percentages 44.4%, 30.9%, 24.7% respectively. Based on the probability matrix , all states are communicated and aperiodic, so that it is an ergodic chain. Hence, , is interpreted as brinjals" price movement among categories is being a Markov chain with transition probability matrix , after many days, consist of the following proportions in each category: 31.7% in the state-0, 35.1% in the state-1, 33.3% in the state-2. Further, the mean recurrence time of the corresponding states 0, 1 and 2 are , days respectively.
In a similar manner, remaining vegetables: Bitter gourd, Cabbage, Carrot, Coconut, Drumstick, Green chillies, Lemon, Long beans, Onion, Potato and Cassava results are estimated and which are presented in Table 3, consist of the transition probability matrix, long-run invariant distribution and mean recurrence time for each model separately. Notice that for model 1, in the entire transition matrix each row vector contains a more likelihood of probabilities in the first column, indicate that irrespective of what state a day occupies, there is a high probability that the next day will be a day of gain. This is encouraging for investors since the price movement will not be down in a sustained manner, but more likely up.

Conclusion
This paper has presented a Markov chain modeling of daily vegetable price movement at Thirunelvelly market in Jaffna. It is believed that this is the first time such a study has been undertaken and use of this method to analyze and predict the price movement is more valuable in the market mechanism. The result of price movement study for developing Markov chain models revealed that the Markov chain models for the daily price movement pattern is same for each vegetable. That is, price movement will show a great propensity to have gains and seem probabilistic immunity to consecutive days of loss. Therefore, a price movement of this nature will yield a slow steady growth as there are likely to be more days of gain than days of loss. The functional status of the Thirunelvely market is subject to the influence of various factors from market, for example, demand of the day and psychological factors of investors and so on. Therefore, no single method can accurately predict changes in the price movement every day. Markov chain method is no exception. Even though the results of our analysis is encouraging, the estimates of the mean recurrent times may have limited validity. It is shown that the regional market approach leads to superior results, and a similar framework may be useful in establishing Markov model for price movement in the other markets of the region. Although the model described here is used only to predict price movement pattern, the same Makov chain frame work can be further developed to forecast amounts of price moment.