Difference between revisions of "Array-reducing functions"

(Created page with "Category:Analytica User Guide <breadcrumbs>Analytica User Guide > More Array Functions > {{PAGENAME}}</breadcrumbs> __TOC__ ==See Also== <footer>Functions that create a...")
 
Line 4: Line 4:
 
__TOC__
 
__TOC__
  
 +
An array-reducing function operates across a dimension of an array and returns a result that has one dimension less than the number of dimensions of its input array. When applied to an array of <code>n</code> dimensions, a reducing function produces an array that contains <code>n-1</code> dimensions. Examples include, '''Sum(x, i)''', Product(x,i), Max(x, i), Min(x, i)''', and others described below. The subscript construct '''x[i = v]''' and related subscript and slice functions also reduce arrays by a dimension (see [[Subscript and slice of a subarray]]).
 +
 +
The function '''Sum(x, i)''' illustrates some properties of reducing functions.
 +
 +
'''Examples'''
 +
 +
<code>Sum(Car_prices, Car_type) →</code>
 +
 +
<code>Variable Rate_of_inflation :=</code>
 +
{| class=''wikitable'' border="1"
 +
! colspan="5" style="text-align: left;" | Years &#9654;
 +
|-
 +
! style="width:75px;" |'''2005            '''
 +
! style="width:75px;" |'''2006            '''
 +
! style="width:75px;" |'''2007            '''
 +
! style="width:75px;" |'''2008            '''
 +
! style="width:75px;" |'''2009            '''
 +
|-
 +
| 59K
 +
| 62K
 +
| 66K
 +
| 71K
 +
| 76K
 +
|}
  
 
==See Also==
 
==See Also==
 
<footer>Functions that create arrays / {{PAGENAME}} / Transforming functions</footer>
 
<footer>Functions that create arrays / {{PAGENAME}} / Transforming functions</footer>

Revision as of 03:11, 11 December 2015

An array-reducing function operates across a dimension of an array and returns a result that has one dimension less than the number of dimensions of its input array. When applied to an array of n dimensions, a reducing function produces an array that contains n-1 dimensions. Examples include, Sum(x, i), Product(x,i), Max(x, i), Min(x, i), and others described below. The subscript construct x[i = v] and related subscript and slice functions also reduce arrays by a dimension (see Subscript and slice of a subarray).

The function Sum(x, i) illustrates some properties of reducing functions.

Examples

Sum(Car_prices, Car_type) →

Variable Rate_of_inflation :=

Years ▶
2005 2006 2007 2008 2009
59K 62K 66K 71K 76K

See Also

Comments


You are not allowed to post comments.