Displaying 2 results from an estimated 2 matches for "fitshap".
Did you mean:
fitshape
2009 Jul 16
2
Weibull Prediction?
...=shape)
model<-survreg(Surv(y)~1,dist="weibull")
### Exp of coef and predict are the same
exp(model$coef)
predict(model,type=c("response"))[1]
### Here is the mean and median of the data
mean(y)
median(y)
### Fitted Mean and Median from survreg
fitScale<-exp(model$coef)
fitShape<-1/model$scale
fitScale*gamma(1 + 1/fitShape)
fitScale*(log(2))^(1/fitShape)
Is this done on purpose? If so does anyone know why?
Thanks in advance,
Sean Brummel
[[alternative HTML version deleted]]
2005 Nov 09
2
help with legacy R code
...ewx)
wrongmeanshift <- wrongmean + 0.2
wrongper <- pgamma(wrongmeanshift, wrongshape, wrongrate)
nfalseundermean <-
which(abs(newx-wrongmeanshift)==min(abs(newx-wrongmeanshift)))
initnfalse <- nfalseundermean / wrongper
fitmean <- -1
fitsd <- 0
fitnfalse <- initnfalse
fitshape <- wrongshape
fitrate <- wrongrate
curve((fitnfalse*dgamma(x,fitshape,fitrate))/totalx, add=T, col="red",
lwd=2)
breaksllength <- length(goodhist$breaks)
endi = breaksllength - 1
binprob = c(1)
for (i in 1:endi) {
expnegative <- fitnfalse * (pgamma(goodhist$breaks[i+...