Difference between revisions of "Financial library functions"
m |
|||
(9 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
[[Category:Analytica User Guide]] | [[Category:Analytica User Guide]] | ||
− | <breadcrumbs>Analytica User Guide > | + | [[Category: Function libraries]] |
+ | <breadcrumbs>Analytica User Guide > Text, Date, Math, and Financial Functions > {{PAGENAME}}</breadcrumbs> | ||
+ | These financial functions are not built-in to Analytica, but are located in the [[media:Financial Library.ana|Financial library]] installed with Analytica. | ||
__TOC__ | __TOC__ | ||
− | |||
==Calloption(S, X, T, r, theta)== | ==Calloption(S, X, T, r, theta)== | ||
− | + | Calculates the value of a call option using the Black-Scholes formula. For further information on the Black-Scholes model for option pricing see ''Basic Black-Scholes: Option Pricing and Trading'' by Timothy Falcon Crack. | |
'''Parameters:''' | '''Parameters:''' | ||
− | : | + | :<code>S</code> = price of security now |
− | : | + | :<code>X</code> = exercise price |
− | : | + | :<code>T</code> = time in years to exercise |
− | : | + | :<code>r</code> = risk-free interest rate |
− | : | + | :<code>theta</code> = volatility of security |
'''Library:''' Financial (add-in library) | '''Library:''' Financial (add-in library) | ||
Line 26: | Line 27: | ||
==Putoption(S, X, T, r, theta)== | ==Putoption(S, X, T, r, theta)== | ||
− | + | ||
+ | Calculates the value of a put option using the Black-Scholes formula. For further information on the Black-Scholes model for option pricing see ''Basic Black-Scholes: Option Pricing and Trading'' by Timothy Falcon Crack. | ||
'''Parameters:''' | '''Parameters:''' | ||
− | : | + | :<code>S</code> = price of security now |
− | : | + | :<code>X</code> = exercise price |
− | : | + | :<code>T</code> = time in years to exercise |
− | : | + | :<code>r</code> = risk-free interest rate |
− | : | + | :<code>theta</code> = volatility of security |
'''Library:''' Financial (add-in library) | '''Library:''' Financial (add-in library) | ||
Line 45: | Line 47: | ||
==Capm(Rf, Rm, Beta)== | ==Capm(Rf, Rm, Beta)== | ||
− | + | ||
+ | Calculates the expected stock return under the Capital Asset Pricing Model (CAPM). For more, see Black, F., Jensen, M., and Scholes, M. "The Capital Asset Pricing Model: Some Empirical Tests,” in M. Jensen ed., ''Studies in the Theory of Capital Markets''. (1972). | ||
'''Parameters:''' | '''Parameters:''' | ||
− | : | + | :<code>Rf</code> = risk free rate |
− | : | + | :<code>Rm</code> = market return |
− | : | + | :<code>Beta</code> = beta of individual stock. Beta is the relative marginal contribution of the stock to the market return, defined as the ratio of the covariance between the stock return and market return, to the variance in the market return. |
'''Library:''' Financial (add-in library) | '''Library:''' Financial (add-in library) | ||
Line 62: | Line 65: | ||
==CostCapme(rOpp, rD, Tc, L)== | ==CostCapme(rOpp, rD, Tc, L)== | ||
+ | |||
This function calculates Miles and Ezzell’s (M/E) formula for adjusting the weighted average cost of capital for financial leverage. The M/E formula works when the firm adjusts its future borrowing to keep debt proportions constant. | This function calculates Miles and Ezzell’s (M/E) formula for adjusting the weighted average cost of capital for financial leverage. The M/E formula works when the firm adjusts its future borrowing to keep debt proportions constant. | ||
'''Parameters:''' | '''Parameters:''' | ||
− | : | + | :<code>rOpp</code> = opportunity cost of capital |
− | : | + | :<code>rD</code> = expected return on debt |
− | : | + | :<code>Tc</code> = net tax saving per dollar of interest paid. This is difficult to pin down in practice and is usually taken as the corporate tax rate. |
− | : | + | :<code>L</code> = debt-to-value ratio |
'''Library:''' Financial (add-in library) | '''Library:''' Financial (add-in library) | ||
Line 85: | Line 89: | ||
'''Parameters:''' | '''Parameters:''' | ||
− | : | + | :<code>rAllEq</code> = cost of capital under all-equity financing |
− | : | + | :<code>Tc</code> = net tax saving per dollar of interest paid. This is difficult to pin down in practice and is usually taken as the corporate tax rate. |
− | : | + | :<code>L</code> = debt-to-value ratio |
'''Library:''' Financial (add-in library) | '''Library:''' Financial (add-in library) | ||
Line 102: | Line 106: | ||
'''Parameters:''' | '''Parameters:''' | ||
− | : | + | :<code>S</code> = price of security now |
− | : | + | :<code>X</code> = exercise price |
− | : | + | :<code>T</code> = time in years to exercise |
− | : | + | :<code>r</code> = risk-free interest rate |
− | : | + | :<code>p</code> = option price |
'''Library:''' Financial (add-in library) | '''Library:''' Financial (add-in library) | ||
Line 121: | Line 125: | ||
'''Parameters:''' | '''Parameters:''' | ||
− | : | + | :<code>S</code> = price of security now |
− | : | + | :<code>X</code>» = exercise price |
− | : | + | :<code>T</code> = time in years to exercise |
− | : | + | :<code>r</code> = risk-free interest rate |
− | : | + | :<code>p</code> = option price |
'''Library:''' Financial (add-in library) | '''Library:''' Financial (add-in library) | ||
Line 140: | Line 144: | ||
'''Parameters:''' | '''Parameters:''' | ||
− | : | + | :<code>C</code> = constant payment amount |
− | : | + | :<code>rate</code> = interest rate per period |
'''Library:''' Financial (add-in library) | '''Library:''' Financial (add-in library) | ||
Line 154: | Line 158: | ||
'''Parameters:''' | '''Parameters:''' | ||
− | : | + | :<code>C1</code> = payment amount in year 1 |
− | : | + | :<code>rate</code> = interest rate per period |
− | : | + | :<code>growth</code> = growth rate per period |
'''Library:''' Financial (add-in library) | '''Library:''' Financial (add-in library) | ||
Line 169: | Line 173: | ||
'''Parameters:''' | '''Parameters:''' | ||
− | : | + | :<code>Debt</code> = market value of debt |
− | : | + | :<code>Equity</code> = market value of equity |
− | : | + | :<code>rD</code> = expected return on debt |
− | : | + | :<code>rE</code> = expected return on equity |
− | : | + | :<code>Tc</code> = corporate tax rate |
'''Library:''' Financial (add-in library) | '''Library:''' Financial (add-in library) | ||
Line 194: | Line 198: | ||
* [[Pvgperp]]() | * [[Pvgperp]]() | ||
* [[Wacc]]() | * [[Wacc]]() | ||
− | <footer>Financial functions / {{PAGENAME}} / | + | * [[Analytica Libraries and Templates]] |
+ | |||
+ | |||
+ | <footer>Financial functions / {{PAGENAME}} / User Interfaces for End Users</footer> |
Latest revision as of 20:56, 5 May 2018
These financial functions are not built-in to Analytica, but are located in the Financial library installed with Analytica.
Calloption(S, X, T, r, theta)
Calculates the value of a call option using the Black-Scholes formula. For further information on the Black-Scholes model for option pricing see Basic Black-Scholes: Option Pricing and Trading by Timothy Falcon Crack.
Parameters:
S
= price of security nowX
= exercise priceT
= time in years to exerciser
= risk-free interest ratetheta
= volatility of security
Library: Financial (add-in library)
Syntax: Calloption(S, X, T, r, theta: Numeric)
Example:
Calloption(50, 50, 0.25, 0.05, 0.3) → 3.292
See also Calloption().
Putoption(S, X, T, r, theta)
Calculates the value of a put option using the Black-Scholes formula. For further information on the Black-Scholes model for option pricing see Basic Black-Scholes: Option Pricing and Trading by Timothy Falcon Crack.
Parameters:
S
= price of security nowX
= exercise priceT
= time in years to exerciser
= risk-free interest ratetheta
= volatility of security
Library: Financial (add-in library)
Syntax: Putoption(S, X, T, r, theta: Numeric)
Example:
Putoption(50, 50, 0.25, 0.05, 0.3) → 2.67
See also Putoption().
Capm(Rf, Rm, Beta)
Calculates the expected stock return under the Capital Asset Pricing Model (CAPM). For more, see Black, F., Jensen, M., and Scholes, M. "The Capital Asset Pricing Model: Some Empirical Tests,” in M. Jensen ed., Studies in the Theory of Capital Markets. (1972).
Parameters:
Rf
= risk free rateRm
= market returnBeta
= beta of individual stock. Beta is the relative marginal contribution of the stock to the market return, defined as the ratio of the covariance between the stock return and market return, to the variance in the market return.
Library: Financial (add-in library)
Syntax: Capm(Rf, Rm, Beta: Numeric)
Example:
Capm(8%, 12%, 1.5) → 0.14
See also Capm().
CostCapme(rOpp, rD, Tc, L)
This function calculates Miles and Ezzell’s (M/E) formula for adjusting the weighted average cost of capital for financial leverage. The M/E formula works when the firm adjusts its future borrowing to keep debt proportions constant.
Parameters:
rOpp
= opportunity cost of capitalrD
= expected return on debtTc
= net tax saving per dollar of interest paid. This is difficult to pin down in practice and is usually taken as the corporate tax rate.L
= debt-to-value ratio
Library: Financial (add-in library)
Syntax: CostCapme(rOpp, rD, Tc, L: Numeric)
Example:
CostCapme(14%, 8%, 35%, 0.5) → 0.1252
See also CostCapme().
CostCapmm(rAllEq, Tc, L)
This function calculates Modigliani and Miller’s (M/M) formula for adjusting the weighted average cost of capital for financial leverage. The M/M formula works for any project that is expected to:
- Generate a level, perpetual cash flow.
- Support fixed permanent debt.
Parameters:
rAllEq
= cost of capital under all-equity financingTc
= net tax saving per dollar of interest paid. This is difficult to pin down in practice and is usually taken as the corporate tax rate.L
= debt-to-value ratio
Library: Financial (add-in library)
Syntax: CostCapmm(rAllEq, Tc, L: Numeric)
Example:
CostCapmm(20%, 35%, 0.4) → 0.172
See also CostCapmm().
Implied_volatility_c(S, X, T, r, p)
This function calculates the implied volatility of a call option, based on using the Black-Scholes formula for options.
Parameters:
S
= price of security nowX
= exercise priceT
= time in years to exerciser
= risk-free interest ratep
= option price
Library: Financial (add-in library)
Syntax: Implied_volatility_c(S, X, T, r, p: atomic numeric)
Example:
Implied_volatility_c(50, 35, 4, 6%, 15) &rarr 3.052e-005
See also Implied_volatility_c().
Implied_volatility_p(S, X, T, r, p)
This function calculates the implied volatility of a put option, based on using the Black-Scholes formula for options.
Parameters:
S
= price of security nowX
» = exercise priceT
= time in years to exerciser
= risk-free interest ratep
= option price
Library: Financial (add-in library)
Syntax: Implied_volatility_p(S, X, T, r, p: atomic numeric)
Example:
Implied_volatility_p(50, 35, 4, 6%, 15) → 9.416e-001
See also Implied_volatility_p().
Pvperp(C, rate)
Pvperp() calculates the present value of a perpetuity (a bond that pays a constant amount in perpetuity).
Parameters:
C
= constant payment amountrate
= interest rate per period
Library: Financial (add-in library)
Syntax: Pvperp(C, rate: Numeric)
Example:
Pvperp(200, 8%) → 2500
Pvgperp(C1, rate, growth)
Pvgperp() calculates the present value of a growing perpetuity (a bond that pays an amount growing at a constant rate in perpetuity).
Parameters:
C1
= payment amount in year 1rate
= interest rate per periodgrowth
= growth rate per period
Library: Financial (add-in library)
Syntax: Pvgperp(C1, rate, growth: Numeric)
Example:
Pvgperp(200, 8%, 6%) → 10K
Wacc(Debt, Equity, rD, rE, Tc)
Wacc() calculates the after-tax weighted average cost of capital, based on the expected return on a portfolio of all the firm’s securities. Used as a hurdle rate for capital investment.
Parameters:
Debt
= market value of debtEquity
= market value of equityrD
= expected return on debtrE
= expected return on equityTc
= corporate tax rate
Library: Financial (add-in library)
Syntax: Wacc(Debt, Equity, rD, rE, Tc: Numeric)
Example:
Wacc(1M, 3M, 8%, 16%, 35%) → 0.133
See Also
- Financial Library.ana
- Calloption]()
- Putoption()
- Capm()
- CostCapme()
- CostCapmm()
- Implied_volatility_c()
- Implied_volatility_p()
- Pvperp()
- Pvgperp()
- Wacc()
- Analytica Libraries and Templates
Enable comment auto-refresher