Difference between revisions of "Uncumulate"

Line 2: Line 2:
 
[[Category:Array functions]]
 
[[Category:Array functions]]
 
[[Category:Doc Status D]] <!-- For Lumina use, do not change -->
 
[[Category:Doc Status D]] <!-- For Lumina use, do not change -->
==Uncumulate(x,I, firstElement)==
+
==Uncumulate(x, i, firstElement)==
  
Finds the difference between each element of x and its predecessor along I.
+
Finds the difference between each element of x and its predecessor along i.
  
Uncumulate(x, i) returns an array whose first element (along i) is the first element of x, and each other element is the difference between the corresponding element of x and the previous element of x. Uncumulate(x, i, firstElement) returns an array with the first element along i equal to firstElement, and each other element equal to the difference between the corresponding element of x and the previous element of x.
+
Uncumulate(x, i) returns an array whose first element (along i) is the first element of x, and each other element is the difference between the corresponding element of x and the previous element of x.  
 +
 
 +
Uncumulate(x, i, firstElement) returns an array with the first element along i equal to firstElement, and each other element equal to the difference between the corresponding element of x and the previous element of x.
  
 
Uncumulate(x, i) is the inverse of Cumulate(x, i). Uncumulate(x, i, 0) is similar to a discrete differential operator.
 
Uncumulate(x, i) is the inverse of Cumulate(x, i). Uncumulate(x, i, 0) is similar to a discrete differential operator.
Line 12: Line 14:
 
==Examples==
 
==Examples==
  
Uncumulate(Cost_of_ownership, Time,0) → Car_type &darr; , Time &uarr;
+
The following example returns a table that shows an increase in the cost ownership of certain car types over a certain period of time.
  
<code>Variable Cost_of_ownership :=</code>
+
<code>Uncumulate (Cost_of_ownership, Time)</code>
 
{| border="1"  
 
{| border="1"  
 
! !! colspan="5" style="text-align: left;" | Time &#9654;
 
! !! colspan="5" style="text-align: left;" | Time &#9654;
Line 47: Line 49:
 
|}
 
|}
  
==See Also==
+
The next example returns a table that shows the increase in the cost of ownership of cars compared to the previous time period and also sets the first value to 0.
[[Array_Function_Example_Variables|Example variables]]
+
 
 +
<code>Uncumulate (Cost_of_ownership, Time, 0)</code>
 +
{| border="1" 
 +
! !! style="text-align: left;" colspan="5" | Time &#9654;
 +
|-
 +
! style="width:100px;" |'''Car_type &#9660; '''
 +
! style="width:75px;" |'''0'''
 +
! style="width:75px;" |'''1'''
 +
! style="width:75px;" |'''2'''
 +
! style="width:75px;" |'''3'''
 +
! style="width:75px;" |'''4'''
 +
|-
 +
!'''VW'''
 +
| 0
 +
| 2951
 +
| 3098
 +
| 3253
 +
| 3416
 +
|-
 +
!'''Honda '''
 +
| 0
 +
| 3847
 +
| 3897
 +
| 4166
 +
| 4365
 +
|-
 +
!'''BMW'''
 +
| 0
 +
| 3294
 +
| 3409
 +
| 3529
 +
| 3656
 +
|}
  
 
==See Also==
 
==See Also==
Line 54: Line 88:
 
* [[Cumulate]]
 
* [[Cumulate]]
 
* [[Array_Function_Example_Variables|Example variables]]
 
* [[Array_Function_Example_Variables|Example variables]]
__FORCETOC__
 

Revision as of 04:06, 1 November 2015

Uncumulate(x, i, firstElement)

Finds the difference between each element of x and its predecessor along i.

Uncumulate(x, i) returns an array whose first element (along i) is the first element of x, and each other element is the difference between the corresponding element of x and the previous element of x.

Uncumulate(x, i, firstElement) returns an array with the first element along i equal to firstElement, and each other element equal to the difference between the corresponding element of x and the previous element of x.

Uncumulate(x, i) is the inverse of Cumulate(x, i). Uncumulate(x, i, 0) is similar to a discrete differential operator.

Examples

The following example returns a table that shows an increase in the cost ownership of certain car types over a certain period of time.

Uncumulate (Cost_of_ownership, Time)

Time ▶
Car_type ▼ 0 1 2 3 4
VW 2810 2951 3098 3253 3416
Honda 3535 3847 3897 4166 4365
BMW 3185 3294 3409 3529 3656

The next example returns a table that shows the increase in the cost of ownership of cars compared to the previous time period and also sets the first value to 0.

Uncumulate (Cost_of_ownership, Time, 0)

Time ▶
Car_type ▼ 0 1 2 3 4
VW 0 2951 3098 3253 3416
Honda 0 3847 3897 4166 4365
BMW 0 3294 3409 3529 3656

See Also

Comments


You are not allowed to post comments.