financial (version 0.2)

tvm: Fitting time value of money models

Description

This function fits generalized time value of money models.

Usage

tvm(i = 0, n = 1, pv = 0, fv = 0, pmt = 0, days = 360/pyr, adv = 0, pyr = 12, cyr = pyr)

Arguments

i
a vector of nominal rates, as percentages.
n
a vector of period numbers.
pv
a vector of present values.
fv
a vector of future values.
pmt
a vector of payments.
days
a vector of days from begin of period to make payment. Default value is equivalent to END mode, 0 means BEGIN mode.
adv
a vector of numbers of payments made in advance.
pyr
a vector of numbers of payments per year.
cyr
a vector of numbers of compounding periods per year.

Value

A matrix of class "tvm" containing all the arguments (one row for each argument vector element).

Details

In each variant (row) of arguments, one and EXACTLY one value must be set to NA, and this value is calculated from the others to "fit the model". For example, pv can be set to c(10000,NA) and pmt to c(NA,-100). In first row pmt will be calculated, in the second - present value.

Examples

Run this code
y=tvm(pv=10000,i=1:10,n=10,pmt=NA)
y
update(y,pmt=-1000,pv=NA)
update(y,pmt=-1000,n=NA)

Run the code above in your browser using DataCamp Workspace