Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Issue with the mm_root function in computing the implied cost of equity capital

    Hello Stata Users,
    I have encountered an issue where the mm_root command (part of the moremata package) fails to return anything when I use upper and lower bounds of 0 and 1, even though (a) these are the bounds that are theoretically required and (b) using Excel solver for a few observations shows that the solution for the implied cost of equity capital falls within these bounds. Further, when expanding the upper and lower bounds out (I have tried between -10 and 10, as well as -30,000 to 30,000 and a variety of bounds in-between) I will get implied cost of equity capital estimates returned, but every single observation is either at the lower or the upper bound. Varying the tolerance from 0 to 1 and increasing the number of iterations to 10,000 does not help. Is there something I am missing, or is there another better way to code this problem?

    For reference, I am trying to compute the cost of equity capital in accordance with Gebhardt, Lee, and Swaminathan (2001), as modifed by Li and Mohanram (2014) (see below for complete citations). The specific code I am using is:

    Code:
    mata
    z=J(1,1,.)
    st_view(z,., "glsicc p3prcc bve fore1 fore2 fore3 fore4 fore5 indmedroe dvrate")
    function w(x,p,b0,f1,f2,f3,f4,f5,ii,dv) {
        tf = f1+f2+f3+f4
        fi = f5-ii
        return(-p+b0+(f1-x*b0)/(1+x)+(f2-x*(b0+f1*dv))/(1+x)^2+(f3-x*(b0+dv*(f1+f2)))/(1+x)^3+(f4-x*(b0+dv*(f1+f2+f3)))/(1+x)^4+(f5-x*(b0+dv*tf))/(1+x)^5+((f5-fi/7)-x*(b0+dv*(tf+f5)))/(1+x)^6+((f5-fi*2/7)-x*(b0+dv*(tf+2*f5-fi/7)))/(1+x)^7+((f5-fi*3/7)-x*(b0+dv*(tf+3*f5-fi*3/7)))/(1+x)^8+((f5-fi*4/7)-x*(b0+dv*(tf+4*f5-fi*6/7)))/(1+x)^9+((f5-fi*5/7)-x*(b0+dv*(tf+5*f5-fi*10/7)))/(1+x)^10+((f5-fi*6/7)-x*(b0+dv*(tf+6*f5-fi*15/7)))/(1+x)^11+(ii-x*(b0+dv*(tf+7*f5-fi*3)))/((1+x)^12)+(ii-x*(b0+dv*(tf+7*f5-fi*3)))/(x*(1+x)^12))
    }
    for (i=1;i<=rows(z);i++) {
        r=mm_root(glsicc=.,&w(),0,1,1e-9,1000,z[i,2],z[i,3],z[i,4],z[i,5],z[i,6],z[i,7],z[i,8],z[i,9],z[i,10])
        z[i,1]=glsicc
    }
    end

    References:
    Gebhardt, W., C. Lee, and B. Swaminathan. 2001. "Toward an Implied Cost of Capital". Journal of Accounting Research 39(1): 135-176.
    Li, K. and P. Mohanram. 2014. "Evaluating Cross-Sectional Forecasting Models for Implied Cost of Capital" Review of Accounting Studies 19:1152-1185.

  • Jesper Huijs
    replied
    Dear Statamembers,

    For my study I need
    the implied cost of capital for industry portfolios. I use the simultaneous regression method of Easton (2004), from which I can derive the icc from the regression coefficients. Therefore I need to solve the following function: Y=R(R-X), the Y (=the alpha) and X (= change in abnormal earnings growth) are known and stated as variables in my dataset with one observation per year. I need to calculate the R for every year, and R has to be non-negative. I know how to do it manually but it will take a lot of time, so i am wondering whether there is a stata function to solve this easily, so that i can derive the R for every year?

    If someone is able to help me I would really appreciate it!

    kind regards,
    Jesper

    Leave a comment:


  • Josefin Rosendahl
    replied
    Dear Julia Schmidt and Paul Demere,

    I am currently writing my master thesis and for that I need ICC measures from Gebhardt et al. (2001), Claus and Thomas (2001), Ohlson and Juettner-Nauroth (2005) and Easton (2004), similar as Rene Honekamp 's question in post #25. Your posts helped me understand the GLS and CT calculations, and I tried to use Julia's CT code and adapt it to work with the Easton (2004) model. It gave me an output but the results and unreasonable with ICC estimates between 0.1 and 5.79 (i.e. 10% and 579%). I assume something is wrong with my boundaries but I can't figure it out (I am new to Stata).

    The Easton model is defined as:
    price = (feps_tv2 + rES*DPS_tv1 - feps_tv1)/(rES^2)

    The code I used in Stata was (adapting Julia's CT code, unreasonable output as result):

    generate icc_es=.
    mata
    z=J(1,1,.)
    st_view(z,., "icc_es price feps_tv1 feps_tv2 DPS")
    function s(x,p,f1,f2,dv) {
    tf = (f2+(x*dv)-f1)/(x^2)
    return(-p+tf)
    }
    for (i=1;i<=rows(z);i++) {
    r=mm_root(icc_es=.,&s(),z[i,4]+epsilon(1),1-epsilon(1),1e-4,1000,z[i,2],z[i,3],z[i,4],z[i,5])
    z[i,1]=icc_es
    }
    end


    If you are able to provide some feedback on my code I would highly appreciate it!

    Thank you in advance.

    Kind regards,
    Josefin

    Leave a comment:


  • Chiel Dupont
    replied
    hi everyone,

    I am doing a similar project as Julia Schmidt, where I am estimating the implied cost of equity using the model by Claus and Thomas (2001), but rather using Li and Mohanram's (2014) regression model than analyst forecasts to estimate future earnings.

    I have got the code to find the implied cost of equity up and running, and I was able to solve the mm_root issue thanks to Paul Demere.
    However, as many regressions are needed in order to forecast the earnings, could someone help me with a complementary code which is able to do all those regressions?

    Thank you in advance.

    Leave a comment:


  • Paul Demere
    replied
    Hello Amanda Brown,
    I believe the issue is with the bounds you have provided to the mm_root function. Right now, the search interval you've given the function is [z[i,9]-epsilon(1), z[i,9]+epsilon(1)], which means that the function can only search for a solution that is equal to the growth rate (which is also the very point where the function is undefined).

    To correct this issue, try instead the bounds [z[i,9]+epsilon(1),1-epsilon(1)]. This will allow the function to search for a solution where the cost of equity capital is greater than the risk-free growth rate (which it should be) but less than 1 (because a 100% cost of capital is more than a little extreme). This will make the code (where I've used v instead of z for naming):

    Code:
    rc=mm_root(cticc=.,&y(),v[i,9]+epsilon(1),1-epsilon(1),1e-9,1000,v[i,2],v[i,3],v[i,4],v[i,5],v[i,6],v[i,7],v[i,8],v[i,9],v[i,10])
    Good luck!

    Leave a comment:


  • Amanda Brown
    replied
    Originally posted by Hua Peng (StataCorp) View Post
    In your function, the last term is

    Code:
    tv = ((f5-x*(b0+(1-dv)*tf))*(1+g)/((x-g)*(1+x)^5)
    which means the function is not defined when x = g, i.e., at the value of the growth variable. In Paul's version, the function is not defined at x=0. Hence you might need try the bounds from smallestdouble() to z[i,9]-epsilon(1); and z[i,9]+epsilon(1) to 1 if the value of growth variable is between 0 and 1.
    Hua Peng (StataCorp) Hi Hua, thank you so much for the posts! I tried Julia's code, but it is not working. It seems like there is issue with the bounds. Do you mean the code should be changed to "
    r=mm_root(icc_ct=.,&y(), z[i,9]-epsilon(1),z[i,9]+epsilon(1),1000,z[i,2],z[i,3],z[i,4],z[i,5],z[i,6],z[i,7],z[i,8],z[i,9],z[i,10]) z[i,1]=icc_ct } end"? Thanks again!

    Leave a comment:


  • Amanda Brown
    replied
    Paul Demere Hi Paul, thank you for the posts! I am an accounting PhD student. I have tried Julia's code for cost of equity following Claus and Thomas (2001) and sample data but I find several errors with the code. Could you please look at the code and give suggestions? I see you are a professor in accounting. Thanks for all the discussions!

    Leave a comment:


  • Amanda Brown
    replied
    Julia Schmidt Thank you for the sample data and code. However, several error messages incurred when I run the code using the sample data. The first error message happens after "return(-p+b0+t1+t2+t3+t4+t5+tv)". The error says "'return' found where almost anything else expected". As far as I understand, it means there is no solution for the function? However, I was expecting multiple solutions for the function, as mentioned in Claus and Thomas (2001). Can anyone help? Thank you so much in advance!

    Leave a comment:


  • Rene Honekamp
    replied
    Julia Schmidt and Paul Demere:

    I am doing a similar work using a combination of different ICC measures (as applied in "Hann, Ogneva, Ozbas (2013) - Corporate Diversification and the Cost of Capital" or "Hail, Leuz (2009) - Cost of capital effects and changes in growth expectations around U.S. cross-listings").
    Since I have very few experience using Stata, your posts on the Claus, Thomas (2001) measure and the Gebhardt, Lee, Swaminathan (2001) measure really helped me to understand the calculations.

    Maybe you used a comparable approach and could post your do files for the Easton (2004) and the Ohlson, Nauroth-Juettner (2005) measure as well.

    This would essentially support my understanding and every help would be appreciated. Thank you very much!

    Leave a comment:


  • Mertin Cimen
    replied
    @ Julia Schmidt Could you please share the code of the Claus and Thomas ICC calculation? Would appreciate it a lot! Best, Mertin
    Last edited by Mertin Cimen; 17 May 2016, 13:34. Reason: Apologies: I obviously missed the second page of this threat (still new to statalist.org and forums in general)

    Leave a comment:


  • david tran
    replied
    Many thanks Paul Demere for your suggestions.
    Julia Schmidt : I tried your lastest code using CT(2001) model with my data, however, the results obtained seem to be illogical (~21%) whereas I used the code of Paul Demere, it works and the result is reasonnable (~10%). Have you the same problem?

    Leave a comment:


  • Paul Demere
    replied
    Hello Julia Schmidt and david tran ,
    I'm sorry for the late reply Julia, but it turns out I was not receiving emails from StataList (hopefully my settings are fixed going forward).

    You appear to have hit upon the exact issue I ran into with the Claus and Thomas (2001) implied cost of equity capital measure, in that there is a discontinuity in the price function around the growth rate. I modified my code similarly to yours, and recommend anyone interested in coding the Claus and Thomas (2001) measure refer to Julia's earlier post.

    As to your most recent inquiry, fore1 through fore5 are the year 1 through year 5, respectively, earnings forecasts from the RI model in Li and Mohanram (2014). Indmedroe is the 12-year industry median return on equity (I computed it based on 3-digit NAICS codes, but other industry definitions would be reasonable). Dvrate is the retention rate, or (1 - d/e), where d/e is total dividends divided by total earnings. Additionally, to correct for extreme dividend events, coding mistakes, and outliers, I replaced d/e with 0 when it was negative and 1 when it was greater than 1.

    David, the reason your code is not working lies in the line: "function w(x,p,b0,f1,f2,f3,ii,f4,f5,f6,f7,f8,f9,f10,f11,dv) ". mm_root only accepts 10 inputs at most from a function command (due to the coding of mm_root). I recommend creating froe4 through froe 11 within the function itself, so only 8 inputs will be needed.

    Leave a comment:


  • david tran
    replied
    Dear Statalist,
    I am doing research about implied cost of capital based on model of Gebhardt, Lee, Swaminathan (2001). I used the code of Paul Demere and make some modifications based on article of "A review of the literature on methods of computing the implied cost of capital - Echterling 2015". However, it does not work.
    Could you please help me?
    Here are the code:

    **Generate ROEt from 4 to 11
    gen bv2=bve+(feps1+feps2)*dpo_n //book value @t2
    gen froe3 = feps3_n/bv2
    label variable froe3 "gen froe3 = feps3_n/bv2"

    gen froe4 = (roe_w_m3_n - froe3)/9+froe3
    gen froe5 = (roe_w_m3_n - froe4)/9+froe4
    gen froe6 = (roe_w_m3_n - froe5)/9+froe5
    gen froe7 = (roe_w_m3_n - froe6)/9+froe6
    gen froe8 = (roe_w_m3_n - froe7)/9+froe7
    gen froe9 = (roe_w_m3_n - froe8)/9+froe8
    gen froe10 = (roe_w_m3_n - froe9)/9+froe9
    gen froe11 = (roe_w_m3_n - froe10)/9+froe10

    **
    // feps = forecast earning per share
    // froe = forecast ROE
    // bv = book value
    // feps = froe*bv_(t-1)

    cap drop glsicc
    g glsicc=.
    mata
    mata clear
    z=(1,1,.)
    st_view(z,.,"glsicc pco bve feps1 feps2 feps3_n roe_w_m3_n #delim;
    froe4 froe5 froe6 froe7 froe8 froe9 froe10 froe11 dpo_n")
    function w(x,p,b0,f1,f2,f3,ii,f4,f5,f6,f7,f8,f9,f10,f11,dv) {
    tf = f1+f2+f3+f4
    fi = f5-ii
    t1 = (f1-x*b0)/(1+x)
    t2 = (f2-x*(b0+f1*(1-dv)))/(1+x)^2

    t3 = (f3-x*(b0+(1-dv)*(f1+f2)))/(1+x)^3

    t4 = ((f4-x)*(b0+(1-dv)*(f1+f2+f3)))/(1+x)^4
    t5 = ((f5-x)*(b0+(1-dv)*tf))/(1+x)^5
    t6 = ((f6-x)*(b0+(1-dv)*(tf+f5)))/(1+x)^6
    t7 = ((f7-x)*(b0+(1-dv)*(tf+f5+f6)))/(1+x)^7
    t8 = ((f8-x)*(b0+(1-dv)*(tf+f5+f6+f7)))/(1+x)^8
    t9 = ((f9-x)*(b0+(1-dv)*(tf+f5+f6+f7+f8)))/(1+x)^9
    t10 = ((f10-x)*(b0+(1-dv)*(tf+f5+f6+f7+f8+f9)))/(1+x)^10
    t11 = ((f11-x)*(b0+(1-dv)*(tf+f5+f6+f7+f8+f9+f10)))/(1+x)^11
    tv = ((ii-x)*(b0+(1-dv)*(tf+f5+f6+f7+f8+f9+f10+f11)))/(x*(1+x)^12)

    return(-p+b0+t1+t2+t3+t4+t5+t6+t7+t8+t9+t10+t11+tv)
    }
    for (i=1;i<=rows(z);i++) {
    r=mm_root(glsicc=.,&w(),smallestdouble(),1-epsilon(1),1e-9,1000, #delim;
    z[i,2],z[i,3],z[i,4],z[i,5],z[i,6],z[i,7],z[i,9],z[i,10],z[i,11],z[i,12])
    z[i,1]= glsicc
    }
    end
    drop if missing(t)

    Leave a comment:


  • Julia Schmidt
    replied
    Paul Demere I have the problem at the moment, that my GSL_ICC is negatively correlated with all other return proxies and realized return.
    So I have some questions to your approach to find my mistake: Are fore1, fore2, ... the earnings forecasts and the indmedroe the 12-year industry median return on equity? Also, is dvrate the payoutratio or the retention rate? Thanks a lot for your help

    Leave a comment:


  • Julia Schmidt
    replied
    Attaullah Shah Sorry, I just saw your response. Below you find a small fraction of my data sample. I finally merged the two icc_ct measures by replacing icc_ct with icc_ct_ when icc_ct=1. Hopefully that makes sense
    Attached Files
    Last edited by Julia Schmidt; 10 Oct 2015, 02:44.

    Leave a comment:

Working...
X