Vinecop.scores_full
- Vinecop.scores_full(self, u: numpy.ndarray, step_wise: bool = True, num_threads: int = 1, keep_all: bool = True) dict
Evaluates the score function together with the per-edge derivative caches.
- Parameters:
- undarray, shape (n, d) or (n, 2 * d), dtype float
Evaluation points in (0, 1); additional columns are required for discrete variables (see
select).- step_wisebool, default True
If True, returns the score of the step-wise MLE (each pair copula’s log-density differentiated with pseudo-observations treated as fixed); if False, the full gradient of the log-likelihood, propagated through the vine by the chain rule.
- num_threadsint, default 1
Number of threads to parallelize the row-wise evaluation over.
- keep_allbool, default True
If True, also return the per-edge derivative caches.
- Returns:
- dict
A dict with key
"scores"(an ndarray of shape(n, npars), identical toscores). Ifkeep_allis True, it also contains"pdf_edges","logpdf_deriv_pars","hfunc1_deriv_pars","hfunc2_deriv_pars","logpdf_deriv_u1","logpdf_deriv_u2","hfunc1_deriv_u1"and"hfunc2_deriv_u2", each a nested list indexed[tree][edge](the_parsentries hold one length-n array per parameter). Withstep_wise=Trueonly"logpdf_deriv_pars"is filled (the step-wise scores themselves; discrete edges hold their finite-difference values); the full gradient additionally fills the caches consumed by the chain rule through the vine, unless the model has discrete variables, in which case it falls back to finite differences of the whole-vine log-density and returns empty caches.
- Raises:
- RuntimeError
If the model contains nonparametric pair copulas.