#include quantile_function/student_t_qf.stanfunctions
int N = num_elements(u);
vector[N] t1_sq = square(t1);
vector[N] t2_sq = square(t2);
real lpdf = N
* (-0.5 * log1m(rho ^ 2) + lgamma(0.5 * (nu + 2)) + lgamma(0.5 * nu)
- 2 * lgamma(0.5 * (nu + 1)));
lpdf += 0.5 * (nu + 1) * sum(log1p(t1_sq / nu) + log1p(t2_sq / nu));
lpdf += -0.5 * (nu + 2)
* sum(log1p((t1_sq - 2 * t1 .* t2 * rho + t2_sq) / (nu * (1 - rho ^ 2))));
return lpdf;
}
real bivariate_t_copula_lpdf(vector u, vector v, real rho, real nu)
Definition: student_t_copula.stanfunctions:19
real student_t_qf(real p, real ndf)
Definition: student_t_qf.stanfunctions:21
◆ bivariate_t_copula_lpdf()
real bivariate_t_copula_lpdf |
( |
vector |
u, |
|
|
vector |
v, |
|
|
real |
rho, |
|
|
real |
nu |
|
) |
| |
Bivariate Student T Copula Log Density
- Parameters
-
u | Real number on (0,1], not checked but function will return NaN |
v | Real number on (0,1], not checked but function will return NaN |
rho | Real number [-1, 1] |
nu | Real \((0, +\infty)\) |