The OpenD Programming Language

studentsTPDF

Ditto, with location and scale parameters (by standardizing x).

  1. T studentsTPDF(T x, T nu)
  2. T studentsTPDF(T x, T nu, T mean, T stdDev)
    @safe pure nothrow @nogc
    T
    studentsTPDF
    (
    T
    )
    (
    const T x
    ,
    const T nu
    ,
    const T mean
    ,
    const T stdDev
    )
    if (
    isFloatingPoint!T
    )

Parameters

x T

value to evaluate PDF

nu T

degrees of freedom

mean T

location parameter

stdDev T

scale parameter

Examples

import mir.test: shouldApprox;

studentsTPDF(-3.0, 5).shouldApprox == 0.01729258;
studentsTPDF(-2.0, 5).shouldApprox == 0.06509031;
studentsTPDF(-1.0, 5).shouldApprox == 0.2196798;
studentsTPDF(0.0, 5).shouldApprox == 0.3796067;
studentsTPDF(1.0, 5).shouldApprox == 0.2196798;
studentsTPDF(2.0, 5).shouldApprox == 0.06509031;
studentsTPDF(3.0, 5).shouldApprox == 0.01729258;

// Can include location/scale
studentsTPDF(-3.0, 5, 1, 2).shouldApprox == 0.06509031;
studentsTPDF(-2.0, 5, 1, 2).shouldApprox == 0.1245173;
studentsTPDF(-1.0, 5, 1, 2).shouldApprox == 0.2196798;
studentsTPDF(0.0, 5, 1, 2).shouldApprox == 0.3279185;
studentsTPDF(1.0, 5, 1, 2).shouldApprox == 0.3796067;
studentsTPDF(2.0, 5, 1, 2).shouldApprox == 0.3279185;
studentsTPDF(3.0, 5, 1, 2).shouldApprox == 0.2196798;

Meta