Estimation and model specification testing in nonparametric and semiparametric econometric models