# Running PV

ratprint:false; numer:TRUE;kill(all);

Spot rate from 1 start

s:[1.0, 1.4, 1.6, 1.7, 1.8, 1.85, 1.87];

Cahsflow  from 0 start

cf:[0, 4, 4, 4, 4, 4, 4, 104];

d[0]:1; for k:1 step 1 thru 7 do(d[k]:1/(1+s[k]/100)^k );

for k:0 step 1 thru 6 do( dd[k]:d[k+1]/d[k]);

for k:0 step 1 thru 6 do(print( d[k]," :  ", dd[k]));

PV[7]:cf[8]; for k:6 step -1 thru 0 do(PV[k]:cf[k+1]+dd[k]*PV[k+1]);

for k:0 step 1 thru 7 do(print(PV[k]));

data2d:makelist([i, PV[i]], i, 0, 7);

data3d:makelist([i,s[i],PV[i]],i,1,7); data3d:append([[0,s[1],PV[0]]],data3d);

spot:makelist([i,s[i],0], i,1,7); spot:append([[0,s[1],0]],spot);

load(draw);

draw2d(
       point_type    = 6,
       point_size    = 3,
       points_joined = true,
       color         = blue,
       key           = "puntazos",
           points(data2d));

draw3d( 
       key           = "puntazos",     
       point_type    = 6,
       point_size    = 3,
       points_joined = true,
       color         = blue,
           points(data3d),
           points(spot));

Legal Notice: The copyright for this application is owned by the authors.
The authors are not responsible for any errors contained within and are not liable
for any damages resulting from the use of this material.
This application is intended for non-commercial, non-profit use only.
Contact the authors for permission if you wish to use this application in for-profit activities.
Contact address: Prof. Yukari Shirota, Faculty of Economics, Gakushuin University, 1-5-1 Mejiro,
Toshima-ku, Tokyo, 171-8588 JAPAN,  yukari.shirota@ipsj.or.jp