This function computes the cumulative distribution function (p-values) for a given random variable x and corresponding degrees of freedom df using the t-distribution. The function can compute the lower or upper tail probabilities depending on the value of the lower parameter.

ptvdf(x, df, lower)

Arguments

x

arma::mat (vector) - A matrix or vector of random variable values for which the p-values will be calculated.

df

arma::mat (vector) - A matrix or vector of degrees of freedom for the t-distribution, matching the size of x.

lower

bool - If TRUE, calculates the lower-tail probability (P(T <= x)); if FALSE, calculates the upper-tail probability.

Value

arma::mat (vector) - A matrix containing the computed cumulative distribution function (p-values) for each element in x. The result is returned as a 1xN matrix, where N is the number of elements in x.