class_docstr: The main modeling part of a dynamic linear model. It allows the users to
  custemize their own model. User can add, delete any components like trend
  or seasonality to the builder, or view the existing components. Builder
  will finally assemble all components to a big model for further training
  and inference.
  
  Attributes:
      model: the model structure from @baseModel, stores all the necessary
      quantities initialized: indicates whether the model has been built
      staticComponents: stores all the static components (trend and
                        seasonality)
      dynamicComponents: stores all the dynamic components
      componentIndex: the location of each component in the latent states
      statePrior: the prior mean of the latent state
      sysVarPrior: the prior of the covariance of the latent states
      noiseVar: the prior of the observation noise
      initialDegreeFreedom: the initial degree of freedom.
      discount: the discounting factor, please refer to @kalmanFilter for
                more details
      renewTerm: used for aiding the stability of the model. The renewTerm
                 is computed according to the discount fact. When the filter
                 goes over certain steps, the information contribution of the
                 previous data has decayed to minimum. We then ignore those
                 days and refit the time series starting from current -
                 renewTerm. Thus, the effective sample size of the dlm is
                 twice renewTerm. When discount = 1, there will be no
                 renewTerm, since all the information will be passed along.
      renewDiscount: the minimum discount of seasonality component,
                     or if there is no seasonality, this will be the minimum
                     discount of all components. Used for computing
                     renewTerm.
  
  Methods:
      add: add new component
      ls:  list out all components
      delete: delete a specific component by its name
      initialize: assemble all the component to construt a big model
      updateEvaluation: update the valuation matrix of the big model
class_docstr_tok: ["The","main","modeling","part","of","a","dynamic","linear","model",".","It","allows","the","users","to","custemize","their","own","model",".","User","can","add",",","delete","any","components","like","trend","or","seasonality","to","the","builder",",","or","view","the","existing","components",".","Builder","will","finally","assemble","all","components","to","a","big","model","for","further","training","and","inference",".","Attributes",":","model",":","the","model","structure","from","@","baseModel",",","stores","all","the","necessary","quantities","initialized",":","indicates","whether","the","model","has","been","built","staticComponents",":","stores","all","the","static","components","(","trend","and","seasonality",")","dynamicComponents",":","stores","all","the","dynamic","components","componentIndex",":","the","location","of","each","component","in","the","latent","states","statePrior",":","the","prior","mean","of","the","latent","state","sysVarPrior",":","the","prior","of","the","covariance","of","the","latent","states","noiseVar",":","the","prior","of","the","observation","noise","initialDegreeFreedom",":","the","initial","degree","of","freedom",".","discount",":","the","discounting","factor",",","please","refer","to","@","kalmanFilter","for","more","details","renewTerm",":","used","for","aiding","the","stability","of","the","model",".","The","renewTerm","is","computed","according","to","the","discount","fact",".","When","the","filter","goes","over","certain","steps",",","the","information","contribution","of","the","previous","data","has","decayed","to","minimum",".","We","then","ignore","those","days","and","refit","the","time","series","starting","from","current","-","renewTerm",".","Thus",",","the","effective","sample","size","of","the","dlm","is","twice","renewTerm",".","When","discount","=","1",",","there","will","be","no","renewTerm",",","since","all","the","information","will","be","passed","along",".","renewDiscount",":","the","minimum","discount","of","seasonality","component",",","or","if","there","is","no","seasonality",",","this","will","be","the","minimum","discount","of","all","components",".","Used","for","computing","renewTerm",".","Methods",":","add",":","add","new","component","ls",":","list","out","all","components","delete",":","delete","a","specific","component","by","its","name","initialize",":","assemble","all","the","component","to","construt","a","big","model","updateEvaluation",":","update","the","valuation","matrix","of","the","big","model"]
code: def __init__(self, logger=None):
      # the basic model structure for running kalman filter
      self.model = None
      self.initialized = False
  
      # to store all components. Separate the two as the evaluation
      # for dynamic component needs update each iteration
      # (new) added the third category, which is dynamic but the
      # features can be automatically computed from the data
  
      # store all the static components, i.e., the evaluation vector
      # do not change over time
      self.staticComponents = {}
  
      # store all the dynamic components, i.e., the evaluation vector
      # changes over time
      self.dynamicComponents = {}
  
      # store all the components that are dynamic, but the evaluation
      # vector can be inferred directly from the main data instead
      # of other sources
      self.automaticComponents = {}
  
      # store the index (location in the latent states) of all components
      # can be used to extract information for each componnet
      self.componentIndex = {}
  
      # record the prior guess on the latent state and system covariance
      self.statePrior = None
      self.sysVarPrior = None
      self.noiseVar = None
      self.initialDegreeFreedom = 1
  
      # record the discount factor for the model
      self.discount = None
  
      # renew term used to indicate the effective length of data, i.e.,
      # for days before this length will have little impact on
      # the current result
      self.renewTerm = -1.0
      self.renewDiscount = None  # used for adjusting renewTerm
  
      # Allow customized logger to control the level of information printed
      # during job execution. The default log level is 'INFO'.
      if logger is None:
          self._logger = logging.getLogger()
      else:
          self._logger = logger
  
file_path: pydlm/pydlm/modeler/builder.py
imports: from pydlm.base.baseModel import baseModel
  from pydlm.modeler.matrixTools import matrixTools
  from copy import deepcopy
  import logging
  import numpy
label_desc: Use image node_id 1 to create a new builder object  with example: obj = builder(logger)