Guest User

Untitled

a guest
May 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. a0 = 1.5; a1 = 0.4; b1 = 0.3; g1= 0.7
  2. nu = rep(0,1)
  3. h.new = rep(0,1)
  4. ddp = rep(0,1)
  5.  
  6. nu[1]=0
  7.  
  8. h.new[1] = a0/(1-a1-b1)
  9. ddp[1] = 0.5*log(g1)- g1*h.new[1] +
  10. nu[1]*(log(nu[1])-1) - log(factorial(nu[1]))+(g1)*nu[1]*
  11. (1+log(h.new[1]/nu[1]))
  12.  
  13. ###> ddp
  14. ###[1] NaN
  15.  
  16. ###h.new = 1.5/(1-0.4-0.3) = 5
  17.  
  18. ###ddp
  19. ###= 0.5*log(0.7)- (0.7)*(5) +
  20. ###(0)*(log(0)-1) - log(0!)+(0.7)*(0)*
  21. ###(1+log(5/0))
  22.  
  23. ###= 0.5*log(0.7)- (0.7)*(5)
  24.  
  25. ###= -0.528333
  26.  
  27. term3 <- if (nu==0) 0 else 0*(log(0)-1)
  28. term5 <- if (nu==0) 0 else g1*nu*(1+log(h.new/nu))
  29. ddp = 0.5*log(g1)-
  30. g1*h.new +
  31. term3 -
  32. log(factorial(nu))+
  33. term5
Add Comment
Please, Sign In to add comment