PV (times,flows,freq,rates);
The PV function returns a scalar that contains the present value of the cash flows based on the specified frequency and rates.
The arguments to the function are as follows:
is an column vector of times. Elements should be nonnegative.
is an column vector of cash flows.
is a scalar that represents the base of the rates to be used for discounting the cash flows. If positive, it represents discrete compounding as the reciprocal of the number of compoundings per period. If zero, it represents continuous compounding. If –1, the rates represent per-period discount factors. No other negative values are accepted.
is an column vector of rates to be used for discounting the cash flows. Elements should be positive.
A general present value relationship can be written as
where P is the present value of the asset, , is the sequence of cash flows from the asset, is the time to the kth cash flow in periods from the present, and is the discount function for time t. The discount factors are as follows:
with per-unit-time-period discount factors :
with continuous compounding:
with discrete compounding:
where is the frequency, the reciprocal of the number of compoundings per unit time period.
The following statements present an example of using the PV function in the DATA step:
data a; pv = mort(., 438.79, 0.10/12, 30*12); run; proc print data=a; run;
You can do the same computation by using the PV function in SAS/IML software. The first example uses a monthly rate; the second example uses an annual rate.
proc iml; /* If rate is specified as annual rate divided by 12 and FREQ=1, * then results are equal to those computed by the MORT function. */ timesn = t(1:360); flows = repeat(438.79, 360); rate = repeat(0.10/12, 360); freq = 1; pv = pv(timesn, flows, freq, rate); print pv; /* If rate is specified as annual rate, then the cash flow TIMES * need to be specified in 1/12 increments and the FREQ=1/12. * This produces the same result as the previous PV call. */ timesn = t(do(1/12, 30, 1/12)); flows = repeat(438.79, 360); rate = repeat(0.10, 360); /* specify annual rate */ freq = 1/12; /* 12 compoundings annually */ pv = pv(timesn, flows, freq, rate); print pv;