---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-202-ddfdd173b25b> in <module>()
1 fitter = lmfit.Minimizer(swaption_atm_otm_ois_resid_lmm_dd_rho, params,iter_cb=per_iteration,fcn_args=(mats_swaptions,mats_swaps,P,tau,fwds_ois,beta_ois,us_atm_swaption_blk_ois_prices,n,N,T,mats_swaption_otm_ois,k_otm,us_otm_swaption_blk_ois_prices))
----> 2 fitter.minimize(method="least_squares")
/usr/local/lib/python2.7/site-packages/lmfit/minimizer.pyc in minimize(self, method, params, **kws)
1647 val.lower().startswith(user_method)):
1648 kwargs['method'] = val
-> 1649 return function(**kwargs)
1650
1651
/usr/local/lib/python2.7/site-packages/lmfit/minimizer.pyc in least_squares(self, params, **kws)
1216 bounds=(lower_bounds, upper_bounds),
1217 kwargs=dict(apply_bounds_transformation=False),
-> 1218 **kws)
1219
1220 for attr in ret:
/usr/local/lib/python2.7/site-packages/scipy/optimize/_lsq/least_squares.pyc in least_squares(fun, x0, jac, bounds, method, ftol, xtol, gtol, x_scale, loss, f_scale, diff_step, tr_solver, tr_options, jac_sparsity, max_nfev, verbose, args, kwargs)
906 result = trf(fun_wrapped, jac_wrapped, x0, f0, J0, lb, ub, ftol, xtol,
907 gtol, max_nfev, x_scale, loss_function, tr_solver,
--> 908 tr_options.copy(), verbose)
909
910 elif method == 'dogbox':
/usr/local/lib/python2.7/site-packages/scipy/optimize/_lsq/trf.pyc in trf(fun, jac, x0, f0, J0, lb, ub, ftol, xtol, gtol, max_nfev, x_scale, loss_function, tr_solver, tr_options, verbose)
126 return trf_bounds(
127 fun, jac, x0, f0, J0, lb, ub, ftol, xtol, gtol, max_nfev, x_scale,
--> 128 loss_function, tr_solver, tr_options, verbose)
129
130
/usr/local/lib/python2.7/site-packages/scipy/optimize/_lsq/trf.pyc in trf_bounds(fun, jac, x0, f0, J0, lb, ub, ftol, xtol, gtol, max_nfev, x_scale, loss_function, tr_solver, tr_options, verbose)
380 cost = cost_new
381
--> 382 J = jac(x, f)
383 njev += 1
384
/usr/local/lib/python2.7/site-packages/scipy/optimize/_lsq/least_squares.pyc in jac_wrapped(x, f)
864 J = approx_derivative(fun, x, rel_step=diff_step, method=jac,
865 f0=f, bounds=bounds, args=args,
--> 866 kwargs=kwargs, sparsity=jac_sparsity)
867 if J.ndim != 2: # J is guaranteed not sparse.
868 J = np.atleast_2d(J)
/usr/local/lib/python2.7/site-packages/scipy/optimize/_numdiff.pyc in approx_derivative(fun, x0, method, rel_step, f0, bounds, sparsity, args, kwargs)
357
358 if sparsity is None:
--> 359 return _dense_difference(fun_wrapped, x0, f0, h, use_one_sided, method)
360 else:
361 if not issparse(sparsity) and len(sparsity) == 2:
/usr/local/lib/python2.7/site-packages/scipy/optimize/_numdiff.pyc in _dense_difference(fun, x0, f0, h, use_one_sided, method)
385 x = x0 + h_vecs[i]
386 dx = x[i] - x0[i] # Recompute dx as exactly representable number.
--> 387 df = fun(x) - f0
388 elif method == '3-point' and use_one_sided[i]:
389 x1 = x0 + h_vecs[i]
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'