code: def funcHrf(varNumVol, varTr):
      
      vecX = np.arange(0, varNumVol, 1)
  
      # Expected time of peak of HRF [s]:
      varHrfPeak = 6.0 / varTr
      # Expected time of undershoot of HRF [s]:
      varHrfUndr = 12.0 / varTr
      # Scaling factor undershoot (relative to peak):
      varSclUndr = 0.35
  
      # Gamma pdf for the peak
      vecHrfPeak = gamma.pdf(vecX, varHrfPeak)
      # Gamma pdf for the undershoot
      vecHrfUndr = gamma.pdf(vecX, varHrfUndr)
      # Combine them
      vecHrf = vecHrfPeak - varSclUndr * vecHrfUndr
  
      # Scale maximum of HRF to 1.0:
      vecHrf = np.divide(vecHrf, np.max(vecHrf))
  
      return vecHrf
docs: Create double gamma function.
  
      Source:
      http://www.jarrodmillman.com/rcsds/lectures/convolution_background.html