expectation function
The expected value of an expression of a variable with a distribution or a process.
How to write it
expectation(f, distribution)
The expected value of the expression.
- f
- The expression of the variable. Takes an expression.
- distribution
- The variable and its law, written distributed(x, d). Takes an expression.
Examples
expectation(x^2, distributed(x, normal_distribution(0, 1)))In the solver,
Open in the solverexpectation(x^2, distributed(x, normal_distribution(0, 1)))gives1.expectation(exp(t x), distributed(x, normal_distribution(mu, sigma)))In the solver,
Open in the solverexpectation(exp(t x), distributed(x, normal_distribution(mu, sigma)))givese^(sigma^2*t^2/2 + mu*t).
Functions its examples use
- distributed
A variable and the distribution it follows, as probability and expectation read it.
- normal_distribution
The normal distribution with mean mu and standard deviation sigma.
- exp
Exponential function; exp(x) is the power e^x.
Related functions
- exponential_distribution
The waiting time for events that come at rate lambda.
- fit
The least-squares fit of a combination of functions through points.
- cvar
The conditional value at risk of a loss: its expected value over the worst share 1 - level.
- geometric_brownian_motion_process
A process that grows at rate mu with relative noise sigma, started at x0.
- covariance
The sample covariance of two lists of the same length.
- geometric_sde_path
The path of dX = mu X dt + sigma X dW, as a function of the Wiener process's value w at time t.