Message: 84
Date: Tue, 3 Nov 2009 19:49:17 +0000
From: Andre Barbosa Oliveira <andreabosn at hotmail.com>
Subject: [R] Maximum Likelihood Estimation
To: <r-help at r-project.org>
Message-ID: <BLU109-W2D5A97DBFD61D3976E589C2B20 at phx.gbl>
Content-Type: text/plain
Hi,
I would like estimate a model for function of production's Coob-Douglas using maximum likelihood. The model is log(Y)= beta[1]+beta[2]*log(L)+beta[3]*log(K). I tried estimate this model using the tools nlm ( ) and optim ( ) using the log-likelihood function below:
mloglik <- function (beta, Y, L, K) {
+ n <- length(Y)
+ sum ( (log(Y)- beta[1]-beta[2]*log(L)-beta[3]*log(K))2)/2*beta[4]2 + n/2*log(2*pi)+ n*log(beta[4])
+ }
Then I did estimates the parameters using nlm ( ) and optim ( ), but the estimates were very bad. I used these codes:
mlem <- nlm (mloglik, c(1,1,1,1), Y=Y, L=L, K=K)
mlem2 <- optim(c(1,1,1,1), mloglik, Y=Y, L=L, K=K, method="BFGS")
How I improve the estimates???? What's the best and more simple form for estimate a modelo using the maximum likelihood's method???
Best regards,
Andre' Barbosa Oliveira
Student of Master in Economics at University Federal of Rio Grande do Sul - Brazil