The likelihood that I get using R glm or Countr, (renewalCount) is different from when I calculate the likelihood by hand, using R estimated parameters. I am trying to fit a dataset with some functions in R, but the likelihood values are not consistent with what I get from other languages. Another weird thing is that I get the same result with glm(...,family=poisson) for different datasets!
D = matrix(c(1:9))
Numb = matrix(c(10, 4, 5, 3, 1, 2, 1, 1, 1))
Number = data.frame(Numb)
agg_poiss <- glm(formula = D ~ 1, family = poisson, data = Number)
agg_wei <- renewalCount(formula = D ~ 1, data = Number, dist = "weibull",
computeHessian = FALSE, control = renewal.control(trace = 0))
For Poisson case, I get: (Intercept) 1.6094, which means a Poisson parameter of exp(1.6094) but t gives me the likelihood -21.53659 in R, which becomes different when I calculate by hand.