I tried to look at the logistic map
logMap <- function(x){
r <- 0.5
4*r*x*(1-x)}
and its compositions such as:
logMap2_a <- function(x){
logMap(logMap(x))}
Of course, you can also directly write a new function that composes logMap with itself:
logMap2 <- function(x){
r <- 0.5
16*r*r*x*(1-x)*(1-16*r*r*x*(1-x))}
Now, plotting the two things does not show the same curve:
curve(logMap2, from=0, to=1)
curve(logMap2_a, from=0, to=1)
The first figure shows the result of logMap2, the second that of logMap2_a.
My first idea was that the problem arises due to the precision of returned data, but I cannot imagine that this is a problem with this reasonably large numbers. Any idea what is going on?