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"]
code: def __init__(
      self, multivariate_smoother, alpha, weights=None, start_idx=0
  ):
      if len(multivariate_smoother.smoothers) != len(alpha):
          msg = (
              "all the input values should be of the same length."
              " len(smoothers)=%d, len(alphas)=%d"
          ) % (len(multivariate_smoother.smoothers), len(alpha))
          raise ValueError(msg)
  
      self.multivariate_smoother = multivariate_smoother
      self.dim_basis = self.multivariate_smoother.dim_basis
      self.k_variables = self.multivariate_smoother.k_variables
      self.nobs = self.multivariate_smoother.nobs
      self.alpha = alpha
      self.start_idx = start_idx
      self.k_params = start_idx + self.dim_basis
  
      # TODO: Review this,
      if weights is None:
          # weights should have total length as params
          # but it can also be scalar in individual component
          self.weights = [1.0 for _ in range(self.k_variables)]
      else:
          import warnings
  
          warnings.warn("weights is currently ignored")
          self.weights = weights
  
      self.mask = [
          np.zeros(self.k_params, dtype=bool)
          for _ in range(self.k_variables)
      ]
      param_count = start_idx
      for i, smoother in enumerate(
          self.multivariate_smoother.smoothers
      ):
          # the mask[i] contains a vector of length k_columns. The index
          # corresponding to the i-th input variable are set to True.
          self.mask[i][
              param_count : param_count + smoother.dim_basis
          ] = True
          param_count += smoother.dim_basis
  
      self.gp = []
      for i in range(self.k_variables):
          gp = UnivariateGamPenalty(
              self.multivariate_smoother.smoothers[i],
              weights=self.weights[i],
              alpha=self.alpha[i],
          )
          self.gp.append(gp)
  
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 1 to create a new MultivariateGamPenalty object from inherited base classes: Penalty with example: obj = MultivariateGamPenalty(multivariate_smoother, alpha, weights, start_idx)