function mdlpoly,ydat,xdat,yfit=yfit,kord=kord,pfit=pfit,kmin=kmin,kmax=kmax,$ verbose=verbose, _extra=e ;+ ;function mdlpoly ; compute and return the minimum description length statistic obtained ; by fitting polynomials of different orders ; ;syntax ; mdl=mdlpoly(ydat,xdat,yfit=yfit,kord=kord,pfit=pfit,$ ; kmin=kmin,kmax=kmax,verbose=verbose) ; ;parameters ; ydat [INPUT; required] data to be fit ; xdat [INPUT] abscissae for YDAT ; * if not given, assumeed to be lindgen(n_elements(YDAT)) ; ;keywords ; yfit [OUTPUT] best-fit function corresponding to KORD and PFIT ; kord [OUTPUT] polynomial order at which minimum MDL is achieved ; pfit [OUTPUT] parameters for the best-fit function ; kmin [INPUT] minimum polynomial order to consider ; * default is 0, corresponding to a constant ; kmax [INPUT] maximum polynomial order to consider ; * default is the smaller of 10 or half the number of data points ; verbose [INPUT] controls chatter ; _extra [JUNK] here only to prevent crashing the program ; ;history ; vinay kashyap (2014sep) ;- return,minmdl end