00001 #include "statsLib.h" 00002 00038 dvariable dstudent_t( const dvar_vector& residual, const dvar_vector& df) 00039 { 00040 RETURN_ARRAYS_INCREMENT(); 00041 double pi = 3.141593; 00042 dvar_vector t1 = 0.5*(df+1); 00043 dvar_vector t2 = gammln(t1); 00044 dvar_vector t3 = 0.5*log(df*pi)+gammln(0.5*df); 00045 dvar_vector t4 = elem_prod(t1,log(1+elem_div(square(residual),df))); 00046 dvariable pdf = sum(t3+t4-t2); 00047 RETURN_ARRAYS_DECREMENT(); 00048 return( pdf ); 00049 }
Generated on Tue Mar 8 2016 19:51:35 for ADMB Documentation by 1.8.0 |