code: def calcKYratioDifference(self):
          '''
          Returns the difference between the simulated capital to income ratio and the target ratio.
          Can only be run after solving all AgentTypes and running makeHistory.
  
          Parameters
          ----------
          None
  
          Returns
          -------
          diff : float
              Difference between simulated and target capital to income ratio.
          '''
          # Ignore the first X periods to allow economy to stabilize from initial conditions
          KYratioSim = np.mean(np.array(self.KtoYnow_hist)[self.ignore_periods:])
          diff = KYratioSim - self.KYratioTarget
          return diff calcKYratioDifference(self):
          '''
          Returns the difference between the simulated capital to income ratio and the target ratio.
          Can only be run after solving all AgentTypes and running makeHistory.
  
          Parameters
          ----------
          None
  
          Returns
          -------
          diff : float
              Difference between simulated and target capital to income ratio.
          '''
          # Ignore the first X periods to allow economy to stabilize from initial conditions
          KYratioSim = np.mean(np.array(self.KtoYnow_hist)[self.ignore_periods:])
          diff = KYratioSim - self.KYratioTarget
          return diff
docs: Returns the difference between the simulated capital to income ratio and the target ratio.
          Can only be run after solving all AgentTypes and running makeHistory.
  
          Parameters
          ----------
          None
  
          Returns
          -------
          diff : float
              Difference between simulated and target capital to income ratio.