The OpenD Programming Language

studentsTLPDF

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

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

Parameters

x T

value to evaluate LPDF

nu T

degrees of freedom

mean T

location parameter

stdDev T

scale parameter

Examples

import mir.test: shouldApprox;
import mir.math.common: log;

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

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

Meta