gpt4 book ai didi

r - 如何在R中拟合信息(负熵)〜大小的回归?

转载 作者:行者123 更新时间:2023-12-03 21:33:57 26 4
gpt4 key购买 nike

我想对负熵〜大小数据进行回归,以估计最佳大小(用箭头指出)。

enter image description here

熵数据的范围在0和1之间,而大小数据的范围从x > 0到无穷大。这里的信息值是使用香农按照Information = Hmax - H计算的

数据示例如下:

size <- c(0.0010, 0.0035, 0.0060, 0.0085, 0.0110, 0.0135, 0.0160, 0.0185, 0.0210, 0.0235, 0.0260, 0.0285, 0.0310, 0.0335, 0.0360, 0.0385, 0.0410, 0.0435, 0.0460, 0.0485, 0.0510, 0.0535, 0.0560, 0.0585, 0.0610, 0.0635, 0.0660, 0.0685, 0.0710, 0.0735, 0.0760, 0.0785, 0.0810, 0.0835, 0.0860, 0.0885, 0.0910, 0.0935, 0.0960, 0.0985, 0.1010, 0.1035, 0.1060, 0.1085, 0.1110, 0.1135, 0.1160, 0.1185, 0.1210, 0.1235, 0.1260, 0.1285, 0.1310, 0.1335, 0.1360, 0.1385, 0.1410, 0.1435, 0.1460, 0.1485, 0.1510, 0.1535, 0.1560, 0.1585, 0.1610, 0.1635, 0.1660, 0.1685, 0.1710, 0.1735, 0.1760, 0.1785, 0.1810, 0.1835, 0.1860, 0.1885, 0.1910, 0.1935, 0.1960, 0.1985, 0.2010, 0.2035, 0.2060, 0.2085, 0.2110, 0.2135, 0.2160, 0.2185, 0.2210, 0.2235, 0.2260, 0.2285, 0.2310, 0.2335, 0.2360, 0.2385, 0.2410, 0.2435, 0.2460, 0.2485, 0.2510, 0.2535, 0.2560, 0.2585, 0.2610, 0.2635, 0.2660, 0.2685, 0.2710, 0.2735, 0.2760, 0.2785, 0.2810, 0.2835, 0.2860, 0.2885, 0.2910, 0.2935, 0.2960, 0.2985, 0.3010, 0.3035, 0.3060, 0.3085, 0.3110, 0.3135, 0.3160, 0.3185, 0.3210, 0.3235, 0.3260, 0.3285, 0.3310, 0.3335, 0.3360, 0.3385, 0.3410, 0.3435, 0.3460, 0.3485, 0.3510, 0.3535, 0.3560, 0.3585, 0.3610, 0.3635, 0.3660, 0.3685, 0.3710, 0.3735, 0.3760, 0.3785, 0.3810, 0.3835, 0.3860, 0.3885, 0.3910, 0.3935, 0.3960, 0.3985, 0.4010, 0.4035, 0.4060, 0.4085, 0.4110, 0.4135, 0.4160, 0.4185, 0.4210, 0.4235, 0.4260, 0.4285, 0.4310, 0.4335, 0.4360, 0.4385, 0.4410, 0.4435, 0.4460, 0.4485, 0.4510, 0.4535, 0.4560, 0.4585, 0.4610, 0.4635, 0.4660, 0.4685, 0.4710, 0.4735, 0.4760, 0.4785, 0.4810, 0.4835, 0.4860, 0.4885, 0.4910, 0.4935, 0.4960, 0.4985)
information <- c(0.001, 0.136, 0.366, 0.532, 0.642, 0.719, 0.773, 0.810, 0.839, 0.854, 0.871, 0.878, 0.882, 0.885, 0.885, 0.886, 0.884, 0.878, 0.877, 0.873, 0.867, 0.864, 0.847, 0.851, 0.839, 0.839, 0.836, 0.828, 0.822, 0.821, 0.817, 0.817, 0.805, 0.805, 0.791, 0.796, 0.798, 0.795, 0.799, 0.788, 0.787, 0.785, 0.779, 0.775, 0.769, 0.771, 0.772, 0.769, 0.770, 0.746, 0.777, 0.755, 0.755, 0.752, 0.744, 0.745, 0.745, 0.759, 0.740, 0.747, 0.740, 0.747, 0.740, 0.738, 0.745, 0.718, 0.732, 0.748, 0.714, 0.731, 0.744, 0.710, 0.720, 0.750, 0.725, 0.708, 0.715, 0.753, 0.720, 0.702, 0.722, 0.708, 0.701, 0.716, 0.723, 0.719, 0.695, 0.692, 0.701, 0.720, 0.719, 0.699, 0.709, 0.699, 0.703, 0.714, 0.706, 0.686, 0.698, 0.694, 0.703, 0.708, 0.698, 0.653, 0.676, 0.687, 0.697, 0.707, 0.689, 0.691, 0.666, 0.646, 0.660, 0.687, 0.706, 0.722, 0.714, 0.702, 0.654, 0.642, 0.647, 0.650, 0.663, 0.673, 0.703, 0.704, 0.698, 0.694, 0.655, 0.641, 0.620, 0.625, 0.631, 0.644, 0.655, 0.663, 0.691, 0.669, 0.674, 0.647, 0.644, 0.659, 0.657, 0.652, 0.649, 0.636, 0.619, 0.613, 0.609, 0.629, 0.655, 0.667, 0.652, 0.640, 0.636, 0.643, 0.640, 0.652, 0.649, 0.645, 0.657, 0.654, 0.650, 0.622, 0.614, 0.617, 0.612, 0.621, 0.627, 0.622, 0.616, 0.626, 0.615, 0.624, 0.634, 0.633, 0.631, 0.629, 0.614, 0.617, 0.630, 0.633, 0.629, 0.620, 0.629, 0.626, 0.614, 0.624, 0.608, 0.591, 0.606, 0.607, 0.605, 0.618, 0.610, 0.622, 0.618, 0.616, 0.613, 0.612)

看来(请纠正我)信息数据遵循麦克斯韦-玻尔兹曼分布

require(shotGroups)
plot(information ~ log(size))
lines(pMaxwell(information, sigma= 0.3639920) ~ log(size), col = "red")

但是,我不确定如何使用回归中的参数来估计此最佳值,或者是否有任何其他方法来确定此最佳值而不是 max(information)

有什么想法吗?

最佳答案

这工作正常,尽管我必须将求根函数的上限限制在样条线开始摆动的区域下方......

library(splines)
ss <- smooth.spline(log(size),information,spar=0.4)
uu <- uniroot(function(x) predict(ss,x=x,deriv=1)$y,interval=c(-5,-3))

结果是-3.29。

图片:

plot(information ~log(size))
lines(ss$x,ss$y,col="red",lwd=2)
abline(v=uu$root,col="blue")

enter image description here

关于r - 如何在R中拟合信息(负熵)〜大小的回归?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53547315/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com