# William Greene, Econometric Analysis, 5e, Chapter 9 open greene5_1.gdt # Use OLS to initialize the parameters ols realcons 0 realdpi scalar a = $coeff[1] scalar b = $coeff[2] scalar g = 1.0 # Run NLS with analytical derivatives nls realcons = a + b * (realdpi^g) deriv a = 1 deriv b = realdpi^g deriv g = b * realdpi^g * log(realdpi) end nls # Compare result using numerical derivatives nls realcons = a + b * (realdpi^g) params a, b, g end nls