root / branches / pthreads737 / docs / manuals / autodif / fcomp_r.cpp @ 765
History  View  Annotate  Download (361 Bytes)
1 
\begin{lstlisting}


2 
// file: fcomp_r.cpp

3  
4 
#include <fvar.hpp> 
5  
6 
double fcomp(dvector& Y,dvector& Z,dvar_vector& x)

7 
{ 
8 
dvariable b; 
9 
b=x[1]; //Put the x vector into the model parameter 
10 
dvar_vector PRED_Y=b*Z+b*b; //calculate the predicted response

11 
double alpha=0.7; 
12 
dvariable tmp =robust_regression(Y,PRED_Y,alpha); 
13 
return(value(tmp));

14 
} 
15 
\end{lstlisting}
