Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. x <- c(10, 9, 5, 6, 7, 4, 3, 5, 6, 8)
  2.  
  3. y <- c(1,2,1,2,2,1,3,3,1,2)
  4.  
  5. "pPareto" <- function(x, alpha, x0)
  6. {
  7. result <- 1 - (x0/(x+x0))^alpha
  8. return(result)
  9. }
  10.  
  11. install.packages("truncgof")
  12.  
  13. library(MASS)
  14. library(truncgof)
  15.  
  16. set.seed(123)
  17.  
  18. treshold <- y
  19.  
  20. xc <- x # complete sample
  21.  
  22. xt <- xc[xc >= y] # left truncated sample
  23.  
  24. ks.test(xt, "pPareto", list(alpha = 2, x0 = location), H = y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement