Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

pdf function

The density of a distribution at a point, or the probability of a value for a discrete one.

How to write it

pdf(distribution, x)

The density, or the probability of a whole number for a discrete distribution.

distribution
A distribution such as normal_distribution(0, 1). Takes an expression.
x
The point, or the value. Takes an expression.

pdf(process, y)

The density 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.
y
The value of the process. Takes an expression.

Examples

  • fX(x), X∼N(0,1)=22πex22\displaystyle f_{X}(x),\ X \sim \mathcal{N}(0, 1) = \frac{\sqrt{2}}{2 \sqrt{\pi} e^{\frac{x^{2}}{2}}}
    pdf(normal_distribution(0, 1), x)

    In the solver, pdf(normal_distribution(0, 1), x) gives (1/2)sqrt(2)*e^(-x^2/2)/sqrt(pi).

    Open in the solver
  • fX(2), X∼B(5,13)=80243\displaystyle f_{X}(2),\ X \sim \mathrm{B}\left(5, \frac{1}{3}\right) = \frac{80}{243}
    pdf(binomial_distribution(5, 1/3), 2)

    In the solver, pdf(binomial_distribution(5, 1/3), 2) gives 80/243.

    Open in the solver
  • pdf⁡(construct⁡(OU⁡(μ,σ,θ,x0),t),y)={22e(y−(x0−μetθ+μ))22(σ22θ−σ22θe2tθ)π(σ22θ−σ22θe2tθ)if θ≠0\displaystyle \operatorname{pdf}(\operatorname{construct}(\operatorname{OU}(\mu, \sigma, \theta, x_{0}), t), y) = \begin{cases} \frac{\sqrt{2}}{2 e^{\frac{\left(y-\left(\frac{x_{0}-\mu}{e^{t \theta}}+\mu\right)\right)^{2}}{2 \left(\frac{\sigma^{2}}{2 \theta}-\frac{\sigma^{2}}{2 \theta e^{2 t \theta}}\right)}} \sqrt{\pi \left(\frac{\sigma^{2}}{2 \theta}-\frac{\sigma^{2}}{2 \theta e^{2 t \theta}}\right)}} & \text{if } \theta \neq 0 \end{cases}
    pdf(construct(ornstein_uhlenbeck_process(mu, sigma, theta, x0), t), y)

    In the solver, pdf(construct(ornstein_uhlenbeck_process(mu, sigma, theta, x0), t), y) gives (1/2)sqrt(2)*e^((-1/2)*(y - (e^(-t*theta)*(x0 - mu) + mu))^2/((1/2)sigma^2/theta - (1/2)sigma^2*e^(-2t*theta)/theta))/sqrt(pi*((1/2)sigma^2/theta - (1/2)sigma^2*e^(-2t*theta)/theta)) if theta != 0.

    Open in the solver

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).

  • ornstein_uhlenbeck_process

    A process pulled toward mu at rate theta, with noise sigma, started at x0.

  • poisson_distribution

    The number of events in a period when they come at an average rate lambda.

  • probability

    The probability that a condition holds for a variable with a distribution.

  • quantile

    The smallest value with at least a share q of a list, or a chance q of a distribution, at or below it.

  • mode

    The most frequent value of a list, or a list of them when several are equally frequent.

  • standard_deviation

    The sample standard deviation of a list of numbers, or that of a distribution.

  • median

    The middle value of a list of numbers, or the mean of the two middle ones.