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 initializeFromBuilder(self, data, exported_builder):
      # Copy the components
      self.staticComponents = deepcopy(
          exported_builder.staticComponents
      )
      self.automaticComponents = deepcopy(
          exported_builder.automaticComponents
      )
      self.dynamicComponents = deepcopy(
          exported_builder.dynamicComponents
      )
      self.componentIndex = deepcopy(exported_builder.componentIndex)
      self.discount = deepcopy(exported_builder.discount)
      self.initialDegreeFreedom = exported_builder.model.df
  
      # Copy the model states
      self.statePrior = deepcopy(exported_builder.statePrior)
      self.sysVarPrior = deepcopy(exported_builder.sysVarPrior)
      self.noiseVar = deepcopy(exported_builder.noiseVar)
      self.model = deepcopy(exported_builder.model)
  
      # update the evaluation to the current.
      self.updateEvaluation(step=0, data=data)
      self.model.initializeObservation()
  
      # compute the renew period
      if self.renewDiscount is None:
          self.renewDiscount = np.min(self.discount)
  
      if self.renewDiscount < 1.0 - 1e-8:
          self.renewTerm = np.log(
              0.001 * (1 - self.renewDiscount)
          ) / np.log(self.renewDiscount)
  
      self.initialized = True
      self._logger.info("Initialization finished.")
  
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 7 for calling the builder obj's underlying member method code with example usage: obj.initializeFromBuilder(data, exported_builder) without return types