Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- prob_mat_1 = cbind(sort(rnorm(88)), rep(1/88, 88), cumsum(rep(1/88, 88)))
- prob_mat_2 = cbind(sort(rnorm(88)), rep(1/88, 88), cumsum(rep(1/88, 88)))
- cdf_int_f = function(prob_mat){
- h = tail(prob_mat[,1], nrow(prob_mat)-1) - head(prob_mat[,1], nrow(prob_mat)-1)
- u_plus_l = tail(prob_mat[,3], nrow(prob_mat)-1) + head(prob_mat[,3], nrow(prob_mat)-1)
- cumsum(h*u_plus_l/2)
- }
- plot(prob_mat[2:nrow(prob_mat_1),1], cdf_int_f(prob_mat_1), type = "l")
- lines(prob_mat[2:nrow(prob_mat_2),1], cdf_int_f(prob_mat_2), col = 2)
Advertisement
Add Comment
Please, Sign In to add comment