Difference between revisions of "Financial library functions"

m
 
(12 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
[[Category:Analytica User Guide]]
 
[[Category:Analytica User Guide]]
<breadcrumbs>Analytica User Guide > Other Functions > {{PAGENAME}}</breadcrumbs>
+
[[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__
  
The following functions are not built-in to Analytica, but are located in the Financial library that comes with Analytica.
 
  
 
==Calloption(S, X, T, r, theta)==
 
==Calloption(S, X, T, r, theta)==
This function 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.
+
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:'''
* «S» = price of security now
+
:<code>S</code> = price of security now
* «X» = exercise price
+
:<code>X</code> = exercise price
* «T» = time in years to exercise
+
:<code>T</code> = time in years to exercise
* «r» = risk-free interest rate
+
:<code>r</code> = risk-free interest rate
* «theta» = volatility of security
+
:<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)==
This function 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.
+
 
 +
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:'''
* «S» = price of security now
+
:<code>S</code> = price of security now
* «X» = exercise price
+
:<code>X</code> = exercise price
* «T» = time in years to exercise
+
:<code>T</code> = time in years to exercise
* «r» = risk-free interest rate
+
:<code>r</code> = risk-free interest rate
* «theta» = volatility of security
+
:<code>theta</code> = volatility of security
  
 
'''Library:''' Financial (add-in library)
 
'''Library:''' Financial (add-in library)
  
'''Syntax:''' <code>Putoption]](S, X, T, r, theta: Numeric)</code>
+
'''Syntax:''' <code>Putoption(S, X, T, r, theta: Numeric)</code>
  
 
'''Example:'''   
 
'''Example:'''   
Line 45: Line 47:
  
 
==Capm(Rf, Rm, Beta)==
 
==Capm(Rf, Rm, Beta)==
CAPM calculates the expected stock return under the Capital Asset Pricing Model. For further information on the Capital Asset Pricing Model 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).
+
 
 +
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:'''
* «Rf» = risk free rate
+
:<code>Rf</code> = risk free rate
* «Rm» = market return
+
:<code>Rm</code> = market return
* «Beta» = 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.
+
:<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)
  
'''Syntax:''' <code>Capm]](Rf, Rm, Beta: Numeric)</code>
+
'''Syntax:''' <code>Capm(Rf, Rm, Beta: Numeric)</code>
  
 
'''Example:'''  
 
'''Example:'''  
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:'''  
* «rOpp» = opportunity cost of capital
+
:<code>rOpp</code> = opportunity cost of capital
* «rD» = expected return on debt
+
:<code>rD</code> = expected return on debt
* «Tc» = 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>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.
* «L» = debt-to-value ratio
+
:<code>L</code> = debt-to-value ratio
  
 
'''Library:''' Financial (add-in library)
 
'''Library:''' Financial (add-in library)
  
'''Syntax:''' <code>CostCapme]](rOpp, rD, Tc, L: Numeric)</code>
+
'''Syntax:''' <code>CostCapme(rOpp, rD, Tc, L: Numeric)</code>
  
 
'''Example:'''  
 
'''Example:'''  
Line 85: Line 89:
  
 
'''Parameters:'''
 
'''Parameters:'''
* «rAllEq» = cost of capital under all-equity financing
+
:<code>rAllEq</code> = cost of capital under all-equity financing
* «Tc» = 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>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.
* «L» = debt-to-value ratio
+
:<code>L</code> = debt-to-value ratio
  
 
'''Library:''' Financial (add-in library)
 
'''Library:''' Financial (add-in library)
Line 102: Line 106:
  
 
'''Parameters:'''
 
'''Parameters:'''
* '''S''' = price of security now
+
:<code>S</code> = price of security now
* '''X''' = exercise price
+
:<code>X</code> = exercise price
* '''T''' = time in years to exercise
+
:<code>T</code> = time in years to exercise
* '''r''' = risk-free interest rate
+
:<code>r</code> = risk-free interest rate
* '''p''' = option price
+
:<code>p</code> = option price
  
 
'''Library:''' Financial (add-in library)
 
'''Library:''' Financial (add-in library)
  
'''Syntax:''' <code>Implied_volatility_c]](S, X, T, r, p: atomic numeric)</code>
+
'''Syntax:''' <code>Implied_volatility_c(S, X, T, r, p: atomic numeric)</code>
  
 
'''Example:'''  
 
'''Example:'''  
Line 121: Line 125:
  
 
'''Parameters:'''  
 
'''Parameters:'''  
* «S» = price of security now
+
:<code>S</code> = price of security now
* «X» = exercise price
+
:<code>X</code>» = exercise price
* «T» = time in years to exercise
+
:<code>T</code> = time in years to exercise
* «r» = risk-free interest rate
+
:<code>r</code> = risk-free interest rate
* «p» = option price
+
:<code>p</code> = option price
  
 
'''Library:''' Financial (add-in library)
 
'''Library:''' Financial (add-in library)
  
'''Syntax:''' <code>Implied_volatility_p]](S, X, T, r, p: atomic numeric)</code>
+
'''Syntax:''' <code>Implied_volatility_p(S, X, T, r, p: atomic numeric)</code>
  
 
'''Example:'''  
 
'''Example:'''  
 
:<code>Implied_volatility_p(50, 35, 4, 6%, 15) &rarr; 9.416e-001</code>
 
:<code>Implied_volatility_p(50, 35, 4, 6%, 15) &rarr; 9.416e-001</code>
  
See also '[[Implied_volatility_p]]().
+
See also [[Implied_volatility_p]]().
  
 
==Pvperp(C, rate)==
 
==Pvperp(C, rate)==
Line 140: Line 144:
  
 
'''Parameters:'''
 
'''Parameters:'''
* «C» = constant payment amount
+
:<code>C</code> = constant payment amount
* «rate» = interest rate per period
+
:<code>rate</code> = interest rate per period
  
 
'''Library:''' Financial (add-in library)
 
'''Library:''' Financial (add-in library)
Line 154: Line 158:
  
 
'''Parameters:'''  
 
'''Parameters:'''  
* «C1» = payment amount in year 1
+
:<code>C1</code> = payment amount in year 1
* «rate» = interest rate per period
+
:<code>rate</code> = interest rate per period
* «growth» = growth rate per period
+
:<code>growth</code> = growth rate per period
  
 
'''Library:''' Financial (add-in library)
 
'''Library:''' Financial (add-in library)
  
'''Syntax:'''  <code>[[Pvgperp]](C1, rate, growth: Numeric)</code>
+
'''Syntax:'''  <code>Pvgperp(C1, rate, growth: Numeric)</code>
  
 
'''Example:'''  
 
'''Example:'''  
Line 169: Line 173:
  
 
'''Parameters:'''  
 
'''Parameters:'''  
* «Debt» = market value of debt
+
:<code>Debt</code> = market value of debt
* «Equity» = market value of equity
+
:<code>Equity</code> = market value of equity
* «rD» = expected return on debt
+
:<code>rD</code> = expected return on debt
* «rE» = expected return on equity
+
:<code>rE</code> = expected return on equity
* «Tc» = corporate tax rate
+
:<code>Tc</code> = corporate tax rate
  
 
'''Library:''' Financial (add-in library)
 
'''Library:''' Financial (add-in library)
Line 183: Line 187:
  
 
==See Also==
 
==See Also==
 +
* [[media:Financial Library.ana|Financial Library.ana]]
 
* [[Calloption]]]()
 
* [[Calloption]]]()
 
* [[Putoption]]()
 
* [[Putoption]]()
Line 193: Line 198:
 
* [[Pvgperp]]()
 
* [[Pvgperp]]()
 
* [[Wacc]]()
 
* [[Wacc]]()
<footer>Financial functions / {{PAGENAME}} / Advanced probability functions</footer>
+
* [[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 now
X = exercise price
T = time in years to exercise
r = risk-free interest rate
theta = 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 now
X = exercise price
T = time in years to exercise
r = risk-free interest rate
theta = 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 rate
Rm = market return
Beta = 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 capital
rD = expected return on debt
Tc = 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:

  1. Generate a level, perpetual cash flow.
  2. Support fixed permanent debt.

Parameters:

rAllEq = cost of capital under all-equity financing
Tc = 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 now
X = exercise price
T = time in years to exercise
r = risk-free interest rate
p = 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 now
X» = exercise price
T = time in years to exercise
r = risk-free interest rate
p = 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 amount
rate = 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 1
rate = interest rate per period
growth = 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 debt
Equity = market value of equity
rD = expected return on debt
rE = expected return on equity
Tc = 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


Comments


You are not allowed to post comments.