- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想对负熵〜大小数据进行回归,以估计最佳大小(用箭头指出)。
熵数据的范围在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")
关于r - 如何在R中拟合信息(负熵)〜大小的回归?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53547315/
gnuplot 中拟合函数的正确方法是什么 f(x)有下一个表格吗? f(x) = A*exp(x - B*f(x)) 我尝试使用以下方法将其拟合为任何其他函数: fit f(x) "data.txt
(1)首先要建立数据集 ? 1
测量显示一个信号,其形式类似于具有偏移量和因子的平方根函数。如何找到系数并在一个图中绘制原始数据和拟合曲线? require(ggplot2) require(nlmrt) # may be thi
我想将以下函数拟合到我的数据中: f(x) = Offset+Amplitudesin(FrequencyT+Phase), 或根据 Wikipedia : f(x) = C+alphasin(ome
我正在尝试使用与此工具相同的方法在 C# 中拟合 Akima 样条曲线:https://www.mycurvefit.com/share/4ab90a5f-af5e-435e-9ce4-652c95c
问题:开放层适合 map ,只有在添加特征之后(视觉),我该如何避免这种情况? 我在做这个 第 1 步 - 创建特征 var feature = new ol.Feature({...}); 第 2
我有一个数据变量,其中包含以下内容: [Object { score="2.8", word="Blue"}, Object { score="2.8", word="Red"}, Objec
我正在尝试用中等大小的 numpy float 组来填充森林 In [3]: data.shape Out[3]: (401125, 5) [...] forest = forest.fit(data
我想用洛伦兹函数拟合一些数据,但我发现当我使用不同数量级的参数时拟合会出现问题。 这是我的洛伦兹函数: function [ value ] = lorentz( x,x0,gamma,amp )
我有一些数据,我希望对其进行建模,以便能够在与数据相同的范围内获得相对准确的值。 为此,我使用 polyfit 来拟合 6 阶多项式,由于我的 x 轴值,它建议我将其居中并缩放以获得更准确的拟合。 但
我一直在寻找一种方法来使数据符合 beta 二项分布并估计 alpha 和 beta,类似于 VGAM 库中的 vglm 包的方式。我一直无法找到如何在 python 中执行此操作。有一个 scipy
我将 scipy.optimize.minimize ( https://docs.scipy.org/doc/scipy/reference/tutorial/optimize.html ) 函数与
在过去的几天里,我一直在尝试使用 python 绘制圆形数据,方法是构建一个范围从 0 到 2pi 的圆形直方图并拟合 Von Mises 分布。我真正想要实现的是: 具有拟合 Von-Mises 分
我有一个简单的循环,它在每次迭代中都会创建一个 LSTM(具有相同的参数)并将其拟合到相同的数据。问题是迭代过程中需要越来越多的时间。 batch_size = 10 optimizer = opti
我有一个 Python 系列,我想为其直方图拟合密度。问题:是否有一种巧妙的方法可以使用 np.histogram() 中的值来实现此结果? (请参阅下面的更新) 我目前的问题是,我执行的 kde 拟
我有一个简单的 keras 模型(正常套索线性模型),其中输入被移动到单个“神经元”Dense(1, kernel_regularizer=l1(fdr))(input_layer) 但是权重从这个模
我正在尝试解决 Boston Dataset 上的回归问题在random forest regressor的帮助下.我用的是GridSearchCV用于选择最佳超参数。 问题一 我是否应该将 Grid
使用以下函数,可以在输入点 P 上拟合三次样条: def plotCurve(P): pts = np.vstack([P, P[0]]) x, y = pts.T i = np.aran
我有 python 代码可以生成数字 x、y 和 z 的三元组列表。我想使用 scipy curve_fit 来拟合 z= f(x,y)。这是一些无效的代码 A = [(19,20,24), (10,
我正在尝试从 this answer 中复制代码,但是我在这样做时遇到了问题。我正在使用包 VGAM 中的gumbel 发行版和 fitdistrplus . 做的时候出现问题: fit = fi
我是一名优秀的程序员,十分优秀!