The following outlines an implementation of the multivariate Gaussian copula:
real gauss_copula_cholesky_lpdf(matrix u, matrix L) {
array[rows(u)] row_vector[cols(u)] q;
for (n in 1:rows(u)) {
q[n] = std_normal_log_qf(u[n]);
}
return multi_normal_cholesky_lpdf(q | rep_row_vector(0, cols(L)), L)
- std_normal_lpdf(to_vector(to_matrix(q)));
}
Consequently, it is presumed that the multivariate Student-t copula is:
real studentt_copula_cholesky_lpdf(matrix u, real nu, matrix L) {
real sd_nu = 1.0; //inv_sqrt(nu /( nu - 2.0)); // this was an idea to standardise the variance to 1.
array[rows(u)] row_vector[cols(u)] q;
for (n in 1:rows(u))
q[n] = student_t_log_qf(u[n], nu);
return multi_student_t_cholesky_lpdf(q | nu, rep_row_vector(0, cols(L)), diag_pre_multiply(rep_vector(sd_nu, cols(L)), L))
- student_t_lpdf(to_vector(u) | nu, 0, sd_nu);
}
Could an expert kindly confirm this?