def polynomial(order):
 powers = np.asarray(order)
 if (powers.shape == ()):
  powers = np.arange(1, (powers + 1))
 powers.shape = (len(powers), 1)
 len_beta = (len(powers) + 1)
 def _poly_est(data, len_beta=len_beta):
  return np.ones((len_beta,), float)
 return Model(_poly_fcn, fjacd=_poly_fjacd, fjacb=_poly_fjacb, estimate=_poly_est, extra_args=(powers,), meta={'name': 'Sorta-general Polynomial', 'equ': ('y = B_0 + Sum[i=1..%s, B_i * (x**i)]' % (len_beta - 1)), 'TeXequ': ('$y=\\beta_0 + \\sum_{i=1}^{%s} \\beta_i x^i$' % (len_beta - 1))})

def polynomial ( order ) : powers = np . asarray ( order ) if ( powers . shape == ( ) ) : powers = np . arange ( 1 , ( powers + 1 ) ) powers . shape = ( len ( powers ) , 1 ) len_beta = ( len ( powers ) + 1 ) def _poly_est ( data , len_beta = len_beta ) : return np . ones ( ( len_beta , ) , float ) return Model ( _poly_fcn , fjacd = _poly_fjacd , fjacb = _poly_fjacb , estimate = _poly_est , extra_args = ( powers , ) , meta = { 'name' : 'Sorta-general Polynomial' , 'equ' : ( 'y = B_0 + Sum[i=1..%s, B_i * (x**i)]' % ( len_beta - 1 ) ) , 'TeXequ' : ( '$y=\\beta_0 + \\sum_{i=1}^{%s} \\beta_i x^i$' % ( len_beta - 1 ) ) } )
very simple embedding of a polynomial chart .