0

Two groups i=1,2 mean estimate for normal distribution.

enter image description here

I would like to find the gradient and the hessian of the log-likelihood using R for the two groups.

The log-likelihood function: loglik=expression(log(( 1/sqrt(2*pi*sigmasq)*exp(y-mu)^2/ 2*sigmasq)))

The derivative dbt=D(loglik,"mu")

The hessian dbtt=D(dbt,"mu")

My code is for a one sample, how would I code for the two groups and find the derivative and hessian as in a joint distribution?

Update: the log-likelihood for the two groups enter image description here

N = n1+n2, is the sum of the sample sizes for the two groups

holala
  • 109
  • 2

0 Answers0