class_docstr: Inherits time series methods from TSM class.
  
  **** GENERALIZED AUTOREGRESSIVE SCORE (GAS) RANK MODELS ****
  
  Parameters
  ----------
  data : pd.DataFrame
      Field to specify the univariate time series data that will be used.
  
  team_1 : str (pd.DataFrame)        
      Specifies which column contains the home team
  
  team_2 : str (pd.DataFrame)        
      Specifies which column contains the away team
  
  family : GAS family object
      Which distribution to use, e.g. GASNormal()
  
  score_diff : str (pd.DataFrame)        
      Specifies which column contains the score
  
  gradient_only : Boolean (default: True)
      If true, will only use gradient rather than second-order terms
      to construct the modified score.
class_docstr_tok: ["Inherits","time","series","methods","from","TSM","class",".","*","*","*","*","GENERALIZED","AUTOREGRESSIVE","SCORE","(","GAS",")","RANK","MODELS","*","*","*","*","Parameters","--","--","--","--","--","data",":","pd.DataFrame","Field","to","specify","the","univariate","time","series","data","that","will","be","used",".","team_1",":","str","(","pd.DataFrame",")","Specifies","which","column","contains","the","home","team","team_2",":","str","(","pd.DataFrame",")","Specifies","which","column","contains","the","away","team","family",":","GAS","family","object","Which","distribution","to","use",",","e.g",".","GASNormal","(",")","score_diff",":","str","(","pd.DataFrame",")","Specifies","which","column","contains","the","score","gradient_only",":","Boolean","(","default",":","True",")","If","true",",","will","only","use","gradient","rather","than","second-order","terms","to","construct","the","modified","score","."]
docstr: Creates the structure of the model - store abilities
  
  Parameters
  ----------
  beta : np.array
      Contains untransformed starting values for latent variables
  
  Returns
  ----------
  theta : np.array
      Contains the predicted values for the time series
  
  Y : np.array
      Contains the length-adjusted time series (accounting for lags)
  
  scores : np.array
      Contains the scores for the time series
docstr_tok: ["Creates","the","structure","of","the","model","-","store","abilities","Parameters","--","--","--","--","--","beta",":","np.array","Contains","untransformed","starting","values","for","latent","variables","Returns","--","--","--","--","--","theta",":","np.array","Contains","the","predicted","values","for","the","time","series","Y",":","np.array","Contains","the","length-adjusted","time","series","(","accounting","for","lags",")","scores",":","np.array","Contains","the","scores","for","the","time","series"]
code: def _model_abilities_two_components(self, beta):
      """Creates the structure of the model - store abilities
  
      Parameters
      ----------
      beta : np.array
          Contains untransformed starting values for latent variables
  
      Returns
      ----------
      theta : np.array
          Contains the predicted values for the time series
  
      Y : np.array
          Contains the length-adjusted time series (accounting for lags)
  
      scores : np.array
          Contains the scores for the time series
      """
  
      parm = np.array(
          [
              self.latent_variables.z_list[k].prior.transform(beta[k])
              for k in range(beta.shape[0])
          ]
      )
      scale, shape, skewness = self._get_scale_and_shape(parm)
      state_vectors = np.zeros(shape=(self.max_team + 1))
      state_vectors_2 = np.zeros(shape=(self.max_team_2 + 1))
      state_vectors_store_1 = np.zeros(
          shape=(
              int(np.max(self.home_count) + 50),
              int(self.max_team + 1),
          )
      )
      state_vectors_store_2 = np.zeros(
          shape=(
              int(np.max(self.home_2_count) + 50),
              int(self.max_team_2 + 1),
          )
      )
      theta = np.zeros(shape=(self.data.shape[0]))
  
      for t in range(0, self.data.shape[0]):
          theta[t] = (
              parm[0]
              + state_vectors_2[self.home_2_id[t]]
              - state_vectors_2[self.away_2_id[t]]
              + state_vectors[self.home_id[t]]
              - state_vectors[self.away_id[t]]
          )
  
          state_vectors[self.home_id[t]] += parm[
              1
          ] * self.family.score_function(
              self.data[t], self.link(theta[t]), scale, shape, skewness
          )
          state_vectors[self.away_id[t]] += -parm[
              1
          ] * self.family.score_function(
              self.data[t], self.link(theta[t]), scale, shape, skewness
          )
          state_vectors_2[self.home_2_id[t]] += parm[
              2
          ] * self.family.score_function(
              self.data[t], self.link(theta[t]), scale, shape, skewness
          )
          state_vectors_2[self.away_2_id[t]] += -parm[
              2
          ] * self.family.score_function(
              self.data[t], self.link(theta[t]), scale, shape, skewness
          )
  
          state_vectors_store_1[
              int(self.home_count[t]), self.home_id[t]
          ] = state_vectors_store_1[
              max(0, int(self.home_count[t]) - 1), self.home_id[t]
          ] + parm[
              1
          ] * self.family.score_function(
              self.data[t], self.link(theta[t]), scale, shape, skewness
          )
          state_vectors_store_1[
              int(self.away_count[t]), self.away_id[t]
          ] = state_vectors_store_1[
              max(0, int(self.away_count[t]) - 1), self.away_id[t]
          ] - parm[
              1
          ] * self.family.score_function(
              self.data[t], self.link(theta[t]), scale, shape, skewness
          )
          state_vectors_store_2[
              int(self.home_2_count[t]), self.home_2_id[t]
          ] = state_vectors_store_2[
              max(0, int(self.home_2_count[t]) - 1), self.home_2_id[t]
          ] + parm[
              1
          ] * self.family.score_function(
              self.data[t], self.link(theta[t]), scale, shape, skewness
          )
          state_vectors_store_2[
              int(self.away_2_count[t]), self.away_2_id[t]
          ] = state_vectors_store_2[
              max(0, int(self.away_2_count[t]) - 1), self.away_2_id[t]
          ] - parm[
              1
          ] * self.family.score_function(
              self.data[t], self.link(theta[t]), scale, shape, skewness
          )
  
      return state_vectors_store_1, state_vectors_store_2
  
imports: import sys
  import numpy
  import pandas
  import scipy.stats
  import scipy.special
  from ..None import families
  from ..None import tsm
  from ..None import data_check
  from .scores import *
  from .gas_core_recursions import gas_recursion
label_desc: Use image node_id 11 for calling the GASRank obj's underlying member method code with example usage: obj._model_abilities_two_components(beta) and returns: state_vectors_store_1,  state_vectors_store_2