Difference between revisions of "Normalize"

Line 2: Line 2:
 
[[Category:Doc Status C]] <!-- For Lumina use, do not change -->
 
[[Category:Doc Status C]] <!-- For Lumina use, do not change -->
  
= Normalize(y'',x,i'') =
+
== Normalize(y'', x, i'') ==
+
Rescales the values in «y» so that the area under the curve described by the points (x, y') is equal to 1, where ''y''' is the result.  When either «y» or «x» is an index, you can omit «i», and use just [[Normalize]](y, x), although it is highly recommended that you always include the «i» parameter to avoid mistakes and mis-interpretation that may result when it is omitted.
Rescales the values in «y» so that the area under the curve described by the points (x,y') is equal to 1, where y' is the result.  When either «y» or «x» is an index, you can omit «i», and use just [[Normalize]](y,x), although it is highly recommended that you always include the «i» parameter to avoid mistakes and mis-interpretation that may result when it is omitted.
 
  
[[Normalize]](y,x,i) is equivalent to:
+
[[Normalize]](y, x, i) is equivalent to:
:y / [[Area]](y,x,i:i)
+
:<code>y/Area(y, x, i: i)</code>
  
::''Should the function [[Normalize]] be deprecated and eventually removed from Analytica? See the discussion tab and please weigh in with your opinions!''
+
[[Normalize]] does not force the values along index «i» to sum to 1; to make the values sum to 1, use <code>y/Sum(y, i).</code>
  
= Library =
+
[[Normalize]] does not cause the length of the resulting vector to be 1.  To normalize in that sense, use <code>y/Sqrt(Sum(y^2, i)).</code>
  
:Array functions
+
== Library ==
 +
Array functions
  
= Notes =
+
== Treatment of null values ==
 +
When «x» contains a [[Null]] value, that point has no impact the normalization constant.
  
[[Normalize]] does '''not''' force the values along index «i» to sum to 1; to make the values sum to 1, use
+
When «y» contains a [[Null]] value, the result for that cell will be [[null]], and the point is interpreted as a gap in the function, so that the trapezoid extending from the previous «x» value to the next «x» value is not included in the normalization constant.  See the wiki page on [[Integrate]] for more details about this treatment.
y/[[Sum]](y,i).
 
 
 
[[Normalize]] does '''not''' cause the length of the resulting vector to be 1.  To normalize in that sense, use:
 
y / [[Sqrt]]([[Sum]](y^2,i))
 
 
 
 
 
= Treatment of [[null]] values =
 
 
 
When «x» contains a [[null]] value, that point has no impact the normalization constant.
 
 
 
When «y» contains a [[null]] value, the result for that cell will be [[null]], and the point is interpreted as a gap in the function, so that the trapezoid extending from the previous «x» value to the next «x» value is not included in the normalization constant.  See the wiki page on [[Integrate]] for more details about this treatment.
 
 
 
= Ordering of points =
 
 
 
''New to [[What's new in Analytica 4.2?|Analytica 4.2]]''
 
  
 +
== Ordering of points ==
 
[[Normalize]] treats the points as a set of points, such that the ordering of the points does not impact the result.  It is usually cleanest if the points are increasing in «x», but if they aren't, the result for each point is the same you would get for that point if you first sorted the points along «x».  The one exception to order-invariance is when the same value occurs twice in «x», which encodes a discontinuity.  In this case, the first point with the given «x» value provides the y-value to the left, and the last such point provides the value to the right of the discontinuity.
 
[[Normalize]] treats the points as a set of points, such that the ordering of the points does not impact the result.  It is usually cleanest if the points are increasing in «x», but if they aren't, the result for each point is the same you would get for that point if you first sorted the points along «x».  The one exception to order-invariance is when the same value occurs twice in «x», which encodes a discontinuity.  In this case, the first point with the given «x» value provides the y-value to the left, and the last such point provides the value to the right of the discontinuity.
  
= See Also =
+
== See Also ==
 
 
 
* [[Area]]
 
* [[Area]]
 
* [[Integrate]]
 
* [[Integrate]]

Revision as of 19:47, 19 January 2016


Normalize(y, x, i)

Rescales the values in «y» so that the area under the curve described by the points (x, y') is equal to 1, where y' is the result. When either «y» or «x» is an index, you can omit «i», and use just Normalize(y, x), although it is highly recommended that you always include the «i» parameter to avoid mistakes and mis-interpretation that may result when it is omitted.

Normalize(y, x, i) is equivalent to:

y/Area(y, x, i: i)

Normalize does not force the values along index «i» to sum to 1; to make the values sum to 1, use y/Sum(y, i).

Normalize does not cause the length of the resulting vector to be 1. To normalize in that sense, use y/Sqrt(Sum(y^2, i)).

Library

Array functions

Treatment of null values

When «x» contains a Null value, that point has no impact the normalization constant.

When «y» contains a Null value, the result for that cell will be null, and the point is interpreted as a gap in the function, so that the trapezoid extending from the previous «x» value to the next «x» value is not included in the normalization constant. See the wiki page on Integrate for more details about this treatment.

Ordering of points

Normalize treats the points as a set of points, such that the ordering of the points does not impact the result. It is usually cleanest if the points are increasing in «x», but if they aren't, the result for each point is the same you would get for that point if you first sorted the points along «x». The one exception to order-invariance is when the same value occurs twice in «x», which encodes a discontinuity. In this case, the first point with the given «x» value provides the y-value to the left, and the last such point provides the value to the right of the discontinuity.

See Also

Comments


You are not allowed to post comments.