title: Set the maximum y-intercept in a Python lmfit model, also looking for suggestions on a model
body: <p>Does someone with good knowledge of lmfit module on Python know how to set a maximum y-intercept for a model?</p>
  <p>Example code is as follows:</p>
  <pre><code>import numpy as np
  import lmfit
  %matplotlib inline
  import matplotlib.pyplot as plt
  
  mod=lmfit.models.ExponentialModel()
  
  y_test = np.array([-7.69551455e-02,  3.63353461e-01,  3.42731053e-01, -9.77812968e-02,
          2.35867720e-01,  6.20534972e-01,  2.06331540e-01, -1.38186198e-01,
          3.34846158e-01, -2.92809068e-01, -3.62064970e-01,  2.53074466e-01,
         -7.87561121e-02,  1.38059356e-01,  4.00838420e-01,  2.36798457e-01,
         -9.90603442e-02,  1.14789094e-01,  3.47899907e-02,  7.96444868e-02,
          1.52272420e-01, -5.06646149e-02, -2.17158668e-01, -1.78081977e-01,
          1.52978823e-01,  4.93080563e-02,  9.14192232e-02,  2.80798386e-01,
          1.97992059e-01,  2.74992097e-01,  3.56685994e-01,  3.99073325e-01,
         -1.85329437e-02,  3.18108691e-01,  3.51592433e-02,  8.70150869e-02,
         -1.76669828e-01,  6.16282130e-02, -2.22547111e-01,  5.20177517e-01,
          5.79724480e-01, -1.35589604e-01,  3.22494054e-01,  1.00892346e-01,
         -6.89283175e-02, -4.77919065e-01, -5.35086276e-01,  4.18435344e-01,
         -1.82999893e-03,  3.69711170e-01,  3.35797538e-01, -5.16774046e-01,
          3.27565019e-01,  2.15956929e-01, -1.70175481e-02,  6.40425408e-02,
          3.10046034e-02,  6.45379187e-02, -3.22961170e-02,  1.47961987e-01,
          1.29479622e-01,  3.95969614e-01,  3.89155513e-02,  7.37607177e-02,
         -3.09197685e-01, -3.83293020e-01,  3.56002599e-01,  1.27102921e-01,
          3.81531351e-01,  2.06212545e-02,  8.73795213e-04,  2.06826832e-01,
         -2.67216014e-01, -2.11230417e-01,  1.77393431e-01,  9.60926924e-03,
          3.34998323e-04, -1.68285180e-01,  5.57216997e-01,  7.46145582e-02,
         -1.38927533e-01,  7.89193247e-02, -5.94967554e-02,  2.56235741e-01,
         -1.64439079e-01, -2.48978337e-01, -1.35694746e-01, -4.72972734e-02,
          7.52473104e-02, -2.70102512e-01,  1.12614174e-01, -1.69905613e-01,
         -3.17635327e-01, -1.02810903e-01, -2.33406109e-01,  8.76112564e-01,
         -4.89685563e-01,  5.10986544e-01, -2.91547508e-01, -4.73352963e-01,
          3.64784221e-01, -2.96004986e-01, -2.87915888e-01,  8.75693801e-01,
         -2.21139735e-01])
  
  x_test = np.array([ 510.75246402,  627.11907811,  504.22582827,  715.54856748,
          283.69652729, 1258.77132707, 1300.74713979, 1374.95528029,
         1593.66401011, 1647.94460422, 1646.05531308, 1794.75480583,
         1675.34110563, 1758.84809183,  239.33843461,  529.26175608,
          496.75465871,  444.62934186,  749.55258614, 1057.38423898,
         1098.45176545, 1257.55386207, 1204.30179936, 1201.29267141,
         1380.2347631 , 1253.07128078, 1344.07872876,  417.29811406,
          277.66113807,  443.95080997,  737.0185917 ,  818.08874948,
          859.9917724 , 1028.33025825, 1022.93127742, 1020.79608625,
         1180.53549443, 1057.21291039, 1144.34651571,  288.77734345,
          221.19351235, 1151.78862044,  813.38190127,  897.51061329,
         1138.30665479, 1286.84858545, 1286.56785756, 1393.12895371,
         1286.92264366, 1358.86475966,  450.29677522,  935.35867941,
          597.44199271,  662.69710449,  879.23650639,  998.23037116,
          997.89801654, 1110.09849363, 1000.89613508, 1075.33000664,
         1161.12911014, 1021.60424479, 1099.62339933, 1327.96318724,
         1425.57452782, 1424.44169468, 1554.0642482 , 1440.20011762,
         1518.75105236, 1168.98895962, 1137.98242343, 1128.70204072,
          803.26006531,  797.23604874, 1027.56110814,  907.23003671,
          998.44013682,  107.41578955,  377.54882478,  743.3414746 ,
          747.0556856 ,  729.50415108,  675.5949012 ,  704.71819016,
          270.48765393,  650.15748196,  654.28875669,  624.05607308,
          575.70778121,  600.18741365,  465.95217884,  471.67075988,
          374.71918593,  363.41001227,  357.97334128,    6.6716956 ,
          224.71830096,  118.3418795 ,  197.87703997,  230.94260014,
          124.98835679,  204.33474045,  130.05524639,   36.22429388,
           95.52770712])
  pars = mod.guess(y_test, x_test)
  out = mod.fit(y_test, pars, x=x_test)
  
  acf_x = np.arange(0,4000)
  acf_out = out.eval(x=acf_x)
      
  fig = plt.figure()
  plt.scatter(x_test, y_test)
  plt.plot(acf_x, acf_out)
  print('y-intercept:', acf_out[0])
  </code></pre>
  <p>Gives <a href="https://i.stack.imgur.com/aZPhN.png" rel="nofollow noreferrer">this scatter plot</a></p>
  <p>and y-intercept of 1.16.</p>
  <p>I need the fitting model to know that the maximum intercept can only be 1 (without necessarily setting the intercept to 1). Do you know how to do this?</p>
  <p>Also, are there any suggestions on what other models I can use instead of an Exponential model? I am open to using a combination too. The general features is that there is a max y-intercept of 1, and the decay is sharper for small x-values, with y expected to show asymptotic behavior (to value close to zero, if not zero).</p>
  <p>Thank you.</p>