search for: wrongrat

Displaying 1 result from an estimated 1 matches for "wrongrat".

Did you mean: wrongrate
2005 Nov 09
2
help with legacy R code
...n(x, mean, sd, nfalse, ntotal, shape, rate) { (nfalse*dgamma(x,shape,rate)+(ntotal-nfalse)*dnorm(x,mean,sd))/ntotal } wrong <- scan("wrongrawdata.txt", list(x=0)) wrongfit <- fitdistr(wrong$x, "gamma") wrongmean <- mean(wrong$x) wrongshape <- wrongfit[[1]][1] wrongrate <- wrongfit[[1]][2] good <- scan("rawdata.txt", list(x=0)) xmin = 0 newx = good$x xmean = mean(newx) xmax = max(newx)+0.15 goodhist <- hist(newx, br=seq(from=0,to=xmax,by=0.15), probability=T, col="lightyellow") initmean <- (min(newx)+max(newx))/2 totalx...