class_docstr: Penalty for Generalized Additive Models
  
  Parameters
  ----------
  multivariate_smoother : instance
      instance of additive smoother or spline class
  alpha : list of float
      default penalty weight, list with length equal to the number of smooth
      terms. ``alpha`` can also be provided to each method.
  weights : array_like
      currently not used
      is a list of doubles of the same length as alpha or a list
      of ndarrays where each component has the length equal to the number
      of columns in that component
  start_idx : int
      number of parameters that come before the smooth terms. If the model
      has a linear component, then the parameters for the smooth components
      start at ``start_index``.
  
  Attributes
  ----------
  Parameters are stored, additionally
  nob s: The number of samples used during the estimation
  
  dim_basis : number of columns of additive smoother. Number of columns
      in all smoothers.
  k_variables : number of smooth terms
  k_params : total number of parameters in the regression model
class_docstr_tok: ["Penalty","for","Generalized","Additive","Models","Parameters","--","--","--","--","--","multivariate_smoother",":","instance","instance","of","additive","smoother","or","spline","class","alpha",":","list","of","float","default","penalty","weight",",","list","with","length","equal","to","the","number","of","smooth","terms",".","``","alpha","``","can","also","be","provided","to","each","method",".","weights",":","array_like","currently","not","used","is","a","list","of","doubles","of","the","same","length","as","alpha","or","a","list","of","ndarrays","where","each","component","has","the","length","equal","to","the","number","of","columns","in","that","component","start_idx",":","int","number","of","parameters","that","come","before","the","smooth","terms",".","If","the","model","has","a","linear","component",",","then","the","parameters","for","the","smooth","components","start","at","``","start_index","``",".","Attributes","--","--","--","--","--","Parameters","are","stored",",","additionally","nob","s",":","The","number","of","samples","used","during","the","estimation","dim_basis",":","number","of","columns","of","additive","smoother",".","Number","of","columns","in","all","smoothers",".","k_variables",":","number","of","smooth","terms","k_params",":","total","number","of","parameters","in","the","regression","model"]
docstr: evaluate second derivative of penalty with respect to params
  
  Parameters
  ----------
  params : ndarray
      coefficients in the regression model
  alpha : list of floats or None
      penalty weights
  
  Returns
  -------
  deriv2 : ndarray, 2-Dim
      second derivative, hessian of the penalty with respect to params
docstr_tok: ["evaluate","second","derivative","of","penalty","with","respect","to","params","Parameters","--","--","--","--","--","params",":","ndarray","coefficients","in","the","regression","model","alpha",":","list","of","floats","or","None","penalty","weights","Returns","--","--","--","-","deriv2",":","ndarray",",","2-Dim","second","derivative",",","hessian","of","the","penalty","with","respect","to","params"]
code: def deriv2(self, params, alpha=None):
      """evaluate second derivative of penalty with respect to params
  
      Parameters
      ----------
      params : ndarray
          coefficients in the regression model
      alpha : list of floats or None
          penalty weights
  
      Returns
      -------
      deriv2 : ndarray, 2-Dim
          second derivative, hessian of the penalty with respect to params
      """
      if alpha is None:
          alpha = [None] * self.k_variables
  
      deriv2 = [np.zeros((self.start_idx, self.start_idx))]
      for i in range(self.k_variables):
          params_i = params[self.mask[i]]
          deriv2.append(self.gp[i].deriv2(params_i, alpha=alpha[i]))
  
      return block_diag(*deriv2)
  
file_path: statsmodels/statsmodels/gam/gam_penalties.py
imports: import numpy
  from scipy.linalg import block_diag
  from statsmodels.base._penalties import Penalty
label_desc: Use image node_id 4 for calling the MultivariateGamPenalty obj's underlying member method code with example usage: obj.deriv2(params, alpha) and returns: block_diag