Changeset 37174 in project


Ignore:
Timestamp:
02/01/19 01:31:36 (3 weeks ago)
Author:
iraikov
Message:

statistics doc update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/statistics

    r36305 r37174  
    1212To use this library, you need to understand the underlying statistics.  In brief:
    1313
    14 The [[http://en.wikipedia.org/wiki/Binomial_distribution|Binomial distribution]] is used when counting discrete events in a series of trials, each of which events has a probability p of producing a positive outcome.  An example would be tossing a coin {{n}} times: the probability of a head is {{p}}, and the distribution gives the expected number of heads in the {{n}} trials.  The binomial distribution is defined as B(n, p).
    15 
    16 The [[http://en.wikipedia.org/wiki/Poisson_distribution|Poisson distribution]] is used to count discrete events which occur with a known average rate.  A typical example is the decay of radioactive elements.  A poisson distribution is defined Pois(mu).
    17 
    18 The [[http://en.wikipedia.org/wiki/Normal_distribution|Normal distribution]] is used for real-valued events which cluster around a specific mean with a symmetric variance.  A typical example would be the distribution of people's heights.  A normal distribution is defined N(mean, variance).
     14The [[http://en.wikipedia.org/wiki/Binomial_distribution|Binomial
     15distribution]] is used when counting discrete events in a series of
     16trials, each of which events has a probability p of producing a
     17positive outcome.  An example would be tossing a coin {{n}} times: the
     18probability of a head is {{p}}, and the distribution gives the
     19expected number of heads in the {{n}} trials.  The binomial
     20distribution is defined as B(n, p).
     21
     22The [[http://en.wikipedia.org/wiki/Poisson_distribution|Poisson
     23distribution]] is used to count discrete events which occur with a
     24known average rate.  A typical example is the decay of radioactive
     25elements.  A poisson distribution is defined Pois(mu).
     26
     27The [[http://en.wikipedia.org/wiki/Normal_distribution|Normal
     28distribution]] is used for real-valued events which cluster around a
     29specific mean with a symmetric variance.  A typical example would be
     30the distribution of people's heights.  A normal distribution is
     31defined N(mean, variance).
    1932
    2033=== Provided Functions
     
    436449==== Correlation and regression
    437450
    438 <procedure>(linear-regression line-defn)</procedure>
    439 Given a line definition as a list of point pairs, first prints to the terminal and then returns 5 '''values''' for the best fitting line through the points:
     451<procedure>(linear-regression xs ys)</procedure>
     452
     453Given a line definition as lists of point coordinates, first prints to
     454the terminal and then returns 5 '''values''' for the best fitting line
     455through the points:
    440456
    441457* the y-intercept
     
    447463(This is also called the Pearson correlation; used when relation expected to be linear.  Also see {{spearman-rank-correlation}}.)
    448464
    449  > (linear-regression '((1.0 0.1) (2.0 0.3) (3.0 0.8)))
     465 > (linear-regression '(1.0 2.0 3.0) '(0.1 0.3 0.8))
    450466 Intercept = -0.3, slope = 0.35, r = 0.970725343394151, R^2 = 0.942307692307692, p = 0.154420958311267
    451467 -0.3
     
    456472 ; 5 values
    457473
    458 <procedure>(correlation-coefficient line-defn)</procedure>
     474<procedure>(correlation-coefficient xs ys)</procedure>
    459475As above, but only returns the value of ''r'':
    460476
    461  > (correlation-coefficient '((1.0 0.1) (2.0 0.3) (3.0 0.8)))
     477 > (correlation-coefficient '(1.0 2.0 3.0) '(0.1 0.3 0.8))
    462478 0.970725343394151
    463479
     
    468484As above, but computes the correlations from given lists of points.
    469485
    470 <procedure>(spearman-rank-correlation points)</procedure>
    471 Returns two '''values''', the Spearman Rank measure of correlation between given list of points, and the p-significance of the correlation.  (This correlation is used for non-linear relations; compare with {{linear-regression}}.)
     486<procedure>(spearman-rank-correlation xs ys)</procedure>
     487Returns two '''values''', the Spearman Rank measure of correlation between the given lists of point coordinates, and the p-significance of the correlation.  (This correlation is used for non-linear relations; compare with {{linear-regression}}.)
    472488
    473489==== Significance test functions
     
    508524=== Version History
    509525
     526* 0.11: refactoring correlation and regression interface to take two separate dataset arguments
    510527* 0.9: ported to CHICKEN 5
    511528* 0.8: added cumsum and random-weighted-sample
Note: See TracChangeset for help on using the changeset viewer.