SMARTPHONE BASED AUTOMATIC PRICE DETERMINATION OF AGRICULTURAL PRODUCTS

Agricultural products Market equilibrium price Sellers Buyers Smartphones are increasingly becoming an integral part of our life. We carry it every time with us and use it to do various tasks including browsing internet, emails, social websites and others. We also perform online shopping with our smartphones. In this paper, a new automatic price determination algorithm for agricultural products is proposed that can be used by both the sellers and buyers using their smartphones. The buyers will place their demands for their required agricultural products to the sellers of a particular market and the sellers will also place their supplies. The algorithm will then automatically calculate the market equilibrium price using learning rate based iterative distributed price determination algorithm. As a result, both the sellers and buyers can save their time in finding the suitable prices of the agricultural products. The performance results show that the algorithm is stable and reaches the market equilibrium price within a few milliseconds.


INTRODUCTION
In any market, the price of the products vary from seller to seller.The price of the agricultural product also fluctuates based on the supply of the product and the demand of the buyers.The agricultural market is no exception to that.As a result, the buyer has to visit different sellers' profiles to check the price within a market.On another dimension, the price varies significantly from market to market.There are other factors that affect the price of agricultural products, for example, drought, flood, rain, external supplies and production.Therefore, it is very difficult to predict the price of agricultural products without visiting the sellers within a market and also other markets.This problem not only affects the buyers but also the sellers as well.Some independent sellers may be selling the price below the minimum price without knowing the actual price in the market and thus not getting the proper price for their time, energy and monetary investments.So the bottom line is that the price depends on a number of factors.In this paper, an automatic price determination algorithm is proposed that can be used in smartphones which will collect the supplies of the agricultural products from the sellers and the demands of the buyers of their list of agricultural products.Then the algorithm will automatically calculate the market equilibrium price using iterative distributed algorithm.As a result, both the sellers and the buyers will be able to know the actual price of an agricultural product for a particular day.This will benefit both the sellers and buyers by reducing the risk of their losses.
In this paper, market equilibrium is used to determine the price of agricultural products automatically.It is the state when the supply of a product of sellers become equal to the demand from the buyers (Varian, 1992), (Mankiw, 2006).In market equilibrium, the underlying competition among sellers and/or buyers is inherently captured.Therefore, it can demonstrate the general trend of the market involving both the sellers and buyers.In a market, there can exist product shortage or surplus which directly affects the price of the product.If there is shortage, the price will increase whereas the price will decrease for surplus.In real markets, market equilibrium exists in different forms and scales.It can consist of a pair of seller-buyer or a group of multiple sellers and buyers.The area of the sellers and buyers can span from a single small market to the whole world market.For example, house prices may increase in an area if there is a large demand of that area.But if there is no one to live there, the price will fall.Similarly, oil market is a case in the whole world market.Less supply and increased demand of oil increases the price of oil.On the other hand, increase in supply and less demand will reduce the price of oil.
Market equilibrium approaches have been adopted in various fields, such as, microeconomics (Sharpe, 1964), (Black, 1972), automobile industries (Berry, Levinsohn, & Pakes, 1995), share market (Admati, Pfleiderer, & Zechner, 1994), banking (Besanko & Kanatas, 1993), spectrum resource trading (Niyato & Hossain, 2008b), supermarkets (Smith, 2004), house prices and rents (Ayuso & Restoy, 2006), etc.Market equilibrium is also analyzed with other approaches.For example, (Niyato & Hossain, 2008a) compares the market equilibrium algorithm with competitive and cooperative market.Market equilibrium is found to generate the most stable solution among the three models and it also ensures the smallest profit for the sellers which is also beneficial for the buyers.Besides, the market equilibrium has less communication overhead compared to the other models.
In this paper, market equilibrium is used because it represents the general trend of the market and captures the underlying competition of the sellers and/or buyers.Besides, it is more stable than other methods and its communication overhead is also the lowest.

MATERIALS AND METHODS
Different hardware and software tools have been used to model the agricultural market scenario with multiple sellers and buyers.The used hardware device was a laptop with Intel core i7 processor, 8 GB RAM and Windows 8.1 operating system.The software tools include emulated android devices running different android operating systems, Matlab (Attaway, 2013) and Java programming language (Schildt, 2014).The system model is shown in Figure 1.

Figure 1. System model for agricultural market scenario
Figure 1 shows that there can be  number of sellers and  number of buyers.Sellers may or may not have smartphones.There is also a central coordinator that collects all the supplies from the sellers and all the demands from the buyers using online and offline forms.The central coordinator is a server where the distributed market equilibrium algorithm calculates the price of the agricultural products.Each of the sellers will have different products to sell in the market.The buyers will have different demands for different products.Market equilibrium price will be calculated for each of the products based on the supplies from the sellers and demands from the buyers.
To model the supply and demand of an agricultural product, a utility function (Pindyck & Rubinfeld, 2009), (Niyato and Hossain, 2010) is used which defines the satisfaction of the buyers.The more the utility for a product, the higher the demand from a buyer.Based on the basic supply and demand theory of microeconomics (Pfitzner, 1993), the utility function for the buyer can be defined as: where,   is the amount of product the seller is willing to sell;   is the offered price per unit of product and  is a constant.Utility or satisfaction of the buyer will initially increase and then saturate for higher amount of the agricultural product and for lower price offered.
Demand function for the buyer can be obtained from the utility function in (1) which also defines the profit for the buyer.By setting    = 0, we can calculate the demand function for the buyer.This demand function represents the required amount of product   by the buyer for the price   .
The profit or utility of the seller can be defined as the income earned from selling the product to the buyer.Thus, the supply function for the seller can be computed as follows: where,   is the total amount of product   and   is the price per unit of product charged by the primary service.The supplied product can be obtained by differentiating this equation with respect to   ,     = 0. Thus the supply function for the given price   for which the profit of the seller will be maximized can be written as: In market equilibrium, the supply function becomes equal to the demand function.In this state, there is no excess supply from the seller or excess demand from the buyer.Thus, the market equilibrium can be expressed as   =   from ( 2) and ( 4): The seller and the buyer may have limited information about each other's supply and demand, the market equilibrium can be obtained iteratively through the central coordinator.In the initial stage, the buyer will observe the advertised price from the seller for a particular product and submit its demand through the central coordinator.The seller submits the price   [0] to the coordinator which then computes the required product amount using the demand function of (2) and the coordinator then send the price to the seller.The central coordinator thus updates the price using the following equation: where,   is the learning rate that weighs the difference between demand and supply.The higher the value of   , the more weight is given to the difference than the previous price.A positive value of the difference implies excessive demand from the buyer and negative value indicates excessive supply.Thus the price will be gradually adjusted based on the supply and demand.This iteration will continue until the price difference |  [ + 1] −   [𝑡]| becomes less than a predefined threshold value.

RESULTS AND DISCUSSION
Supply adaptation for different learning rates is shown in Figure 2. When the value of learning rate  is 0.03, the supply changes to a single value after a few iterations.When the value of learning rate  becomes larger (e.g., 0.05 and 0.07), the supply value fluctuates continuously, because smaller values of learning rate ensures that the value reaches equilibrium state gradually.

Figure 2. Supply adaptation with different learning rates
Similarly, demand adaptation for different learning rates is shown in Figure 3.The demand's value also reaches a stable value after a few iterations for learning rate 0.03. Figure 4 shows the adaptation of price for different learning rates.All these figures represent the stages of reaching the market equilibrium gradually.It is important to choose an appropriate learning rate.Because if a very small value (e.g., 0.001) is chosen, it will take many iterations to reach to the market equilibrium.On the other hand, larger values of learning rate will prevent the algorithm from reaching the market equilibrium.5 shows the trajectory diagram of supply and demand for learning rate 0.03.It shows the steps for reaching the market equilibrium when the supply is equal to the demand.From the results, we can see that it takes only few iterations to determine the market equilibrium price.The time to reach the market equilibrium was found to be less than 1 millisecond.

Figure 3 .
Figure 3. Demand adaptation for different learning rates

Figure 5 .
Figure 5. Trajectory diagram for different learning rates

Figure
Figure5shows the trajectory diagram of supply and demand for learning rate 0.03.It shows the steps for reaching the market equilibrium when the supply is equal to the demand.From the results, we can see that it takes only few iterations to determine the market equilibrium price.The time to reach the market equilibrium was found to be less than 1 millisecond.