class_docstr: This class is used for performing non parametric estimation of
  multi-dimensional marked Hawkes processes based on conditional laws.
  
  Marked Hawkes processes are point processes defined by the intensity:
  
  .. math::
      \forall i \in [1 \dots D], \quad
      \lambda_i = \mu_i + \sum_{j=1}^D \int \phi_{ij} * f_{ij}(v_j) dN_j
  
  where
  
  * :math:`D` is the number of nodes
  * :math:`\mu_i` are the baseline intensities
  * :math:`\phi_{ij}` are the kernels
  * :math:`v_j` are the marks (considered iid) of the process :math:`N_j`
  * :math:`f_{ij}` the mark functions supposed to be piece-wise constant
    on intervals :math:`I^j(l)`
  
  The estimation is made from empirical computations of
  
  .. math::
      \lim_{\epsilon \rightarrow 0}
      E [ (N_i[t + lag + \delta + \epsilon] -
           \Lambda[t + lag + \epsilon]) | N_j[t]=1
      \quad \& \quad
      v_j(t) \in I^j(l) ]
  
  For all the possible values of :math:`i`, :math:`i` and :math:`l`.
  The :math:`lag` is sampled on a uniform grid defined by
  :math:`\delta`: :math:`lag = n * \delta`.
  
  Estimation can be performed using several realizations.
  
  Parameters
  ----------
  claw_method : {'lin', 'log'}, default='lin'
      Specifies the way the conditional laws are sampled. It can be either:
  
      * 'lin' : sampling is linear on [0, max_lag] using sampling period
        delta_lag
      * 'log' : sampling is semi-log. It uses linear sampling on [0, min_lag]
        with sampling period delta_lag and log sampling on [min_lag, max_lag]
        using :math:`\exp(\delta)` sampling period.
  
  delta_lag : `float`, default=0.1
      See claw_methods
  
  min_lag : `float`, default=1e-4
      See claw_methods
  
  max_lag : `float`, default=40
      See claw_methods
  
  quad_method : {'gauss', 'lin', 'log'}, default=gauss
      Sampling used for quadrature
  
      * 'gauss' for gaussian quadrature
      * 'lin' for linear quadrature
      * 'log' for log quadrature
  
  min_support : `float`, default=1e-4
      Start value of kernel estimation. It is used for 'log' quadrature
      method only, otherwise it is set to 0.
  
  max_support : `float`, default=40
      End value of kernel estimation
  
  n_quad : `int` : default=50
      The number of quadrature points between [min_support, max_support]
      used for solving the system.
      Be aware that the complexity increase as this number squared.
  
  n_threads : `int`, default=1
      Number of threads used for parallel computation.
  
      * if `int <= 0`: the number of physical cores available on the CPU
      * otherwise the desired number of threads
  
  Other Parameters
  ----------------
  delayed_component : list of `int`, shape=(n_nodes, ), default=None
      list of node indices corresponding to node that should be delayed
      (to avoid simultaneous jumps of different components which can be a
      problem in the estimation)
  
  delay : `float`
      The delayed used for `delayed_component`. Selected components are
      all delayed with the same value
  
  marked_components : `dict`
      A dictionary that indicates which component is considered as marked
      and what are the corresponding intervals ``I_j(l)``
  
  Attributes
  ----------
  n_nodes : `int`
      Number of nodes of the estimated Hawkes process
  
  n_realizations : `int`
      Number of given realizations
  
  baseline : np.ndarray, shape=(n_nodes,)
      Estimation of the baseline
  
  kernels_norms : np.ndarray, shape=(n_nodes, n_nodes)
      L1 norm matrix of the kernel norms
  
  kernels : list of list
      Kernel's estimation on the quadrature points
  
  mean_intensity : list of `float`
      The estimated mean intensity
  
  symmetries1d : list of 2-tuple
      List of component index pairs for imposing symmetries on the mean
      intensity (e.g, ``[(0,1),(2,3)]`` means that the mean intensity of
      the components 0 and 1 must be the same and the mean intensity of the
      components 2 and 3 also
      Can be set using can be set using the `set_model` method.
  
  symmetries2d : list of 2-tuple of 2-tuple
      List of kernel coordinates pairs to impose symmetries on the kernel
      matrix (e.g., ``[[(0,0),(1,1)],[(1,0),(0,1)]]`` for a bidiagonal
      kernel in dimension 2)
      Can be set using can be set using the `set_model` method.
  
  mark_functions : list of 2-tuple
      The mark functions as a list (lexical order on i,j and l, see below)
  
  References
  ----------
  Bacry, E., & Muzy, J. F. (2014).
  Second order statistics characterization of Hawkes processes and
  non-parametric estimation. `arXiv preprint arXiv:1401.0903`_.
  
  .. _arXiv preprint arXiv:1401.0903: https://arxiv.org/pdf/1401.0903.pdf
docstr: Computes kernel estimation by solving a Fredholm system.
          
docstr_tok: ["Computes","kernel","estimation","by","solving","a","Fredholm","system","."]
code: def compute(self):
      """Computes kernel estimation by solving a Fredholm system."""
  
      # We raise an exception if a claw component had no input to be computed
      if any(self._n_events[0, :] == 0):
          k = np.where(self._n_events[0, :] == 0)[0]
          msg = "Cannot run estimation : not enough events for components {}".format(
              k
          )
          raise ValueError(msg)
  
      # Here we compute the quadrature points and the corresponding weights
      # self.quad_x and self.quad_w
      if self.quad_method in {"gauss", "gauss-"}:
          self._quad_x, self._quad_w = leggauss(self.n_quad)
          self._quad_x = self.max_support * (self._quad_x + 1) / 2
          self._quad_w *= self.max_support / 2
  
      elif self.quad_method == "log":
          logstep = (
              np.log(self.max_support) - np.log(self.min_support) + 1.0
          ) / self.n_quad
          x1 = np.arange(
              0.0, self.min_support, self.min_support * logstep
          )
          x2 = np.exp(
              np.arange(
                  np.log(self.min_support),
                  np.log(self.max_support),
                  logstep,
              )
          )
          self._quad_x = np.append(x1, x2)
          self._quad_w = self._quad_x[1:] - self._quad_x[:-1]
          self._quad_w = np.append(self._quad_w, self._quad_w[-1])
          self.n_quad = len(self._quad_x)
          self._quad_x = np.array(self._quad_x)
          self._quad_w = np.array(self._quad_w)
  
      elif self.quad_method == "lin":
          x1 = np.arange(
              0.0, self.max_support, self.max_support / self.n_quad
          )
          self._quad_x = x1
          self._quad_w = self._quad_x[1:] - self._quad_x[:-1]
          self._quad_w = np.append(self._quad_w, self._quad_w[-1])
          self.n_quad = len(self._quad_x)
          self._quad_x = np.array(self._quad_x)
          self._quad_w = np.array(self._quad_w)
  
      # Computes the claw and its integrals at the difference of
      # quadrature points using a linear interpolation
      self._compute_ints_claw()
  
      # For each i we write and solve the system V =  M PHI
      index_first = 0
      self._phi_ijl = []
      self._norm_ijl = []
      self.kernels = []
      self.kernels_norms = np.zeros((self.n_nodes, self.n_nodes))
  
      for i in range(0, self.n_nodes):
          # We must compute the last valid index which corresponds to i
          index_last = index_first
          for index_last in range(index_first, self._n_index):
              (i1, j1, l1) = self._index2ijl[index_last]
              if i1 != i:
                  index_last -= 1
                  break
  
          # Number of indices corresponding to i
          n_index = index_last - index_first + 1
  
          # Compute V and M
          V = self._compute_V(
              i, n_index, self.n_quad, index_first, index_last
          )
          M = self._compute_M(
              n_index,
              self.n_quad,
              index_first,
              index_last,
              self.quad_method,
          )
          # Then we solve it
          res = solve(M, V)
  
          self._estimate_kernels_and_norms(
              i,
              index_first,
              index_last,
              res,
              self.n_quad,
              self.quad_method,
          )
  
          index_first = index_last + 1
  
      self._estimate_baseline()
      self._estimate_mark_functions()
  
imports: import itertools
  import sys
  import warnings
  import numpy
  from numpy.polynomial.legendre import leggauss
  from scipy.linalg import solve
  from tick.base import Base, ThreadPool
  from tick.hawkes.inference.build.hawkes_inference import PointProcessCondLaw
label_desc: Use image node_id 21 for calling the HawkesConditionalLaw obj's underlying member method code with example usage: obj.compute() without return types