Mean (mean)
The average of a list of numbers, or the expected value of a distribution.
How to write it
mean(data)
The sum of the data divided by how many there are.
- data
- The numbers to average. Symbols are allowed. Takes a list.
mean(distribution)
The expected value of a distribution.
- distribution
- A distribution such as normal_distribution(mu, sigma). Takes an expression.
mean(process)
The expected value of a stochastic process at a time.
- process
- A process at a time, written construct(p, t), or p(t) for a stored process p. Takes an expression.
mean(process, t)
The same, with the time written beside the process.
- process
- A process such as geometric_brownian_motion_process(mu, sigma, x0). Takes an expression.
- t
- The time, a variable or a number. Takes an expression.
Examples
mean([2, 4, 4, 4, 5, 5, 7, 9])In the solver,
Open in the solvermean([2, 4, 4, 4, 5, 5, 7, 9])gives5.mean([a, b, c])In the solver,
Open in the solvermean([a, b, c])gives(a + b + c)/3.mean(normal_distribution(mu, sigma))In the solver,
Open in the solvermean(normal_distribution(mu, sigma))givesmu.mean(binomial_distribution(10, 1/4))In the solver,
Open in the solvermean(binomial_distribution(10, 1/4))gives5/2.mean(construct(geometric_brownian_motion_process(mu, sigma, x0), t))In the solver,
Open in the solvermean(construct(geometric_brownian_motion_process(mu, sigma, x0), t))givesx0*e^(mu*t).mean(geometric_brownian_motion_process(mu, sigma, x0), t)In the solver,
Open in the solvermean(geometric_brownian_motion_process(mu, sigma, x0), t)givesx0*e^(mu*t).mean(ornstein_uhlenbeck_process(mu, sigma, theta, x0), t)In the solver,
Open in the solvermean(ornstein_uhlenbeck_process(mu, sigma, theta, x0), t)givese^(-t*theta)*(x0 - mu) + mu.
Functions its examples use
- normal_distribution
The normal distribution with mean mu and standard deviation sigma.
- binomial_distribution
The number of successes in n independent trials that each succeed with chance p.
- construct
Apply a head that is itself computed to arguments, as in f'(0) or (x => body)(a).
- geometric_brownian_motion_process
A process that grows at rate mu with relative noise sigma, started at x0.
- ornstein_uhlenbeck_process
A process pulled toward mu at rate theta, with noise sigma, started at x0.
Related functions
- median
The middle value of a list of numbers, or the mean of the two middle ones.
- ito_process
A process given by its drift and diffusion: dX = drift dt + diffusion dW.
- mode
The most frequent value of a list, or a list of them when several are equally frequent.
- ito_integral
The Itô integral of an expression of the Wiener value w and the time s, from 0 to t.
- ito_formula_data
The certified record behind ito_formula: its result, validity, certificate and theorem.
- ito_formula
Itô's lemma: the differential of an expression of states that follow an Itô process.