Corporate Finance (4th): Example 10.1

下面是公司财务课程教材中部分范例的 Stata 实现代码,以便大家对相关的概念和计算方法有更深入的理解。

  • 教材:Berk, Jonathan, and Peter DeMarzo, 2014. Corporate finance (4th, Golbal Edition), Pearson Press.
- 教材:Beck, Jonathan, and Peter Demarzo, 2014. 
       Corporate finance (4th, Golbal Edition), Pearson Press.
*-------------
*-Example 10.1: Calculating the Expected Return and Volatility

  clear
  input ret   prob
        0.45  0.5
       -0.25  0.5
  end
  
  gen ret_x_prob = ret*prob
  sum ret_x_prob
  dis "E[R] = "  r(sum)
  
  gen ER = r(sum)
  gen d_R_sq = prob*(ret-ER)^2 
  sum d_R_sq
  dis "Var(R) = "  %6.4f r(sum)
  dis "SD(R)  = "  %3.2f sqrt(r(sum))

结果:

.   sum ret_x_prob

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  ret_x_prob |          2         .05    .2474874      -.125       .225

.   dis "E[R] = "  r(sum)
E[R] = .1

.   sum d_R_sq

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      d_R_sq |          2      .06125           0     .06125     .06125

.   dis "Var(R) = "  %6.4f r(sum)
Var(R) = 0.1225

.   dis "SD(R)  = "  %3.2f sqrt(r(sum))
SD(R)  = 0.35

你可能感兴趣的:(Corporate Finance (4th): Example 10.1)