class_docstr: Inherits time series methods from TSM parent class.
  
  **** NEURAL NETWORK AUTOREGRESSIVE (NNAR) MODELS ****
  
  Parameters
  ----------
  data : pd.DataFrame or np.ndarray
      Field to specify the univariate time series data that will be used.
  
  ar : int
      Field to specify how many AR lags the model will have.
  
  units : int
      How many units for the neural network
  
  layers : int
      How many layers for the neural networ
  
  activation : function
      E.g. np.tanh, np.array (linear)
  
  family: family object
      E.g. pf.Normal()
class_docstr_tok: ["Inherits","time","series","methods","from","TSM","parent","class",".","*","*","*","*","NEURAL","NETWORK","AUTOREGRESSIVE","(","NNAR",")","MODELS","*","*","*","*","Parameters","--","--","--","--","--","data",":","pd.DataFrame","or","np.ndarray","Field","to","specify","the","univariate","time","series","data","that","will","be","used",".","ar",":","int","Field","to","specify","how","many","AR","lags","the","model","will","have",".","units",":","int","How","many","units","for","the","neural","network","layers",":","int","How","many","layers","for","the","neural","networ","activation",":","function","E.g",".","np.tanh",",","np.array","(","linear",")","family",":","family","object","E.g",".","pf.Normal","(",")"]
docstr: Creates the structure of the model (model matrices etc)
  
  Parameters
  ----------
  beta : np.ndarray
      Contains untransformed starting values for the latent variables
  
  Returns
  ----------
  mu : np.ndarray
      Contains the predicted values (location) for the time series
  
  Y : np.ndarray
      Contains the length-adjusted time series (accounting for lags)
docstr_tok: ["Creates","the","structure","of","the","model","(","model","matrices","etc",")","Parameters","--","--","--","--","--","beta",":","np.ndarray","Contains","untransformed","starting","values","for","the","latent","variables","Returns","--","--","--","--","--","mu",":","np.ndarray","Contains","the","predicted","values","(","location",")","for","the","time","series","Y",":","np.ndarray","Contains","the","length-adjusted","time","series","(","accounting","for","lags",")"]
code: def _model(self, beta):
      """Creates the structure of the model (model matrices etc)
  
      Parameters
      ----------
      beta : np.ndarray
          Contains untransformed starting values for the latent variables
  
      Returns
      ----------
      mu : np.ndarray
          Contains the predicted values (location) for the time series
  
      Y : np.ndarray
          Contains the length-adjusted time series (accounting for lags)
      """
  
      Y = np.array(self.data[self.max_lag :])
  
      # Transform latent variables
      z = np.array(
          [
              self.latent_variables.z_list[k].prior.transform(beta[k])
              for k in range(beta.shape[0])
          ]
      )
  
      return (
          neural_network_tanh(
              Y,
              self.X,
              z,
              self.units,
              self.layers,
              self.ar + len(self.X_names),
          ),
          Y,
      )
  
imports: import sys
  import numpy
  import pandas
  import scipy.stats
  from patsy import dmatrices, dmatrix, demo_data
  from ..None import families
  from ..None import output
  from ..None import tests
  from ..None import tsm
  from ..None import data_check
  from .nn_architecture import neural_network_tanh, neural_network_tanh_mb
label_desc: Use image node_id 6 for calling the NNARX obj's underlying member method code with example usage: obj._model(beta) and returns: neural_network_tanh,  Y