Hi,
Thanks; I have changed initialization values of parameters and now its
working fine , also i run your script its also gving perfect results.
Thank you very much
Bye
Haider
On 10 May 2010 18:15, Allin Cottrell <cottrell(a)wfu.edu> wrote:
On Mon, 10 May 2010, Allin Cottrell wrote:
> On Mon, 10 May 2010, RAZIA HAIDER wrote:
>
> > Thanks for quick reply. First i realized my basic mistakes :), now i
have
> > changed script, which is given below...
By the way, if you want to use analytical derivatives, which may
give better convergence, here's a version that does that:
<script>
open data7-9
series y = vsat
scalar a = -0.5 * log(sqrt(2*pi))
# your initialization here...
scalar mu = 400
scalar sigma = 100
mle logl = a - log(sigma) - (y-mu)^2 / (2*sigma^2)
deriv mu = (y-mu) / (2*sigma^2)
deriv sigma = -1/sigma + (y-mu)^2 / (sigma^3)
end mle
# check results
scalar n = $nobs
scalar sigma_hat = sqrt(var(y) * (n-1)/n)
printf "mean = %g, sigma_hat = %g\n", mean(y), sigma_hat
</script>
Allin Cottrell
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users
--
Razia Haider
Ph.D. student
Dipartimento di Ingegneria dell'Informazione
Universita' di Modena e Reggio Emilia
Via Vignolese 905, 41100 Modena, Italy
e-mail: razia.haider(a)unimo.it
tel: +39 059 2056314