Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- h1 = function(x) {
- log(abs(x))
- }
- h2 = function(x) {
- sign(x)*log(abs(x))
- }
- h3 = function(x) {
- -sign(x)*log(abs(1-2*x))
- }
- N = 1000000
- x = runif(N, -10, 10)
- # x = rnorm(N, -8, 9)
- for(i in 1:200) {
- print(i)
- x = h3(x)
- if(i %% 50 == 0) {
- hist(x, breaks = 500, main = i, probability = TRUE, xlim = c(-10,10))
- }
- }
Add Comment
Please, Sign In to add comment