Displaying 2 results from an estimated 2 matches for "nll2".
Did you mean:
nll
2013 Apr 06
1
Plotting a curve for a Holling Type III Functional Response
Hey,
So I have a scatter plot and I am trying to plot a curve to fit the data
based on a Holling Type III functional response. My function is this:
nll2<-function(a,b) {
conefun<-(a*DBH^2)/(b^2+DBH^2)
nlls2<-dnbinom(x=cones ,size=DBH, mu=conefun,log=TRUE)
-sum(nlls)
}
and my plot is this:
plot (DBH,cones)
DBH is on the x-axis and cones is on the y-axis. How do I get the curve for
my function onto the scatterplot?
--
View this...
2012 Oct 11
2
model selection with spg and AIC (or, convert list to fitted model object)
...mu1 + mu2 + p1 + p2 + sqrt((mu1 + mu2 + p1 + p2)^2 -
4*(mu2*p1 + mu1*(mu2 + p2))))*t)/(2*(mu2*p1 + mu1*(mu2 + p2))*
sqrt((mu1 + mu2 + p1 + p2)^2 - 4*(mu2*p1 + mu1*(mu2 + p2))))
P3 <- 1 - P1 - P2
p.all <- c(P1, P2, P3)
-sum(dmnom2(c(n1, n2, n3), prob = p.all, log = TRUE))
}
NLL2 <- function(par, y) {
p1 <- par[1]
p2 <- p1
mu1 <- par[2]
mu2 <- mu1
n1 <- y$n1
n2 <- y$n2
n3 <- y$n3
t <- y$t
P1 <- (p1*((-1 + exp(sqrt((mu1 + mu2 + p1 + p2)^2 -
4*(mu2*p1 + mu1*(mu2 + p2)))*t))*((-mu2)*(mu2 - p1 + p2) +
mu1*(mu2 +...