class_docstr: differential equation:
  
  :math::
  dx_t = f(t,x)dt + \sigma(t,x)dW_t
  
  integral:
  
  :math::
  x_T = x_0 + \int_{0}^{T}f(t,S)dt + \int_0^T  \sigma(t,S)dW_t
  
  TODO: check definition, affine, what about jump diffusion?
class_docstr_tok: ["differential","equation",":",":","math",":",":","dx_t","=","f","(","t",",","x",")","dt","+","\\sigma","(","t",",","x",")","dW_t","integral",":",":","math",":",":","x_T","=","x_0","+","\\int_","{","0","}","^","{","T","}","f","(","t",",","S",")","dt","+","\\int_0^T","\\sigma","(","t",",","S",")","dW_t","TODO",":","check","definition",",","affine",",","what","about","jump","diffusion","?"]
code: def sim(self, nobs=100, T=1, dt=None, nrepl=1):
      # this does not look correct if drift or sig depend on x
      # see arithmetic BM
      W, t = self.simulateW(nobs=nobs, T=T, dt=dt, nrepl=nrepl)
      dx = self._drift() + self._sig() * W
      x = np.cumsum(dx, 1)
      xmean = x.mean(0)
      return x, xmean, t
  
imports: import numpy
  from scipy import stats, signal
  import matplotlib.pyplot
label_desc: Use image node_id 2 for calling the AffineDiffusion obj's underlying member method code with example usage: obj.sim(nobs, T, dt, nrepl) and returns: x,  xmean,  t