beceb22

5

Jun 19th, 2018
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #### PREGUNTA 5
  2.  
  3. ## parte a)
  4.  
  5. rm(list = ls())
  6. x=vector()
  7. y=vector()
  8. U=vector()
  9. n=1000
  10. for (i in 1:n) {
  11. z=0
  12. for (j in 1:12) {
  13. U[j]=runif(1,0,1)
  14. z[j]=sum(U)-6
  15. }
  16. theta=(z^3)*(exp(z))
  17. }
  18. theta
  19. med=mean(theta);med
  20. var1=(var(theta)/n);var1
  21.  
  22. ##Parte b)
  23. Longitud <- (2*(1.96)*sqrt(var1))/(sqrt(n));Longitud
  24. ILI=med-((1.96)*sqrt(var1)/sqrt(n));ILI
  25. ILS=med+((1.96)*sqrt(var1)/sqrt(n));ILS
Add Comment
Please, Sign In to add comment