Financial Toolbox
  Go to function:
    Search    Help Desk 

Chapter 1
Reference


This chapter contains detailed descriptions of all the functions in the Financial Toolbox. It first groups the functions in task categories and then explains each function in alphabetical order. You may also access the reference material online by typing

Handling and Converting Dates

Current Time and Date
now

Current date and time.
today

Current date.

Date and Time Components
datefind

Indices of date numbers in matrix.
datevec

Date components.
day

Day of month.
eomdate

Last date of month.
eomday

Last day of month.
hour

Hour of date or time.
lweekdate

Date of last occurrence of weekday in month.
minute

Minute of date or time.
month

Month of date.
months

Number of whole months between dates.
nweekdate

Date of specific occurrence of weekday in month.
second

Second of date or time.
weekday

Day of the week.
year

Year of date.
yeardays

Number of days in year.


Date Conversion
datenum

Create date number.
datestr

Create date string.
m2xdate

MATLAB serial date number to Excel serial date number.
x2mdate

Excel serial date number to MATLAB serial date number.

Financial Dates
busdate

Next or previous business day.
datemnth

Date of day in future or past month.
datewrkdy

Date of future or past workday.
days360

Days between dates based on 360-day year.
days365

Days between dates based on 365-day year.
daysact

Actual number of days between dates.
daysdif

Days between dates for any day-count basis.
fbusdate

First business date of month.
holidays

Holidays and non-trading days.
isbusday

True for dates that are business days.
lbusdate

Last business date of month.
wrkdydif

Number of working days between dates.
yearfrac

Fraction of year between dates.

Note:
The date functions datenum, datestr, datevec, eomday, now, and weekday now ship with basic MATLAB. They originally shipped only with the Financial Toolbox, and their descriptions remain in this manual for your convenience.

Coupon Bond Dates
accrfrac

Fraction of coupon period before settlement.
cfamounts

Cash flow and time mapping for bond portfolio.

cfdates

Cash flow dates for a fixed-income security with periodic payments.
cftimes

Time factors corresponding to bond cash flow dates.
cpncount

Coupon payments remaining until maturity.
cpndaten

Next coupon date after settlement date.
cpndatenq

Next quasi coupon date for fixed income security.

cpndatep

Previous coupon date before settlement date.
cpndatepq

Previous quasi coupon date for fixed income security.

cpndaysn

Number of days between settlement date and next coupon date.
cpndaysp

Number of days between previous coupon date and settlement date.
cpnpersz

Number of days in coupon period containing settlement date.

Formatting Currency and Charting Financial Data

Currency Formats
cur2frac

Decimal currency value to fractional value.
cur2str

Bank formatted text.
frac2cur

Fractional currency value to decimal value.

Financial Charts
bolling

Bollinger band chart.
candle

Candlestick chart.
dateaxis

Convert serial-date axis labels to calendar-date axis labels.
highlow

High, low, open, close chart.
movavg

Leading and lagging moving averages chart.
pointfig

Point and figure chart.

Analyzing and Computing Cash Flows

Annuities
annurate

Periodic interest rate of annuity.
annuterm

Number of periods to obtain value.

Amortization and Depreciation
amortize

Amortization.
depfixdb

Fixed declining-balance depreciation.
depgendb

General declining-balance depreciation.
deprdv

Remaining depreciable value.
depsoyd

Sum of years' digits depreciation.
depstln

Straight-line depreciation.

Present Value
pvfix

Present value with fixed periodic payments.
pvvar

Present value of varying cash flow.

Future Value
fvdisc

Future value of discounted security.
fvfix

Future value with fixed periodic payments.
fvvar

Future value of varying cash flow.

Payment Calculations
payadv

Periodic payment given number of advance payments.
payodd

Payment of loan or annuity with odd first period.
payper

Periodic payment of loan or annuity.
payuni

Uniform payment equal to varying cash flow.

Rates of Return
effrr

Effective rate of return.

irr

Internal rate of return.

mirr

Modified internal rate of return.

nomrr

Nominal rate of return.
taxedrr

After-tax rate of return.
xirr

Internal rate of return for nonperiodic cash flow.

Cash Flow Sensitivities
cfconv

Cash flow convexity.
cfdur

Cash flow duration and modified duration.

Fixed-Income Securities

Accrued Interest
acrubond

Accrued interest of security with periodic interest payments.
acrudisc

Accrued interest of discount security paying at maturity.

Prices
bndprice

Price a fixed income security from yield to maturity.
prbond

Price of security with regular periodic interest payments.
prdisc

Price of discounted security.
prmat

Price with interest at maturity.
proddf

Price with odd first period.
proddfl

Price with odd first and last periods and settlement in first period.
proddl

Price with odd last period.
prtbill

Price of Treasury bill.

Term Structure of Interest Rates
disc2zero

Zero curve given a discount curve.
fwd2zero

Zero curve given a forward curve.
pyld2zero

Zero curve given a par yield curve.
tbl2bond

Treasury bond parameters given Treasury bill parameters.
tr2bonds

Term-structure parameters given Treasury bond parameters.
zbtprice

Zero curve from coupon bond prices, using bootstrap method.
zbtyield

Zero curve from coupon bond yields, using bootstrap method.
zero2disc

Discount curve given a zero curve.
zero2fwd

Forward curve given a zero curve.
zero2pyld

Par yield curve given a zero curve.

Yields
beytbill

Bond equivalent yield for Treasury bill.
bndyield

Yield to maturity for fixed income security.
discrate

Discount rate of a security.
yldbond

Yield to maturity of bond.

ylddisc

Yield of discounted security.
yldmat

Yield of security with interest at maturity.
yldoddf

Yield of security with odd first period.
yldoddfl

Yield of security with odd first and last periods and settlement in first period.
yldoddl

Yield of security with odd last period.
yldtbill

Yield of Treasury bill.

Interest Rate Sensitivities
bondconv

Convexity.
bonddur

Macaulay and modified durations.

Analyzing Portfolios

Portfolio Analysis
corr2cov

Convert standard deviation and correlation to covariance.

cov2corr

Convert covariance to standard deviation and correlation coefficient.

ewstats

Expected return and covariance from return time series.

frontcon

Mean-variance efficient frontier.

pcalims

Linear inequalities for individual asset allocation.

pcgcomp

Linear inequalities for asset group comparison constraints.

pcglims

Linear inequalities for asset group minimum and maximum allocation.

pcpval

Linear inequalities for fixing total portfolio value.

portalloc

Optimal capital allocation.
portcons

Portfolio constraints.

portopt

Portfolios on constrained efficient frontier.

portrand

Randomized portfolio risks, returns, and weights.
portstats

Portfolio expected return and risk.
portsim

Random simulation of correlated asset returns.
portvrisk

Portfolio value at risk
ret2tick

Price tick series from incremental returns and initial price.
tick2ret

Incremental return series from a tick price series.

Pricing and Analyzing Derivatives

Option Valuation and Sensitivity
bdtbond

Black-Derman-Toy pricing of option-embedded bonds.
bdttrans

Translate a tree returned by bdtbond.
binprice

Binomial put and call pricing.
blkprice

Black's option pricing.

blsdelta

Black-Scholes sensitivity to underlying price change.
blsgamma

Black-Scholes sensitivity to underlying delta change.
blsimpv

Black-Scholes implied volatility.
blslambda

Black-Scholes elasticity.
blsprice

Black-Scholes put and call pricing.
blsrho

Black-Scholes sensitivity to interest rate change.
blstheta

Black-Scholes sensitivity to time-until-maturity change.
blsvega

Black-Scholes sensitivity to underlying price volatility.
opprofit

Option profit.

GARCH Processes

Univariate GARCH Processes
ugarch

GARCH parameter estimation.
ugarchllf

Log-likelihood objective function.
ugarchpred

Forecast conditional variance.

ugarchsim

Simulate GARCH process.



[ Previous | Help Desk | Next ]