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","(",")"]
code: def predict_new(self, X, z):
      first_layer_output = np.zeros(self.units)
  
      for unit in range(self.units):
          first_layer_output[unit] = self.activation(
              np.matmul(
                  np.transpose(X),
                  z[
                      unit
                      * (self.ar + len(self.X_names) + 1) : (
                          (unit + 1) * (self.ar + len(self.X_names) + 1)
                      )
                  ],
              )
          )
  
      params_used = (self.units) * (self.ar + len(self.X_names) + 1)
  
      # Hidden layers
      hidden_layer_output = np.zeros((self.units, self.layers - 1))
      for layer in range(1, self.layers):
          for unit in range(self.units):
              if layer == 1:
                  hidden_layer_output[
                      unit, layer - 1
                  ] = self.activation(
                      np.matmul(
                          first_layer_output,
                          z[
                              params_used
                              + unit * (self.units)
                              + ((layer - 1) * self.units**2) : (
                                  (
                                      params_used
                                      + (unit + 1) * self.units
                                  )
                                  + ((layer - 1) * self.units**2)
                              )
                          ],
                      )
                  )
              else:
                  hidden_layer_output[
                      unit, layer - 1
                  ] = self.activation(
                      np.matmul(
                          hidden_layer_output[:, layer - 1],
                          z[
                              params_used
                              + unit * (self.units)
                              + ((layer - 1) * self.units**2) : (
                                  (
                                      params_used
                                      + (unit + 1) * self.units
                                  )
                                  + ((layer - 1) * self.units**2)
                              )
                          ],
                      )
                  )
  
      params_used = params_used + (self.layers - 1) * self.units**2
  
      # Output layer
      if self.layers == 1:
          mu = np.matmul(
              first_layer_output,
              z[params_used : params_used + self.units],
          )
      else:
          mu = np.matmul(
              hidden_layer_output[:, -1],
              z[params_used : params_used + self.units],
          )
  
      return mu
  
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 8 for calling the NNARX obj's underlying member method code with example usage: obj.predict_new(X, z) and returns: mu