class_docstr: Base KTR model object with shared functionality for PyroVI method
  Parameters
  ----------
  level_knot_scale : float
      sigma for level; default to be .1
  level_segments : int
      the number of segments partitioned by the knots of level (trend)
  level_knot_distance : int
      the distance between every two knots of level (trend)
  level_knot_dates : array like
      list of pre-specified dates for the level knots
  seasonality : int, or list of int
      multiple seasonality
  seasonality_fs_order : int, or list of int
      fourier series order for seasonality
  seasonality_segments : int
      the number of segments partitioned by the knots of seasonality
  seasonal_initial_knot_scale : float
      scale parameter for seasonal regressors initial coefficient knots; default to be 1
  seasonal_knot_scale : float
      scale parameter for seasonal regressors drift of coefficient knots; default to be 0.1.
  regressor_col : array-like strings
      regressor columns
  regressor_sign : list
      list of signs with '=' for regular regressor, '+' for positive regressor, and '-' for negative regressor.
  regressor_init_knot_loc : list
      list of regressor knot pooling mean priors, default to be 0's
  regressor_init_knot_scale : list
      list of regressor knot pooling sigma's to control the pooling strength towards the grand mean of regressors;
      default to be 1.
  regressor_knot_scale : list
      list of regressor knot sigma priors; default to be 0.1.
  regression_segments : int
      the number of segments partitioned by the knots of regression
  regression_knot_distance : int
      the distance between every two knots of regression
  regression_knot_dates : array-like
      list of pre-specified dates for regression knots
  regression_rho : float
      sigma in the Gaussian kernel for the regression term
  degree of freedom : int
      degree of freedom for error t-distribution
  date_freq : str
      date frequency; if not supplied, pd.infer_freq will be used to imply the date frequency.
  coef_prior_list : list of dicts
      each dict in the list should have keys as
      'name', prior_start_tp_idx' (inclusive), KTRTimePointPriorKeys.PRIOR_END_TP_IDX.value (not inclusive),
      KTRTimePointPriorKeys.PRIOR_MEAN.value, KTRTimePointPriorKeys.PRIOR_SD.value, and KTRTimePointPriorKeys.PRIOR_REGRESSOR_COL.value
  residuals_scale_upper : float
  flat_multiplier : bool
      Default set as True. If False, we will adjust knot scale with a multiplier based on regressor volume
      around each knot; When True, set all multiplier as 1
  ktrlite_optim_args : dict
      the optimizing config for the ktrlite model (to fit level/seasonality). Default to be dict().
class_docstr_tok: ["Base","KTR","model","object","with","shared","functionality","for","PyroVI","method","Parameters","--","--","--","--","--","level_knot_scale",":","float","sigma","for","level",";","default","to","be",".1","level_segments",":","int","the","number","of","segments","partitioned","by","the","knots","of","level","(","trend",")","level_knot_distance",":","int","the","distance","between","every","two","knots","of","level","(","trend",")","level_knot_dates",":","array","like","list","of","pre-specified","dates","for","the","level","knots","seasonality",":","int",",","or","list","of","int","multiple","seasonality","seasonality_fs_order",":","int",",","or","list","of","int","fourier","series","order","for","seasonality","seasonality_segments",":","int","the","number","of","segments","partitioned","by","the","knots","of","seasonality","seasonal_initial_knot_scale",":","float","scale","parameter","for","seasonal","regressors","initial","coefficient","knots",";","default","to","be","1","seasonal_knot_scale",":","float","scale","parameter","for","seasonal","regressors","drift","of","coefficient","knots",";","default","to","be","0.1.","regressor_col",":","array-like","strings","regressor","columns","regressor_sign",":","list","list","of","signs","with","'=","'","for","regular","regressor",",","'+","'","for","positive","regressor",",","and","'-","'","for","negative","regressor",".","regressor_init_knot_loc",":","list","list","of","regressor","knot","pooling","mean","priors",",","default","to","be","0's","regressor_init_knot_scale",":","list","list","of","regressor","knot","pooling","sigma","'s","to","control","the","pooling","strength","towards","the","grand","mean","of","regressors",";","default","to","be","1.","regressor_knot_scale",":","list","list","of","regressor","knot","sigma","priors",";","default","to","be","0.1.","regression_segments",":","int","the","number","of","segments","partitioned","by","the","knots","of","regression","regression_knot_distance",":","int","the","distance","between","every","two","knots","of","regression","regression_knot_dates",":","array-like","list","of","pre-specified","dates","for","regression","knots","regression_rho",":","float","sigma","in","the","Gaussian","kernel","for","the","regression","term","degree","of","freedom",":","int","degree","of","freedom","for","error","t-distribution","date_freq",":","str","date","frequency",";","if","not","supplied",",","pd.infer_freq","will","be","used","to","imply","the","date","frequency",".","coef_prior_list",":","list","of","dicts","each","dict","in","the","list","should","have","keys","as","'name","'",",","prior_start_tp_idx","'","(","inclusive",")",",","KTRTimePointPriorKeys.PRIOR_END_TP_IDX.value","(","not","inclusive",")",",","KTRTimePointPriorKeys.PRIOR_MEAN.value",",","KTRTimePointPriorKeys.PRIOR_SD.value",",","and","KTRTimePointPriorKeys.PRIOR_REGRESSOR_COL.value","residuals_scale_upper",":","float","flat_multiplier",":","bool","Default","set","as","True",".","If","False",",","we","will","adjust","knot","scale","with","a","multiplier","based","on","regressor","volume","around","each","knot",";","When","True",",","set","all","multiplier","as","1","ktrlite_optim_args",":","dict","the","optimizing","config","for","the","ktrlite","model","(","to","fit","level\/seasonality",")",".","Default","to","be","dict","(",")","."]
docstr: Plot regression coefficients.
  
  Parameters
  ----------
  coefficient_method : str
      either "smooth" or "empirical". when "empirical" is used, curves are sampled/aggregated directly
      from beta posteriors; when "smooth" is used, first extract sampled/aggregated posteriors of knots
      then beta.
  date_array : array-like
      the list of dates for which the regressio coefficients will be reported.
      Default to be None. When it's None, all the dates in the training data will be used.
  include_ci : bool
      if including the confidence intervals for the regression coefficients
  lower : float between (0, 1). default to be 0.05
      lower bound for the CI
  upper : float between (0, 1). default to be 0.95.
      upper bound for the CI
  with_knot : bool
      if plotting the regression knots in the graph
  ncol : int
      number of columns of the panel grid
          is_visible : boolean
      whether we want to show the plot. If called from unittest, is_visible might = False.
  is_visible : bool
      whether we want to show the plot. If called from unittest, is_visible might = False.
  markersize : int; optional
      knot marker size
  figsize : tuple; optional
      figsize passed to `matplotlib.pyplot.figure()`
code: def plot_regression_coefs(
      self,
      training_meta,
      point_method,
      point_posteriors,
      posterior_samples,
      coefficient_method="smooth",
      date_array=None,
      include_ci=False,
      lower=0.05,
      upper=0.95,
      with_knot=False,
      is_visible=True,
      ncol=2,
      ylim=None,
      markersize=200,
      figsize=(16, 8),
  ):
      """Plot regression coefficients.
  
      Parameters
      ----------
      coefficient_method : str
          either "smooth" or "empirical". when "empirical" is used, curves are sampled/aggregated directly
          from beta posteriors; when "smooth" is used, first extract sampled/aggregated posteriors of knots
          then beta.
      date_array : array-like
          the list of dates for which the regressio coefficients will be reported.
          Default to be None. When it's None, all the dates in the training data will be used.
      include_ci : bool
          if including the confidence intervals for the regression coefficients
      lower : float between (0, 1). default to be 0.05
          lower bound for the CI
      upper : float between (0, 1). default to be 0.95.
          upper bound for the CI
      with_knot : bool
          if plotting the regression knots in the graph
      ncol : int
          number of columns of the panel grid
              is_visible : boolean
          whether we want to show the plot. If called from unittest, is_visible might = False.
      is_visible : bool
          whether we want to show the plot. If called from unittest, is_visible might = False.
      markersize : int; optional
          knot marker size
      figsize : tuple; optional
          figsize passed to `matplotlib.pyplot.figure()`
  
      """
      # assume your first column is the date; this way can use a static method
      if include_ci:
          (
              coef_df,
              coef_df_lower,
              coef_df_upper,
          ) = self.get_regression_coefs(
              training_meta,
              point_method,
              point_posteriors,
              posterior_samples,
              coefficient_method=coefficient_method,
              date_array=date_array,
              include_ci=include_ci,
              lower=lower,
              upper=upper,
          )
      else:
          coef_df = self.get_regression_coefs(
              training_meta,
              point_method,
              point_posteriors,
              posterior_samples,
              coefficient_method=coefficient_method,
              date_array=date_array,
              include_ci=include_ci,
              lower=lower,
              upper=upper,
          )
          coef_df_lower, coef_df_upper = None, None
      if with_knot:
          knot_df = self.get_regression_coef_knots(
              training_meta,
              point_method,
              point_posteriors,
              posterior_samples,
          )
      else:
          knot_df = None
  
      regressor_col = coef_df.columns.tolist()[1:]
      nrow = math.ceil(len(regressor_col) / ncol)
      fig, axes = plt.subplots(
          nrow, ncol, figsize=figsize, squeeze=False
      )
  
      for idx, col in enumerate(regressor_col):
          row_idx = idx // ncol
          col_idx = idx % ncol
          coef = coef_df[col]
          axes[row_idx, col_idx].plot(
              coef,
              alpha=0.8,
              label="coefficients",
              color=OrbitPalette.BLUE.value,
          )
          if coef_df_lower is not None and coef_df_upper is not None:
              coef_lower = coef_df_lower[col]
              coef_upper = coef_df_upper[col]
              axes[row_idx, col_idx].fill_between(
                  np.arange(0, coef_df.shape[0]),
                  coef_lower,
                  coef_upper,
                  alpha=0.3,
                  color=OrbitPalette.BLUE.value,
              )
          if knot_df is not None:
              step = knot_df["step"]
              knots = knot_df[col].values
              axes[row_idx, col_idx].scatter(
                  x=step,
                  y=knots,
                  marker="^",
                  s=markersize,
                  color=OrbitPalette.GREEN.value,
                  alpha=0.5,
              )
          if ylim is not None:
              axes[row_idx, col_idx].set_ylim(ylim)
          axes[row_idx, col_idx].set_title("{}".format(col))
          axes[row_idx, col_idx].ticklabel_format(useOffset=False)
  
      plt.tight_layout()
  
      if is_visible:
          plt.show()
      else:
          plt.close()
  
      return axes
  
imports: from orbit.models.ktrlite import KTRLite
  import pandas
  import numpy
  import math
  from scipy.stats import nct
  from enum import Enum
  import torch
  import matplotlib.pyplot
  from copy import deepcopy
  from ..constants.constants import KTRTimePointPriorKeys, PredictMethod, TrainingMetaKeys, PredictionMetaKeys
  from ..exceptions import IllegalArgument, ModelException, PredictionException
  from ..utils.general import is_ordered_datetime
  from ..utils.kernels import gauss_kernel, sandwich_kernel
  from ..utils.features import make_seasonal_regressors
  from .model_template import ModelTemplate
  from ..estimators.pyro_estimator import PyroEstimatorSVI
  from ..models import KTRLite
  from orbit.constants.palette import OrbitPalette
  from ..utils.knots import get_knot_idx, get_knot_dates
  from ..utils.plot import orbit_style_decorator
label_desc: Use image node_id 23 for calling the KTRModel obj's underlying member method code with example usage: obj.plot_regression_coefs(training_meta, point_method, point_posteriors, posterior_samples, coefficient_method, date_array, include_ci, lower, upper, with_knot, is_visible, ncol, ylim, markersize, figsize) and returns: axes