SHARE
TWEET

Untitled

a guest Jun 27th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fit = fitdistr(Y, "weibull")
  2. Warning message:
  3. In densfun(x, parm[1], parm[2], ...) : NaNs produced
  4. > warnings(fit)
  5. Warning message:
  6. In densfun(x, parm[1], parm[2], ...) : NaNs produced Error in
  7. at(list(...), file, sep, fill, labels, append) :
  8. argument 2 (type 'list') cannot be handled by 'cat'
  9.      
  10. shape          scale    
  11.  2.1103684   1537.2344072
  12. (0.2245888)  (112.1596367)
  13.      
  14. Weibull Scale 1550.559
  15.  Weibull Shape 2.1195
  16.      
  17. > library(Renext)            ## for concentrated log-lik
  18. > try(fweibull(Y))           ## error (numerical pb with information matrix)
  19. > fit <- fweibull(Y / 1000)  ## works
  20. > ## set parameters and logLik back to original scale
  21. > fit$est * c(1, 1000)
  22.       shape       scale
  23.    2.126225 1563.094460
  24.  
  25. > fit$sd * c(1, 1000)
  26.       shape       scale
  27.   0.2444308 114.1293266
  28.  
  29. > fit$loglik - length(Y) * log(1000)
  30. [1] -362.2237
  31.  
  32. > library(MASS)
  33. > ## set parameters and logLik back to original scale
  34. > fit2 <- fitdistr(Y / 1000, "weibull")
  35. > fit2$est * c(1, 1000)
  36.       shape       scale
  37.    2.126231 1563.095165
  38.  
  39. > fit2$sd * c(1, 1000)
  40.       shape       scale
  41.   0.2288605 114.9071653
  42.  
  43. > fit2$loglik - length(Y) * log(1000)
  44. [1] -362.2237
  45.      
  46. > survreg(Surv(Y)~1)
  47. Call:
  48. survreg(formula = Surv(Y) ~ 1)
  49.  
  50. Coefficients:
  51. (Intercept)
  52.    7.354423
  53.  
  54. Scale= 0.4703164
  55.  
  56. Loglik(model)= -362.2   Loglik(intercept only)= -362.2
  57. n= 46
  58. > exp(7.354423)   #  exponentiate the Intercept
  59. [1] 1563.095
  60. > 1/0.4703164     #  take inverse of the Scale
  61. [1] 2.126228
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top