Constructing and Analyzing Cash Flows Using the Finance Package
Constructing Cash Flows
Performing Sensitivity Analysis
The Financial Modeling package provides a number of tools for constructing cash flows and for performing basic sensitivity analysis. Here is the list of related commands.
calculate the basis point sensitivity of future cash flows
return the set of cash flows for a bond or a swap
calculate the convexity of a set of cash flows
calculate the duration of a set of cash flows
construct a fixed-rate coupon on a term structure
construct an in-arrear indexed coupon
calculate the internal rate of return of a set of cash flows or a bond
construct a coupon at par on a term structure
construct a simple cash flow at a given date
return the net present value of future cash flows
construct an up-front indexed coupon on a term structure
First construct a simple cash flow that pays 100 on the first business day three months from now. Set the global evaluation date to November 17, 2006.
SetEvaluationDate⁡November 17, 2006;
December 8, 2006
payment_date:=February 20, 2007
cash_flow1:=100. on February 20, 2007
Every cash flow is represented by a module with two exports: amount and date. The first one holds the amount to be paid. The second one holds the payment date.
February 20, 2007
You can calculate the net present value of this cash flow using any given discount rate.
This is the value of our cash flow on November 17, 2006, which is the global evaluation date. You can use different dates by using appropriate term structures or by specifying the reference date explicitly.
NetPresentValue⁡cash_flow1,0.03,referencedate=January 18, 2006;
You can also construct cash flows that represent fixed- and floating-rate coupon payments.
accrual_start_date:=June 17, 2007
accrual_end_date:=September 17, 2007
cash_flow2:=.7561643836 on September 17, 2007
September 17, 2007
Next construct a floating-rate coupon payment.
start_history:=August 8, 2006
R⁡September 15, 2006;
R⁡January 10, 2007;
R⁡November 7, 2007;
cash_flow3:=10.00751462 on August 8, 2008
Consider the set of cash flows defined previously.
You can calculate the convexity of our set of cash flows using the 5% and the 4% rate.
Another sensitivity measure is the basis point sensitivity.
You can also compute 3 different types of duration at different market prices.
You can use the internal rate of return of your set of cash flows to compute the Macaulay duration.
Calendars worksheet, Term Structures worksheet, Stochastic Processes worksheet, Day Counters worksheet, Lattice Methods worksheet
Download Help Document