From octave-sources-request at bevo dot che dot wisc dot edu Mon Jan 27 14:07:04 2003 Subject: finance/wacc.m From: Stefan Burger To: octave-sources at bevo dot che dot wisc dot edu Date: Mon, 27 Jan 2003 06:56:04 -0600 --------------Boundary-00=_DIIDE7JKI9TYLFF6L8AA Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Calculate the weighted adjusted cost of capital.=20 Best regards,=20 Stefan Burger --------------Boundary-00=_DIIDE7JKI9TYLFF6L8AA Content-Type: text/plain; charset="us-ascii"; name="wacc.m" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="wacc.m" ## Copyright (C) 2003 Stefan Burger ## ## This file is part of Octave. ## ## Octave is free software; you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by the ## Free Software Foundation; either version 2, or (at your option) any ## later version. ## ## Octave is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## for more details. ## ## You should have received a copy of the GNU General Public License ## along with Octave; see the file COPYING. If not, write to the Free ## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. ## -*- texinfo -*- ## at deftypefn {Function File} {} wacc (@var{r_debt}, @var{r_equity}, @var{equity_ratio}, @var[s]) ## Calculate the weighted average cost of capital, WACC. ## Inputs: ## at var{r_debt} : cost of debt (interest rate), ## at var{r_equity} : (levered) cost of equity (interest rate), ## at var{equity_ratio} : ratio of equity capital to total capital, ## at var{s} : marginal tax rate. ## ## Note: all values are entered as fractions, e.g., 0.12 for an interest rate of 12%. ## Note: Accounting requires that total capital equals sum of debt and ## equity capital. Therefore, debt ratio and equity ratio have to sum up to 1.0 (100%). ## at end deftypefn ## at seealso{capm} ## Author: Stefan Burger ## Description: WACC weighted average cost of capital. function WACC = wacc (r_debt, r_equity, equity_ratio, s) if (nargin != 4) usage("wacc (r_debt, debt_ratio, r_equity, equity_ratio, s)"); endif if (! (isscalar (equity_ratio))) error ("wacc: equity_ratio must be a scalar"); endif if (! (isscalar (s))) error ("wacc: debt_ratio must be a scalar"); endif debt_ratio = 1 - equity_ratio; WACC = r_debt*(1-s)*debt_ratio+r_equity*equity_ratio; endfunction --------------Boundary-00=_DIIDE7JKI9TYLFF6L8AA--