在R中组合两个函数给出的结果与包含两者的新函数不同

时间:2015-06-13 19:36:41

标签: r precision function-composition

我试着看一下后勤地图

chart1.ChartAreas[0].AxisX.Enabled = AxisEnabled.False; 
chart1.ChartAreas[0].AxisY.Enabled = AxisEnabled.False; 

及其成分如:

logMap <- function(x){
r <- 0.5
4*r*x*(1-x)}

当然,您也可以直接编写一个组成logMap的新函数:

logMap2_a <- function(x){
  logMap(logMap(x))}

现在,绘制这两件事并没有显示出相同的曲线:

logMap2 <- function(x){
r <- 0.5
16*r*r*x*(1-x)*(1-16*r*r*x*(1-x))}

第一个图显示了logMap2的结果,这是logMap2_a的第二个结果。

This is the picture I wanted to have, the power of two of the logistic map (function logMap2)

This is the curve of the composition which should yield the same curve as the power of two of the logistic map (function logMap2_a)

我的第一个想法是问题是由于返回数据的精确性而产生的,但我无法想象这是一个相当大的数字的问题。知道发生了什么事吗?

1 个答案:

答案 0 :(得分:1)

logMap2 <- function(x){
r <- 0.5
16*r*r*x*(1-x)*(1-4*r*x*(1-x))}
相关问题