-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcost_convertor.m
44 lines (40 loc) · 1.4 KB
/
cost_convertor.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
function[FY2013_cost] = cost_convertor(cost,year_priced)
% function[FY2013_cost] = cost_convertor(cost,year_priced)
%
% This function will convert a cost in dollars in a certain year to FY2013
% dollars. The farthest back it can go is 1995.
%
% Written by Harry Linskens, 14-March-2013
%--------------------------------------------------------------------------
% First, the historical inflation rates are loaded
year_factor = [1995 0.6408;...
1996 0.6558;...
1997 0.6723;...
1998 0.6913;...
1999 0.7102;...
2000 0.7285;...
2001 0.7516;...
2002 0.7717;...
2003 0.7979;...
2004 0.8240;...
2005 0.8583;...
2006 0.8867;...
2007 0.9108;...
2008 0.9375;...
2009 0.9501;...
2010 0.9701;...
2011 0.9850;...
2012 1;];
extrap = 1.0201;
% Now, consider if the year priced is before 2013.
if year_priced < 2013
[year_index] = find(year_priced == year_factor(:,1));
factor = year_factor(year_index,2);
FY2013_cost = cost/factor;
elseif year_priced < 1995
error('Too far back, please enter a year priced of 1995 or later')
else
delta_year = year_priced - 2013;
FY2013_cost = cost/(extrap^delta_year);
end
%%%%%