Kde1d.from_grid

Kde1d.from_grid(grid_points: numpy.ndarray[dtype=float64, shape=(*), order='C'], values: numpy.ndarray[dtype=float64, shape=(*), order='C'], xmin: float | None = None, xmax: float | None = None, type: str = 'continuous', prob0: float = 0.0) pyvinecopulib.Kde1d

Create a Kde1d object from grid points and density values.

This factory method creates a Kde1d object from pre-computed grid points and corresponding density values. This is useful for loading previously fitted models or creating models from externally computed densities.

Parameters:
  • grid_points (array_like) – Vector of grid points where the density was evaluated.

  • values (array_like) – Vector of density values corresponding to the grid points. Must have the same length as grid_points.

  • xmin (float, optional) – Lower bound for the support of the density. Default is NaN.

  • xmax (float, optional) – Upper bound for the support of the density. Default is NaN.

  • type (str, optional) – Variable type. Default is "continuous".

  • prob0 (float, optional) – Point mass at 0 (for zero-inflated models). Default is 0.0.

Returns:

Kde1d – A fitted Kde1d object ready for evaluation.