class_docstr: Penalty for smooth term in Generalized Additive Models
  
  Parameters
  ----------
  univariate_smoother : instance
      instance of univariate smoother or spline class
  alpha : float
      default penalty weight, alpha can be provided to each method
  weights:
      TODO: not used and verified, might be removed
  
  Attributes
  ----------
  Parameters are stored, additionally
  nob s: The number of samples used during the estimation
  n_columns : number of columns in smoother basis
class_docstr_tok: ["Penalty","for","smooth","term","in","Generalized","Additive","Models","Parameters","--","--","--","--","--","univariate_smoother",":","instance","instance","of","univariate","smoother","or","spline","class","alpha",":","float","default","penalty","weight",",","alpha","can","be","provided","to","each","method","weights",":","TODO",":","not","used","and","verified",",","might","be","removed","Attributes","--","--","--","--","--","Parameters","are","stored",",","additionally","nob","s",":","The","number","of","samples","used","during","the","estimation","n_columns",":","number","of","columns","in","smoother","basis"]
docstr: penalty matrix for the smooth term of a GAM
  
  Parameters
  ----------
  alpha : list of floats or None
      penalty weights
  
  Returns
  -------
  penalty matrix
      square penalty matrix for quadratic penalization. The number
      of rows and columns are equal to the number of columns in the
      smooth terms, i.e. the number of parameters for this smooth
      term in the regression model
docstr_tok: ["penalty","matrix","for","the","smooth","term","of","a","GAM","Parameters","--","--","--","--","--","alpha",":","list","of","floats","or","None","penalty","weights","Returns","--","--","--","-","penalty","matrix","square","penalty","matrix","for","quadratic","penalization",".","The","number","of","rows","and","columns","are","equal","to","the","number","of","columns","in","the","smooth","terms",",","i.e",".","the","number","of","parameters","for","this","smooth","term","in","the","regression","model"]
code: def penalty_matrix(self, alpha=None):
      """penalty matrix for the smooth term of a GAM
  
      Parameters
      ----------
      alpha : list of floats or None
          penalty weights
  
      Returns
      -------
      penalty matrix
          square penalty matrix for quadratic penalization. The number
          of rows and columns are equal to the number of columns in the
          smooth terms, i.e. the number of parameters for this smooth
          term in the regression model
      """
      if alpha is None:
          alpha = self.alpha
  
      return alpha * self.univariate_smoother.cov_der2
  
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 5 for calling the UnivariateGamPenalty obj's underlying member method code with example usage: obj.penalty_matrix(alpha) and returns: unknown