Moments of truncated Student's $t$-distribution I performed random sampling on a Student's $t$-distribution. I used SciPy to calibrate my parameters and then truncated my allowable values to the maximum and minimum observation in the data for various reasons. One of which is that it allows me to have a defined variance as long as $\mathrm{df} > 1$. Assume my truncation is symmetrical. What is the formula for the variance of my truncated Student's $t$-distribution?
 A: I was able to find an actual formulaic solution to my question in the paper here:
https://www.research.manchester.ac.uk/portal/files/84031132/FULL_TEXT.PDF
$$E[X] = G_\nu(1)(A_\nu^{-\frac{\nu-1}{2}}-B_\nu^{-\frac{\nu-1}{2}})$$
$$E[X^2] = \frac{\nu}{\nu-2}+G_\nu(1)(aA_\nu^{-\frac{\nu-1}{2}}-bB_\nu^{-\frac{\nu-1}{2}})$$
Where: 
$a$ is the lower bound
$b$ is the upper bound
$A_\nu = \nu + a^2$
$B_\nu = \nu + b^2$
$$G_\nu(1) = \frac{\Gamma({\frac{\nu-1}{2}})\nu^{\frac{\nu}{2}}}{2[F_\nu(b)-F_\nu(a)]\Gamma(\frac{\nu}{2})\Gamma(\frac{1}{2})}$$
A: The result can be found in the 2012 paper Some results on the truncated multivariate $t$ distribution by Ho et al.
First, let $T(\cdot\,|\,\nu)$ be the cdf of the (untruncated) standard $t$ distribution with $\nu$ degrees of freedom. In the following exposition, $a$ and $b$ are the lower and upper truncation limits, respectively. Before we can give the moments, define the following 
$$
\alpha_{0} = T(b\,|\,\nu) - T(a\,|\,\nu) \\
\kappa = \dfrac{\Gamma\left(\frac{\nu + 1}{2}\right)}{\alpha_{0}\Gamma\left(\frac{\nu}{2}\right)(\nu\pi)^{1/2}} \\
\tau_{j} = (\nu - 2j)/\nu
$$
where $\Gamma$ denotes the gamma function.
The first two moments of the univariate truncated $t$ distribution are then given by
$$
\mathrm{E}(X) =\frac{\kappa\nu}{\nu - 1}\left[(1 + a^{2}/\nu)^{-(\nu - 1)/2} - (1 + b^{2}/\nu)^{-(\nu - 1)/2}\right] \enspace \text{for}\enspace\nu >1
$$
and
$$
\mathrm{E}(X^{2}) =\left(\frac{\nu-1}{\tau_{1}}\right)\left(\frac{T(b\tau_{1}^{1/2}\,|\,\nu - 2) - T(a\tau_{1}^{1/2}\,|\,\nu - 2)}{T(b\,|\,\nu) - T(a\,|\,\nu)}\right) - \nu \enspace \text{for}\enspace\nu >2
$$
The variance is then given by $\mathrm{Var}(X) = \mathrm{E}(X^{2}) - \mathrm{E}(X)^{2}$.
Here is R code implementing these formulas. The plot shows the variance of a truncated $t$ distribution with $\nu = 5$ degrees of freedom with respect to the truncation points where $a = -b$  and $b>0$ (i.e. for symmetric trunction points around the mean of $0$) ranging from $1$ to $15$. As expected, the variance of the truncated $t$ distribution approaches the variance of the untruncated $t$ distribution ($5/3$, shown as a red dashed horizontal line) as $b$ gets larger.

kappa <- function(df, a, b) {
  gamma((df + 1)/2)/((pt(b, df = df) - pt(a, df = df))*gamma(df/2)*(df*pi)^(1/2))
}

tau <- function(df, j) {
  (df - 2*j)/df
}

ex <- function(df, a, b) {
  ((kappa(df = df, a = a, b = b)*df)/(df - 1))*((1 + a^2/df)^(-(df - 1)/2) - (1 + b^2/df)^(-(df - 1)/2))
}

ex2 <- function(df, a, b) {
  ((df - 1)/tau(df = df, j = 1))*((pt(b*sqrt(tau(df = df, j = 1)), df = (df - 2)) - pt(a*sqrt(tau(df = df, j = 1)), df = (df - 2)))/(pt(b, df = df) - pt(a, df = df))) - df
}

