python - Finding best curve fit with AIC -
i have quite sophisticated problem(for me). have write code calculate interpolation given data set.after calculate akaike information criterium check interpolation suite best.
looks that:
polyfit=np.polyfit(x,y,5) # x,y data set , 5 root of polynomial poly1d=np.poly1d(polyfit) print poly1d #show final polynomial my=[] in x: x_=poly1d(i) my.append(x_) #calculate list of values def aic(i,j): in y: j in my: rss=(i-j)**2 aic=36-np.log(rss) print aic
and don't code becouse if want change root of polynomial have change code. know have use loop in begining like:
for in xrange(40): polyfit=np.polyfit(x,y,i)
but can't figure out how save of polynomials list.if knew use calculate def aic() root,and find best curve fit data. please guys,its bothering me 2 weeks already.if there not clear you,please ask.
Comments
Post a Comment