# st: Re: CES with nl

 From "Rodrigo A. Alfaro" To Subject st: Re: CES with nl Date Fri, 8 Jun 2007 10:02:31 -0400

Rodolfo,

The formula in your program is different than the one that you wrote in the description of the problem for us. Also, I didn't see how \$e is identified. Alwasy, it is a good idea to change the initial values for some numbers that are feasible. The program below runs, for positive values of y, k, n and l.

Good luck, Rodrigo.

/// Modified CES
capture program drop nlces1
program define nlces1
if "`1'" == "?" {
global S_1 "a b c d"
global a=0.8
global b=0.5
global c=1
global d=1
global S_2 "CES with multiplicative error"
exit
}

replace `1' = (\$a*(\$b*k^(-\$c)+(1-\$b)*l^(-\$c))^(\$d/\$c)+(1-\$a)*n^(\$d))^ (-1/\$d)
end
clear
set obs 100
drawnorm y n l k
replace y = y^2
replace n = n^2
replace l = l^2
replace k = k^2
nl ces1 y
/// End

----- Original Message ----- From: "Rodolfo Coelho Prates" <rcprates@esalq.usp.br>
To: <statalist@hsphsun2.harvard.edu>
Sent: Friday, June 08, 2007 9:09 AM
Subject: st: CES with nl

Dear listers,

I´ve tried estimate a nested CES production function with three factors:
capital (k), labor (l) and land (n).

The nested CES production function is:

y=e{a[bk^(-c)+(1-b)l^(-c)]^(d/c)+(1-a)n^d}^(-1/d)

I used nl command and wrote the follow instructions:

program define nlces1

if "`1'" == "?" {
global S_1 "e a b c d"
global a=1
global b=1
global c=1
global d=1
global e=.5
global S_2 "CES with multiplicative error"
exit
}

replace `1' =
\$e*((\$a*(\$b*k^(-\$c))+(1-\$b)*l^(-\$c))^(\$d/\$c)+(1-\$a)*n^(-\$d))^(-1/\$d)

end

nl ces1 y

The Stata calculates the interections and print this message:
"cannot calculate derivatives"

What can I do?

Thanks a lot,

Rodolfo

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
```*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```