class_docstr: The seasonality component that features the periodicity behavior,
  providing one building block for the dynamic linear model.
  It decribes a latent seasonality trending in the time series data. The user
  can use this class to construct any periodicy component to the model, for
  instance, the hourly, weekly or monthly behavior. Different from the Fourier
  series, the seasonality components are nonparametric, i.e., there is no sin
  or cos relationship between each state. They can be arbitrarily valued.
  
  Args:
      period: the period of the
      discount: the discount factor
      name: the name of the trend component
      w: the value to set the prior covariance. Default to a diagonal
         matrix with 100 on the diagonal.
  
  Examples:
      >>>  # create a 7-day seasonality:
      >>> ctrend = seasonality(period = 7, name = 'weekly', discount = 0.99)
      >>>  # change the ctrend to have covariance with diagonals are 2 and state 1
      >>> ctrend.createCovPrior(cov = 2)
      >>> ctrend.createMeanPrior(mean = 1)
      >>> ctrend.freeForm()
  
  Attributes:
      d: the period of the seasonality
      componentType: the type of the component, in this case, 'seasonality'
      name: the name of the seasonality component, to be supplied by user
            used in modeling and result extraction
      discount: the discount factor for this component. Details please refer
                to the @kalmanFilter
      evaluation: the evaluation matrix for this component
      transition: the transition matrix for this component
      covPrior: the prior guess of the covariance matrix of the latent states
      meanPrior: the prior guess of the latent states
class_docstr_tok: ["The","seasonality","component","that","features","the","periodicity","behavior",",","providing","one","building","block","for","the","dynamic","linear","model",".","It","decribes","a","latent","seasonality","trending","in","the","time","series","data",".","The","user","can","use","this","class","to","construct","any","periodicy","component","to","the","model",",","for","instance",",","the","hourly",",","weekly","or","monthly","behavior",".","Different","from","the","Fourier","series",",","the","seasonality","components","are","nonparametric",",","i.e.",",","there","is","no","sin","or","cos","relationship","between","each","state",".","They","can","be","arbitrarily","valued",".","Args",":","period",":","the","period","of","the","discount",":","the","discount","factor","name",":","the","name","of","the","trend","component","w",":","the","value","to","set","the","prior","covariance",".","Default","to","a","diagonal","matrix","with","100","on","the","diagonal",".","Examples",":",">",">",">","#","create","a","7-day","seasonality",":",">",">",">","ctrend","=","seasonality","(","period","=","7",",","name","=","'weekly","'",",","discount","=","0.99",")",">",">",">","#","change","the","ctrend","to","have","covariance","with","diagonals","are","2","and","state","1",">",">",">","ctrend.createCovPrior","(","cov","=","2",")",">",">",">","ctrend.createMeanPrior","(","mean","=","1",")",">",">",">","ctrend.freeForm","(",")","Attributes",":","d",":","the","period","of","the","seasonality","componentType",":","the","type","of","the","component",",","in","this","case",",","'seasonality'","name",":","the","name","of","the","seasonality","component",",","to","be","supplied","by","user","used","in","modeling","and","result","extraction","discount",":","the","discount","factor","for","this","component",".","Details","please","refer","to","the","@","kalmanFilter","evaluation",":","the","evaluation","matrix","for","this","component","transition",":","the","transition","matrix","for","this","component","covPrior",":","the","prior","guess","of","the","covariance","matrix","of","the","latent","states","meanPrior",":","the","prior","guess","of","the","latent","states"]
docstr: The technique used in Hurrison and West (1999). After calling this method,
  The latent states sum up to 0 and the covariance matrix is degenerate to have
  rank d - 1, so that the sum of the latent states will never change when the
  system evolves
docstr_tok: ["The","technique","used","in","Hurrison","and","West","(","1999",")",".","After","calling","this","method",",","The","latent","states","sum","up","to","0","and","the","covariance","matrix","is","degenerate","to","have","rank","d","-","1",",","so","that","the","sum","of","the","latent","states","will","never","change","when","the","system","evolves"]
code: def freeForm(self):
      """The technique used in Hurrison and West (1999). After calling this method,
      The latent states sum up to 0 and the covariance matrix is degenerate to have
      rank d - 1, so that the sum of the latent states will never change when the
      system evolves
  
      """
      if self.covPrior is None or self.meanPrior is None:
          raise NameError(
              "freeForm can only be called after prior created."
          )
      else:
          u = np.sum(np.sum(self.covPrior, 0), 1)[0, 0]
          A = np.sum(self.covPrior, 1) / u
          self.meanPrior = (
              self.meanPrior - A * np.sum(self.meanPrior, 0)[0, 0]
          )
          self.covPrior = self.covPrior - np.dot(A, A.T) * u
  
file_path: pydlm/pydlm/modeler/seasonality.py
imports: import numpy
  from .component import component
  import pydlm.base.tools
label_desc: Use image node_id 6 for calling the seasonality obj's underlying member method code with example usage: obj.freeForm() without return types