Guest User

Untitled

a guest
Apr 19th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. residuals.garch11 <- residuals(fit.garch11.gaussian)
  2.  
  3. figs <- rbind(c(0, 0.5, 0, 1),
  4. c(0.5, 1, 0, 1))
  5. colnames(figs) <- c("W", "E", "S", "N")
  6. rownames(figs) <- c("Screen1", "Screen2")
  7. screenIDs <- split.screen(figs)
  8. names(screenIDs) <- rownames(figs)
  9.  
  10.  
  11. ## 1) Left Side: QQ PLot + hist
  12. screen(screenIDs["Screen1"])
  13.  
  14. qqnorm(residuals.garch11, main=c("Residuals Normal Q-Q Plot",
  15. paste("Shapiro p=", prettyNum(shap,
  16. digits = 2))))
  17. qqline(residuals.garch11)
  18.  
  19.  
  20. op <- par(fig=c(0.01,.32,.36,.98), new=TRUE)
  21.  
  22. hist(residuals.garch11, breaks=22, probability=T,
  23. col="grey", xlab="", ylab="", main="", axes=F)
  24. lines(a, dnorm(a, mean(residuals.garch11),
  25. sd(residuals.garch11)),
  26. lty=1, col="darkblue", lwd=2)
  27. box()
  28. par(op)
  29.  
  30.  
  31. ## 2) Right side: Scatterplot
  32. screen(screenIDs["Screen2"])
  33.  
  34. qqnorm(residuals.garch11, main=c("Residuals Normal Q-Q Plot",
  35. paste("Shapiro p=", prettyNum(shap,
  36. digits = 2))))
  37. qqline(residuals.garch11)
  38.  
  39.  
  40. op <- par(fig=c(0.01,.32,.36,.98), new=TRUE)
  41.  
  42. hist(residuals.garch11, breaks=22, probability=T,
  43. col="grey", xlab="", ylab="", main="", axes=F)
  44. lines(a, dnorm(a, mean(residuals.garch11),
  45. sd(residuals.garch11)),
  46. lty=1, col="darkblue", lwd=2)
  47. box()
  48. par(op)
Add Comment
Please, Sign In to add comment