Difference between revisions of "Uniform distribution"

(parameter estimation)
Line 1: Line 1:
= Function Uniform(x, y) =
+
= Function Uniform(min, max) =
 
[[Category:Doc Status C]] <!-- For Lumina use, do not change -->
 
[[Category:Doc Status C]] <!-- For Lumina use, do not change -->
 
   
 
   
Returns a variable with a uniform distribution between numbers x and y. For example,
+
Returns a variable with a uniform distribution between numbers «min» and «max». For example,
 
  Uniform(a, b)
 
  Uniform(a, b)
 
is a continuous distribution in which all real numbers between a and b are equally probable.
 
is a continuous distribution in which all real numbers between a and b are equally probable.
  
If you omit x and y, it returns a unit uniform between 0 and 1.  
+
If you omit «min» and «max», it returns a unit uniform between 0 and 1.  
  
 
[New to 4.0]
 
[New to 4.0]
If you set optional parameter Integer as true, it returns a discrete uniform distribution over the integers between a and b. For example:
+
If you set optional parameter Integer as true, it returns a discrete uniform distribution over the integers between «min» and «min». For example:
  Uniform(1,100,Integer:True)
+
  [[Uniform]](1,100,Integer:True)
 
is a discrete distribution where each integer 1, 2, .., 99, 100 has an equal probability of 1%.   
 
is a discrete distribution where each integer 1, 2, .., 99, 100 has an equal probability of 1%.   
  
If you want a discrete uniform distribution over each value of an index I, use Chancedist:
+
If you want a discrete uniform distribution over each value of an index I, use [[ChanceDist]]:
  ChanceDist(1/Size(I), I)
+
  [[ChanceDist]](1/[[Size]](I), I)
  
 
Like most distributions, you may use the Over parameter to generate an array of independent distributions for each combination of indexes.  For example:
 
Like most distributions, you may use the Over parameter to generate an array of independent distributions for each combination of indexes.  For example:
  
  Uniform(Over: I, J)
+
  [[Uniform]](Over: I, J)
returns an independent Uniform(0,1) distribution for each combination of values in indexes I and J.
+
returns an independent [[Uniform]](0,1) distribution for each combination of values in indexes I and J.
  
==== Declaration ====
+
= Library =
 +
 
 +
Distribution
 +
 
 +
= Declaration =
  
 
  Uniform(min: Numeric=0; max: Numeric=1; integer: Boolean=false; over: ... Optional Atomic)
 
  Uniform(min: Numeric=0; max: Numeric=1; integer: Boolean=false; over: ... Optional Atomic)
 +
 +
= Parameter Estimation =
 +
 +
Suppose you have real-valued historic data in ''X'', indexed by ''I'', and you wish to estimate the parameters of the continuous uniform distribution.  This is really just a matter of estimating the lower and upper bounds for the data, since the use of this distribution assumes a uniform distribution between those bounds.  The bounds can be estimated using:
 +
«min» := [[Min]](X,I) - 0.5 * ([[Max]](X,I)-[[Min]](X,I)) / [[Sum]](1,I)
 +
«max» := [[Max]](X,I) + 0.5 * ([[Max]](X,I)-[[Min]](X,I)) / [[Sum]](1,I)
 +
 +
If you have discrete integer data in ''D'' indexed by ''I'' and wish to estimate the parameters «min» and «max» for the integer uniform distribution [[Uniform]](«min»,«max»,Integer:True), then the following parameter estimation formulae are appropriate:
 +
«min» := [[Floor]]([[Min]](X,I) - 0.5 * ([[Max]](X,I)-[[Min]](X,I)) / [[Sum]](1,I))
 +
«max» := [[Ceil]]([[Max]](X,I) + 0.5 * ([[Max]](X,I)-[[Min]](X,I)) / [[Sum]](1,I))

Revision as of 21:27, 3 March 2009

Function Uniform(min, max)

Returns a variable with a uniform distribution between numbers «min» and «max». For example,

Uniform(a, b)

is a continuous distribution in which all real numbers between a and b are equally probable.

If you omit «min» and «max», it returns a unit uniform between 0 and 1.

[New to 4.0] If you set optional parameter Integer as true, it returns a discrete uniform distribution over the integers between «min» and «min». For example:

Uniform(1,100,Integer:True)

is a discrete distribution where each integer 1, 2, .., 99, 100 has an equal probability of 1%.

If you want a discrete uniform distribution over each value of an index I, use ChanceDist:

ChanceDist(1/Size(I), I)

Like most distributions, you may use the Over parameter to generate an array of independent distributions for each combination of indexes. For example:

Uniform(Over: I, J)

returns an independent Uniform(0,1) distribution for each combination of values in indexes I and J.

Library

Distribution

Declaration

Uniform(min: Numeric=0; max: Numeric=1; integer: Boolean=false; over: ... Optional Atomic)

Parameter Estimation

Suppose you have real-valued historic data in X, indexed by I, and you wish to estimate the parameters of the continuous uniform distribution. This is really just a matter of estimating the lower and upper bounds for the data, since the use of this distribution assumes a uniform distribution between those bounds. The bounds can be estimated using:

«min» := Min(X,I) - 0.5 * (Max(X,I)-Min(X,I)) / Sum(1,I)
«max» := Max(X,I) + 0.5 * (Max(X,I)-Min(X,I)) / Sum(1,I)

If you have discrete integer data in D indexed by I and wish to estimate the parameters «min» and «max» for the integer uniform distribution Uniform(«min»,«max»,Integer:True), then the following parameter estimation formulae are appropriate:

«min» := Floor(Min(X,I) - 0.5 * (Max(X,I)-Min(X,I)) / Sum(1,I))
«max» := Ceil(Max(X,I) + 0.5 * (Max(X,I)-Min(X,I)) / Sum(1,I))
Comments


You are not allowed to post comments.