Displaying 1 result from an estimated 1 matches for "logl3".
Did you mean:
logl
2018 May 19
0
Lower bound and upper bound in maximum likelihood
...b1 are parameter where n is size.
nu = h = rep(0, n)
h[1] = a0/(1-a1-b1)
nu[1] = rdoublepois(1,h[1],g1)
for (i in 2:n) {
h[i] = a0 + a1 * nu[i-1] + b1 * h[i-1]
nu[i] = rdoublepois(1,h[i],g1)
}
Maximum likelihood by double poisson density function from rmutil:
logl3 <- function(par) {
h.new <- vector()
a0 <- par[1]
a1 <- par[2]
b1 <- par[3]
g1 <- par[4]
for (i in 2:n) {
h.new[i] = a0 + a1 * nu[i-1] + b1 * h.new[i-1]
}
-sum(ddoublepois(nu, m=h.new[2:n], s=g1,log=TRUE))
}
nlminb(s...