Displaying 1 result from an estimated 1 matches for "dnegbinp".
2003 Feb 01
1
Trouble with optim
...2 on Windows 2000.
Sys.info() tells me:
sysname: Windows
version: (build 2195) Service Pack 2
machine: x86
release: NT 5.0
R.Version() tells me:
platform: i386-pc-mingw32
arch: i386
os: mingw32
system: i386, mingw32
status:
R.version.string: R version 1.6.2, 2003-01-10
My full code is here:
dnegbinp <- function(x,prob,mu,size,log=FALSE) {
ll <- ifelse(x==0,
log(1-prob+prob*dnbinom(0*x,mu=mu,size=size)),
log(prob)+dnbinom(x,mu=mu,size=size,log=TRUE));
if (log) ll else exp(ll);
}
x <- c(1,3,0,19,32,0,0,2,23,23)
loglikfun <- function(p) {
cat("Eval...