Difference between revisions of "Modeling Depreciation"
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | [[Category: | + | [[Category:Models]] |
To model depreciation, two inputs are required: | To model depreciation, two inputs are required: | ||
− | + | # a schedule of spend to be depreciated | |
− | + | # a depreciation schedule | |
For this example, the index time is 10 year series with | For this example, the index time is 10 year series with | ||
− | + | :<code>Constant startYear = 2008</code> | |
− | + | :<code>Time := Sequence (startYear, startYear + 9,1)</code> | |
Example depreciation schedule is a 5yr MACRS depreciation schedule entered as a variable: | Example depreciation schedule is a 5yr MACRS depreciation schedule entered as a variable: | ||
− | + | :<code>Table(time)(.2, .32, .192, .1152, .1152, .0576, 0, 0, 0, 0)</code> | |
− | SpendOverTime is a variable indexed by time with the capital spend amounts as desired: | + | <code>SpendOverTime</code> is a variable indexed by time with the capital spend amounts as desired: |
− | + | :<code>Table(time)(0, 0, 111, 0, 0, 0, 0, 0, 0, 0)</code> | |
− | Create a user defined function: | + | Create a [[User-Defined Functions|user defined function]]: |
+ | <pre style="background:white; border:white; margin-left: 1em;"> | ||
Function_Depreciation, | Function_Depreciation, | ||
− | + | Parameters: (SpendOverTime, DepreciationSchedule), | |
− | + | Definition: | |
index depr_years = copyindex(time); | index depr_years = copyindex(time); | ||
− | var deprStartyr:=time; | + | var deprStartyr := time; |
− | sum(if time-depr_years+1<1 then 0 else | + | sum(if time - depr_years + 1 < 1 then 0 else |
− | slice(SpendOverTime,time,Depr_years-startYear+1)*slice(depreciationSchedule,time,time-depr_years+1),depr_years) | + | slice(SpendOverTime, time, Depr_years - startYear + 1)*slice(depreciationSchedule, time, time - depr_years + 1), depr_years) |
+ | </pre> | ||
Then create a depreciation test variable to check the result | Then create a depreciation test variable to check the result | ||
− | + | :<code>Variable: DepreciationTest</code> | |
− | + | :<code>definition: function_Depreciation(spendOverTime, DepreciationSchedule)</code> | |
+ | |||
+ | == Using Dynamic == | ||
+ | The following model models Amortization (same concept as depreciation) using [[Dynamic]], which an approach slightly different from the above description: [[media:Fixed Amortization Schedule.ana|Fixed Amortization Schedule.ana]] | ||
+ | |||
+ | The model requires Analytica 4.2 or better to use. (Nothing here requires 4.2 -- it is just that some 4.2 features were used for convenience). | ||
+ | |||
+ | ==See Also== | ||
+ | * [[Slice]] | ||
+ | * [[CopyIndex]] | ||
+ | * [[Dynamic]] | ||
+ | * [[Indexes and arrays: An introduction]] | ||
+ | * [[Create a model]] | ||
+ | * [[Tutorial: Create a model]] | ||
+ | * [[Tutorial: Arrays]] | ||
+ | * [[User-Defined Functions]] |
Latest revision as of 19:12, 28 April 2016
To model depreciation, two inputs are required:
- a schedule of spend to be depreciated
- a depreciation schedule
For this example, the index time is 10 year series with
Constant startYear = 2008
Time := Sequence (startYear, startYear + 9,1)
Example depreciation schedule is a 5yr MACRS depreciation schedule entered as a variable:
Table(time)(.2, .32, .192, .1152, .1152, .0576, 0, 0, 0, 0)
SpendOverTime
is a variable indexed by time with the capital spend amounts as desired:
Table(time)(0, 0, 111, 0, 0, 0, 0, 0, 0, 0)
Create a user defined function:
Function_Depreciation, Parameters: (SpendOverTime, DepreciationSchedule), Definition: index depr_years = copyindex(time); var deprStartyr := time; sum(if time - depr_years + 1 < 1 then 0 else slice(SpendOverTime, time, Depr_years - startYear + 1)*slice(depreciationSchedule, time, time - depr_years + 1), depr_years)
Then create a depreciation test variable to check the result
Variable: DepreciationTest
definition: function_Depreciation(spendOverTime, DepreciationSchedule)
Using Dynamic
The following model models Amortization (same concept as depreciation) using Dynamic, which an approach slightly different from the above description: Fixed Amortization Schedule.ana
The model requires Analytica 4.2 or better to use. (Nothing here requires 4.2 -- it is just that some 4.2 features were used for convenience).
See Also
Comments
Enable comment auto-refresher