No. 3/2012 29 OPTIMAL PORTFOLIO SELECTION IN EX ANTE STOCK PRICE BUBBLE AND FURTHERMORE BUBBLE BURST SCENARIO FROM DHAKA STOCK EXCHANGE WITH RELEVANCE TO SHARPE’S SINGLE INDEX MODEL Javed Bin Kamal Dhaka University House-20, Road-7, Block-B, Banasree, Rampura, Dhaka-1219, Bangladesh b_bubble@live.com Abstract: The paper aims at constructing an optimal portfolio by applying Sharpe’s single index model of capital asset pricing in different scenarios, one is ex ante stock price bubble scenario and stock price bubble and bubble burst is second scenario. Here we considered beginning of year 2010 as rise of stock price bubble in Dhaka Stock Exchange. Hence period from 2005 -2009 is considered as ex ante stock price bubble period. Using DSI (All share price index in Dhaka Stock Exchange) as market index and considering daily indices for the March 2005 to December 2009 period, the proposed method formulates a unique cut off point (cut off rate of return) and selects stocks having excess of their expected return over risk-free rate of return surpassing this cut-off point. Here, risk free rate considered to be 8.5% per annum (Treasury bill rate in 2009). Percentage of an investment in each of the selected stocks is then decided on the basis of respective weights assigned to each stock depending on respective ‘β’ value, stock movement variance representing unsystematic risk, return on stock and risk free return vis-à-vis the cut off rate of return. Interestingly, most of the stocks selected turned out to be bank stocks. Again we went for single index model applied to same stocks those made to the optimum portfolio in ex ante stock price bubble scenario considering data for the period of January 2010 to June 2012. We found that all stocks failed to make the pass Single Index Model criteria i.e. excess return over beta must be higher than the risk free rate. Here for the period of 2010 to 2012, the risk free rate considered to be 11.5 % per annum (Treasury bill rate during 2012). Keywords: Sharpe’s single index model, Sharpe ratio, optimal portfolio, cut-off rate JEL Classification: G11, G12 Introduction A fundamental question in finance is how the risk of an investment should affect its expected return. The Capital Asset Pricing Model (CAPM) provided the first coherent framework for answering this question (Perold, 2004). Financial Assets and Investing 30 From individual to group, the main purpose of investment is to earn risk adjusted return. The principle of diversification seeks to place all the eggs in different baskets and hence to keep entire investment in a single asset would be unwise and risky. This gives rise to the idea of portfolio. Portfolio management has been a topic in focus over the years. The art of successful portfolio management does not only depend on rational investment decision but also on different biases. Despite of that in order to construct and allocate assets to the different asset classes is done with care and prudence. There is a process of portfolio management. At first the securities are selected and portfolio is created. After that the portfolio must be managed and optimum return is attained. Portfolio management means construct portfolios with suitable allocation of assets in order to reach investor's return objectives, while valuing the investor's constraints in term of risk and asset allocation. Portfolio managers employ modern portfolio theory as more traditional methods or financial analysis to achieve optimum results. In this paper, we exhibit managing portfolios using Sharpe single index model in pre stock price bubble and post stock price bubble burst scenario. Portfolio management becomes profitable particularly during stock price bubble and often gains profit. But when the bubble bursts, the portfolio managers will fall in a bit uneasy situation. According to Mohammad A. Ashraf and Mohammad S. I. Noor (2010) a stock market bubble is a type of economic bubble taking place in a market when market participants drive the stock price above a value in relation to system of valuation. A bubble occurs when speculators note the fast increase in value and decide to buy in anticipation of further rises, rather than because shares are undervalued. Thus many companies become grossly overvalued. When the bubble bursts the share prices fall dramatically and numerous general investors as well as business organizations face serious financial loss and ultimate economic hardship. Modern portfolio theory (MPT) or portfolio theory was first introduced by Harry Markowitz in his paper which is popularly known as "Portfolio Selection." Explaining the concept of diversification, Markowitz proposed that investors should focus on selecting portfolios based on their overall risk-reward characteristics. In other words; investors should select portfolios and not individual securities. Markowitz (1952) identified the optimal rule for allocating one’s wealth across risky assets in a static setting. That in turn led to the later development of model of portfolio allocation. The model considers only two factors which are the expected return and variance, and assumes investors are risk averse. The idea behind the model is that No. 3/2012 31 an investor cannot increase its expected return without increasing the risk of the portfolio. Sharpe (1964) and Lintner (1965) have built on Markowitz (1952) model adding more assumptions to the model. One of the assumptions behind the CAPM is that investors agree on the expected rates of the return and the risks that they bear. That means the distribution of the future returns is known to the investors. CAPM also assumes borrowing and lending at a risk-free rate regardless of the amount borrowed or lent. Having market portfolio consisting of all risky assets, one can form a minimum variance frontier where portfolios are formed that minimize variance for a specific level of expected return. Together with William Sharpe and Merton Miller, Harry Markowitz was awarded the Nobel Prize for their research in 1990. In the research, Markowitz demonstrated that the portfolio risk came from the covariances of the assets that made up the portfolio. The marginal contribution of a security to the portfolio return variance is therefore measured by the covariance between the security's return and the portfolio's return rather than by the variance of the security itself. Markowitz thus established that the risk of a portfolio is lower than the average of the risks of each asset taken individually and gave quantitative evidence of the contribution of diversification. Literature review In deriving the CAPM, Sharpe, Lintner and Mossin assumed expected utility (EU) maximization in the face of risk aversion. Legendary article of Markowitz (1952) then gives rise to MPT. To avoid problems such as difficulty in input data, educating portfolio managers and time-cost consideration, using single index model and generating mean variance structure have become famous (Elton, Gruber and Padberg,1976 and 2003). Sharpe has received a Nobel Prize in 1990 for the model which empirical evidence is less than poor. Fama and French (2004) argue the reason could be many simplifying assumptions. To better understanding these assumptions we should break down the model and see its segmented portions. Many academics have applied single index model on real world data and have tried to construct optimal portfolio. Debasish Dutt (1998) found that all the stocks selected are bank stocks. He used Sharpe single index model in order to optimize a portfolio of 31 companies from BSE (Bombay Stock Exchange) for the period October 1, 2001 to April 30, 2003 and used BSE 100 as market index. Later on Asmita Chitnis (2010) optimized two portfolios using single index model, compared them, and he found out that portfolios tend to spread risk over many securities and thus help to reduce the overall risk involved. “The greater the portfolio’s Sharpe’s ratio, the better is its performance.” Financial Assets and Investing 32 A bubble in stock price may occur due to behavioural finance responses of individuals. Werner de Bondt found that behavioural finance has already proved to be a productive, pragmatic, and intuitive approach to asset pricing research. With its requirements for realism in assumptions, behavioural finance also brings discipline to market modelling. According to Barley Rosser (200) a speculative bubble exists when the price of something does not equal its market fundamentals for some period of time for reasons other than random shock. The latest situation of the extremely inflated asset prices during early 2010 and up to 2011 has been indicated as bubble (Rahman, 2010) because DSE (Dhaka Stock Exchange) had risen by 125 percent over the period from March 2009 and February 2010. Objectives of the study The study has the following objectives: − To construct an optimal portfolio in different market scenarios. − To test and analyse single index model by Sharpe – an intelligent tool to select profitable stock in different market scenario for investors. − To allocate investment in different stocks considering risk-return criteria. − Selection of stocks in optimal portfolio both in ex ante bubble and bubble burst scenario. Rationale of the study The rational of the study is to apply theoretical framework of portfolio management on a real world scenario and to form a well-balanced optimized and diversified portfolio of stocks. Sharpe’s single index model Markowitz’s efficient portfolio combines securities with a correlation of negative one in order to reduce risk in the portfolio to gain optimum return. In order to study N-security portfolio using Markowitz model, the inputs required are: − expected returns, − variances of returns, − − /2 covariance’s. As a result, Markowitz’s model requires + 3 /2 separate pieces of information for identification of efficient portfolio. Hence the model is complex in nature. William Sharpe contributed to Markowitz’s work and found out a more simplified model, where he considered the fact that relationship between securities occurs only through their individual relationships with some index or indices. No. 3/2012 33 As a result of which the covariance data requirement reduced from − /2 under Markowitz model to only N measures of each security as it relates to the index. Overall, the Sharpe model requires 3 + 2 separate pieces of information as against + 3 /2 for Markowitz. Sharpe’s Model of Portfolio Optimization William Sharpe (1963) studied Markowitz's research and worked on simplifying the calculations in order to develop a practical use of the model. The single index model assumes co-movement between stocks is due to movement in the index. The basic formula underlying the single index model is: = + (1) Where is return on the i-th stock, is component of security i’s that is independent of market performance, is coefficient that measures expected change in given a change in and is rate of return on market index. The term in the formula above is usually broken down into two elements which is the expected value of and which is the random element of . Construction of optimal portfolios – methodology The first step towards construction of an optimum portfolio using Sharpe’s single index model is to select securities on the basis of following criteria: − The return on the investment is greater than the risk free return. − The beta value for that security is positive. For each security selected in the portfolio, expected return is then calculated using equation (1). After selecting these securities to the portfolio, next step is to construct an optimal portfolio. The construction of an optimal portfolio is simplified if a single number measures the desirability of including a security in the optimal portfolio. For Sharpe’s single model, such a number exists. In this case, the desirability of any security is directly related to its excess return-to-beta ratio given by: − / (2) Where is expected return of stock i, is risk-free rate of return and is beta of stock i. Excess return-to-beta ratio is calculated for each security in the portfolio and securities are ranked in descending order of magnitude according to their excess return-to-beta ratio. Further, the number of stocks selected in the optimum portfolio depends on a unique cut Financial Assets and Investing 34 off rate ∗ such that all stocks with excess return-to-beta ratios greater than this unique cut off ∗ are included and all stocks with lower ratios excluded. To determine ∗ it is necessary to calculate its value as if different numbers of securities were in the optimum portfolio. For a portfolio of i stocks, is given by: = ∑ / !" ∑# #$% / (3) Where & ' market variance, & variance of a security’s movement that is not associated with the movement of the market index; this is the unsystematic risk of stock. Over establishing the cut off rate ∗ , investor knows which securities are qualified for the optimum portfolio and hence the optimum portfolio is constructed using qualified securities. Once an optimum portfolio is constructed, next step is to calculate the percentage invested in each security in the optimum portfolio. The percentage invested in i-th security is denoted by ( and is calculated using the expression: ( = )# ∑ )# (4) * = # + # , − ∗ - (5) Where ∗ is cut off rate, * is variable of weight, is expected return of stock i, is risk-free rate of return, is beta of stock i and & . is unsystematic risk of stock i. For further discussion read Edwin J. Elton, Martin J. Gruber, and Manfred W. Padberg. (1976) “Simple Criteria for Optimal Portfolio Selection, Dec., The Journal of Finance, Volume 31, Issue 5, 1341-1357. Thus, the above expression determines the relative investment in each security. Constructing an optimal portfolio – analysis Ex Ante Stock Price Bubble Scenario DSI has been taken as the market indexes for the period from March 31, 2005 to December 31, 2009 obtained from Dhaka stock exchange library. Risk free return has been taken to be the Treasury bill rate at 8.5% p. a. Monthly prices were taken from Dhaka stock exchange. Throughout and ex post Bubble Burst Scenario Daily index and monthly price figures for the period march January 2010 to June 2012 have been obtained from Dhaka stock exchange library. Risk free return has been taken to be the Treasury bill rate 11.5% % p.a. No. 3/2012 35 Stock Choice Tab. 1 Portfolio Sector Stock Pharmaceuticals − Beximco Pharma − Square Pharma Power and fuels − PGCB − Summit Power − Jamuna oil − Titas gas Bank − Prime Bank − South East bank − National Bank − The city Bank Cement − Lafarge Surma − Heidelberg Cement NBFI − IDLC − PLFSL Insurance − Green Delta − National life Insurance Source: Author`s selection As the criteria for selection mentioned in Tab. 1 ignores stocks with negative , stocks with negative returns have been ignored as well. The Sharpe model will automatically exclude such stocks as its ranking is based on excess returns over . Appendix 1 shows that almost all stocks have expected returns higher than the risk free rate of return. For determining which of these stocks will be included in the optimal portfolio, it is necessary to rank the stocks from highest to lowest based on excess return to beta ratio. Appendix 2 shows that in the case of no short sales, it can be seen the cut off rate ∗ is C13 or 8.62 and only the top ten securities make it to the optimal portfolio. Whereas in the case of short sales allowed situation, c is 8.52. Once the composition of the optimal portfolio is known, the next step is to calculate the percentage to be invested in each security (see Appendix 3). Besides during and after the bubble burst no stock made an optimal portfolio due to not surpassing the Single index model criteria (see Appendix 4). In ex ante stock price bubble scenario, most of the stocks selected are banks and financial institutions stocks when no short sales allowed. Besides in short sales allowed situation, Financial Assets and Investing 36 there is it can be found dominance of stocks of banks, insurance, cement and non-banking financial institutions (see Graph 1 and Graph 2). Graph 1 Investment weight in asset (no short sales) Souce: Author`s construction Graph 2 Investment weight in asset (short sales allowed) Souce: Author`s construction 0 0.05 0.1 0.15 0.2 0.25 Prim e bank City bank South eastbank H eidelberg cem ent Nationalbank Ltd.Nationallife IDLC Sum m itpow erG reen DeltaBex pharm a Stocks Weight -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 Prim e bankCity bank South eastbank Heidelberg cem ent Nationalbank Ltd. Nationallife IDLC Sum m itpow er G reen Delta Bex pharm aJam una oil Square pharm a Lafrage surm aTitas gas Stocks Weight No. 3/2012 37 Furthermore, during and after the bubble burst no stock took part on an optimal portfolio. This is because of that the most stocks were as risky as market and market return was negative after bubble burst. Hence it has been seen based on random choice of stocks in Dhaka Stock Exchange that we applied single index model which helped us to achieve a well rationalized and diversified portfolio. Banks have performed well in last five years and most stock have positive and higher beta. The beta, variance of the stocks changes, so the market data should be analysed continually. The optimum portfolio and proportions may change time to time and hence proper market research and expert opinion is helpful in portfolio management. Conclusion Constructing a portfolio rather than a stand-alone stock may benefit an investor through diversification and utilization of different risk return combination. Stocks are selected if their expected return is mostly strong enough and beta is positive one. The purpose of the article has been effective due to its success to reveal the single index model application in different scenarios. The cut off point changes hence new security may be included in the optimal portfolio based on risk return criteria. Many empirical studies criticize the CAPM (Fama and French, 2004) whether it is from empirical failing or theoretical perspectives. Despite that CAPM is widely used and taught in MBA courses. Haim Levy, Enrico G. De Giorgi and Thorsten Hens (2011) tested co-existence of expected utility theory of Markowitz, Sharpe and Prospect Theory of Kahneman and Tversky (1979). CAPM might be useful for investing companies, it does not have any benefits for individual investors who do not intend to borrow and lend and are willing to invest their funds in a limited number of shares (Savabi, Shahrestani and Bidabad, 2012). They presented a mathematical model for this group of investors to invest their funds in a limited number of shares and to minimize their unsystematic risk, which the market does not reward. The financial literature has been always searching new addition to the portfolio management and minimizes time, cost and overcome understanding barrier and biases. Though risk return is expected to be basic principle. References Ashraf, M. A., and Noor, M. S. I. (2010) Impact of Capitalization, on asset Price Bubble in Dhaka Stock Exchange. Journal of Economic Cooperation and Development, 31(4), pp. 127-152. Bondt, De W. (2002) Bubble psychology. In W. Hunter and G. Kaufman (eds.), Asset Price Bubbles: Implications for Monetary, Regulatory, and International Policies. Financial Assets and Investing 38 Chitnis, A. (2010) Performance Evaluation of Two Optimal Portfolios by Sharpe’s Ratio. Global Journal of Finance and Management, ISSN 0975-6477, Vol. 2, No. 1, pp. 35-46. Dutt, D. (November, 1998) Valuation of common stock – an overview. The Management Accountant. Elton, E. J., and Gruber, M. J. (2003) Modern Portfolio Theory and Investment Analysis. 6th ed., John Wiley and Sons Inc. Elton, E. J., Gruber, M. J., and Padberg, M. W. (1976) Simple Criteria for Optimal Portfolio Selection. The Journal of Finance, Vol. 31, Issue 5, pp. 1341-1357. Fama E. F., and French K. R. (1992) The cross Section of Expected Stock Returns. The Journal of Finance, Vol. xlvii, No. 2, pp. 427-465. Fama E. F., and French K.R. (2004) The capital asset pricing model: Theory and evidence. The Journal of Economic Perspectives, Vol. 18, No. 3, pp. 25-46. Kahneman, D., and Tversky, A. (March, 1979) Prospect Theory: An Analysis of Decision under Risk. Econometrica, 47(2), pp. 263-291. Levy, H., De Giorgi, E. G., and Hens, T. (2011) Two Paradigms and Nobel Prizes in Economics: A Contradiction or Coexistence? Journal of Financial Economics, 99, pp 204-215. Lintner. J. (February, 1965) The Valuation of Risk Assets and the Selection of Risky Investments in Stock Portfolios and Capital Budgets. The Review of Economics and Statistics, Vol. 47, No. 1, pp. 13-37 .This article can be retrieved from http://www.jstor.org/stable/1924119. Markowitz, H. (Mar., 1952) Portfolio Selection. The Journal of Finance, Vol. 7, No. 1, pp. 77-91. Mossin J. (Oct., 1966) Equilibrium in a Capital Asset Market. Econometrica, Vol. 34, No., pp. 768- 783 The Econometric Society. The URL for the article is http://www.jstor.org/stable/1910098. Perold, A. F. (2004) The Capital Asset Pricing Model. Journal of Economic Perspectives, Vol. 18, No. , pp. 3–24. Rahman, J. (2010) Bubble in DSE,World Press, Dhaka. Rosser, J. B. (2000) From Catastrophe to Chaos: a General Theory of Economic Discontinuities. Kluwer Academic, 2nd ed. Savabi, F., Shahrestani, H., and Bidabad, B. (May, 2012) Generalization and combination of Markowitz – Sharpe’s theories and new efficient frontier algorithm. African Journal of Business Management, Vol. 6 (18), pp. 5844-5851, Available online at http://www.academic journals.org/AJBM. Sharpe, W. F. (Sep., 1964) Capital Asset Prices: A Theory of Market Equilibrium under Conditions of Risk. The Journal of Finance, Vol. 19, No. 3 pp. 425-442. Siegel, J. J. (2003) What is an asset price bubble; an operational definition. European financial management, Vol. 9, No. 1, pp. 11-24. Tua, J, and Zhou, G. (2011) Markowitz meets Talmud: A combination of sophisticated and naive diversification strategies. Journal of Financial Economics, 99, pp. 204-215. This journal can be retrieved from http:// www.elsevier.com/locate/jfec . The data of market index (DSI all-share Price Index) have been retrieved from http://www.dsebd.org. DOI: 10.5817/FAI2012-3-3 No. 3/2012 39 Appendices Appendix 1 Ranking of stocks based on excess return to beta (Ri – Rf)/ββββ Stock name Mean return (Ri) Excess return (Ri-Rf) ß Unsystematic risk Excess return to beta (Ri – Rf)/β 1 Prime bank 22.68 14.18 1.19 0.013002995 11.86 2 City bank 22.42 13.92 1.18 0.013350371 11.78 3 South East bank 20.89 12.39 1.10 0.00905719 11.25 4 Heidelberg cement 20.01 11.51 1.05 0.008846751 10.93 5 National bank 19.17 10.67 1.00 0.019022971 10.57 6 National life 18.23 9.73 0.95 0.016065578 10.14 7 IDLC 17.53 9.033 0.92 0.012170718 9.79 8 Summit power 17.45 8.95 0.91 0.023953808 9.74 9 Green Delta 16.82 8.32 0.88 0.020022446 9.39 10 Bex pharma 16.66 8.16 0.87 0.014456726 9.30 11 Jamuna oil 15.16 6.66 0.79 0.021457785 8.34 12 Square pharma 14.53 6.03 0.76 0.016859043 7.87 13 Lafarge surma 12.29 3.79 0.64 0.006325083 5.86 14 Titas gas 10.53 2.03 0.55 0.012807507 3.68 Risk free return Rf is 8.5 %. Souce: Author`s calculation Appendix 2 Case of no short sales Stock name Ri-Rf β бei2 [(Ri-Rf) *β]/бei2 β2 /бei2 ∑(Ri-Rf) *β/бei2 ∑β2 /бei2 c 1 Prime Bank 14.18 1.19 0.013003 1304.074 109.87 1304.07 109.87 4.61 2 City Bank 13.92 1.18 0.01335 1232.427 104.55 2536.50 214.42 6.55 3 South East Bank 12.39 1.10 0.009057 1507.954 133.99 4044.45 348.41 7.76 4 Heidelberg Cement 11.51 1.05 0.008847 1372.228 125.53 5416.68 473.95 8.38 5 National Bank 10.67 1.00 0.019023 566.461 53.59 5983.14 527.54 8.54 Financial Assets and Investing 40 6 National life Insur. 9.73 0.95 0.016066 581.662 57.36 6564.80 584.90 8.66 7 IDLC 9.03 0.92 0.012171 684.783 69.93 7249.59 654.84 8.76 8 Summit Power 8.95 0.91 0.023954 343.347 35.22 7592.93 690.07 8.80 9 Green Delta 8.32 0.88 0.020022 368.611 39.22 7961.55 729.29 8.82 10 Bex pharma 8.16 0.87 0.014457 495.351 53.23 8456.90 782.52 8.85 11 Jamuna oil 6.66 0.79 0.021458 247.911 29.69 8704.81 812.21 8.84 12 Square pharma 6.03 0.76 0.016859 274.132 34.78 8978.94 847.00 8.80 13 Lafarge surma 3.79 0.64 0.006325 388.645 66.29 9367.59 913.30 8.62 14 Titas gas 2.03 0.55 0.012808 88.0483 23.87 9455.64 937.17 8.52 Variance of market = 0.0058 Souce: Author`s calculation Appendix 3 Optimum portfolio – no short sales and short sales allowed No short sales Short sales allowed Stock name β/бei2 (Ri-Rf) /β C Z % invested C Z % invested 1 Prime bank 91.92 11.86 8.62 298.68 0.19 8.52 307.86 0.27 2 City bank 88.49 11.78 8.62 280.27 0.18 8.52 289.12 0.25 3 South east bank 121.62 11.25 8.62 320.39 0.20 8.52 332.56 0.29 4 Heidelberg cement 119.12 10.93 8.62 275.26 0.17 8.52 287.17 0.25 5 National bank Ltd. 53.07 10.57 8.62 103.50 0.07 8.52 108.81 0.10 6 National life 59.75 10.14 8.62 90.84 0.06 8.52 96.81 0.09 7 IDLC 75.80 9.79 8.62 88.83 0.06 8.52 96.41 0.08 No. 3/2012 41 8 Summit power 38.34 9.74 8.62 43.19 0.03 8.52 47.03 0.04 9 Green Delta 44.25 9.39 8.62 34.45 0.02 8.52 38.87 0.03 10 Bex pharma 60.68 9.30 8.62 41.61 0.03 8.52 47.67 0.04 11 Jamuna oil 37.20 8.34 8.62 0.00 8.52 -6.37 -0.01 12 Square pharma 45.42 7.87 8.62 0.00 8.52 -29.08 -0.03 13 Lafrage surma 102.37 5.86 8.62 0.00 8.52 -272.10 -0.24 14 Titas gas 43.17 3.68 8.62 0.00 8.52 -208.59 -0.18 Total 1577.06 1.0 Total 1136.19 1.0 Note: PLFSL and PGCB excluded due to negative beta. Souce: Author`s calculation Appendix 4 Criteria: Excess return over beta > risk free rate (on data from January 2010 to June 2012) Stock Name Criteria: Excess return over beta > risk free rate 1 Beximco Pharma a = - 0.20 b = 0.81 2 Square Pharma a = - 0.22 b = 0.55 3 PGCB a = - 0.15 b = 0.94 4 Jamuna Oil a = - 0.14 b = 1.07 5 Prime Bank a = - 0.1632 b = 0.92 6 Summit Power a = - 0.1646 b = 0.96 7 National Bank(NBL) a = - 0.1665 b = 0.80 8 Heidelberg Cement a = - 0.24 b = 0.52 Financial Assets and Investing 42 9 Lafarge Surma a = - 0.25 b = 0.48 10 Titas Gas a = - 0.1464 b = 0.95 11 City Bank a = - 0.18 b = 0.90 Note: Criteria – Excess Return over beta > risk free rate; β >0. Risk free rate for the period from January 2010 to June 2012 is considered 11.5% (treasury bill rate). Criteria is not met, because excess return over beta is less than risk free rate. Souce: Author`s calculation