我想知道卡尔曼滤波器和指数滤波器有哪些优点和缺点?我有一个多传感器融合问题,我正在尝试决定选择哪种方法.
我认为,卡尔曼滤波器在计算上更复杂,但它具有系统的更详细的模型,从而更准确的(?)在多传感器融合.
而指数滤波器是一个简单的等式,但它是由阿尔法的选择(过滤器的较高级α-=>少"记忆",从而较小的平滑的,但多个权重对测量的,而较低的α具有更高程度的平滑化,但突然的变化的限制没有正确反映.
当存在抖动等时,指数滤波器在噪声消除中更有用,而卡尔曼滤波器对于实际的多传感器融合是有用的.它是否正确?
此外,遗传算法对传感器融合有多大用处?我正在尝试将磁罗盘和陀螺仪结合起来估算真实的方向.
谢谢!
我有个问题.在我的jsp页面中,我有一个接受货币价值的文本字段.当我输入一个值66777764时6.6777764E7,只要有验证错误,它就会变成我的文本字段.我知道这不会影响数据库中保存的值,但我认为它会误导/混淆用户.请帮忙.提前致谢.
我正在尝试使用 C# 应用程序分析一些数据,并且需要计算趋势线。我知道趋势线有多种类型,但现在我正在尝试计算指数增长;我将用它来预测未来的价值。我一直在研究的方程是
x(t) = x(0) * ((1+r)^t)
Run Code Online (Sandbox Code Playgroud)
这是我为尝试复制该图而编写的代码:
public void ExponentialBestFit(List<DateTime> xvalues, List<double> yvalues)
{
//Find the first value of y (The start value) and the first value of x (The start date)
xzero = Convert.ToDouble(xvalues[0].ToOADate());
yzero = yvalues[0];
if (yzero == 0)
yzero += 0.1;
//For every value of x (exluding the 1st value) find the r value
//
// | y | Where t = the time sinse the start time (time period)
//Equation for r = …Run Code Online (Sandbox Code Playgroud) 我使用了以下代码:
double pow = 3/7;
double num = 85;
System.out.println(Math.pow(num, pow));
Run Code Online (Sandbox Code Playgroud)
预期结果:
6.71...
Run Code Online (Sandbox Code Playgroud)
输出是
1.0
Run Code Online (Sandbox Code Playgroud)
知道为什么吗?
在Excel中,我想生成1000行值,我知道初始值和最终值.
例如,单元格a1 = 1400,单元格a1000 = 1190,总减少量为15%,如何生成1000行值excel,使得值呈指数减小?
任何想法我怎么能创建一个公式来实现这一目标?谢谢
类似于Python Pandas DataFrame上的这个问题指数衰减,我想快速计算数据帧中某些列的指数衰减和.但是,数据帧中的行在时间上不是均匀间隔的.因此,虽然exponential_sum[i] = column_to_sum[i] + np.exp(-const*(time[i]-time[i-1])) * exponential_sum[i-1],重量np.exp(...)没有分解,但我不明白如何改变这个问题并仍然利用pandas/numpy矢量化.这个问题有熊猫矢量化解决方案吗?
为了说明所需的计算,这里是一个样本框架,其中使用衰减常数1 A存储的指数移动总和Sum:
time A Sum
0 1.00 1 1.000000
1 2.10 3 3.332871
2 2.13 -1 2.234370
3 3.70 7 7.464850
4 10.00 2 2.013708
5 10.20 1 2.648684
Run Code Online (Sandbox Code Playgroud) 我想用R中的一个预测器来估计指数危险模型.出于某种原因,当我使用带有偏移log t的glm poisson并且当我只使用生存包中的幸存函数时,我得到具有相反符号的系数.我确信这个解释非常明显,但我无法弄清楚.
例
t <- c(89,74,23,74,53,3,177,44,28,43,25,24,31,111,57,20,19,137,45,48,9,17,4,59,7,26,180,56,36,51,6,71,23,6,13,28,16,180,16,25,6,25,4,5,32,94,106,1,69,63,31)
d <- c(0,1,1,0,1,1,0,1,1,0,1,1,1,1,0,0,1,0,1,1,1,0,1,0,1,1,0,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1)
p <- c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1)
df <- data.frame(d,t,p)
# exponential hazards model using poisson with offest log(t)
summary(glm(d ~ offset(log(t)) + p, data = df, family = "poisson"))
Run Code Online (Sandbox Code Playgroud)
生产:
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -5.3868 0.7070 -7.619 2.56e-14 ***
p 1.3932 0.7264 1.918 0.0551 .
Run Code Online (Sandbox Code Playgroud)
相比
# exponential hazards model using survreg exponential
require(survival)
summary(survreg(Surv(t,d) ~ p, data = df, dist = "exponential"))
Run Code Online (Sandbox Code Playgroud)
生产:
Value Std. Error z p …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 scipy.optimize.curve_fit 优化指数拟合。但结果并不好。我的代码是:
def func(x, a, b, c):
return a * np.exp(-b * x) + c
# xdata and data is obtain from another dataframe and their type is nparray
xdata =[36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70 ,71,72]
ydata = [4,4,4,6,6,13,22,22,26,28,38,48,55,65,65,92,112,134,171,210,267,307,353,436,669,669,818,1029,1219,1405,1617,1791,2032,2032,2182,2298,2389]
popt, pcov = curve_fit(func, xdata, ydata)
plt.plot(xdata, func(xdata, *popt), 'r-', label='fit: a=%5.3f, b=%5.3f, c=%5.3f' % tuple(popt))
plt.scatter(xdata, ydata, s=1)
plt.show()
Run Code Online (Sandbox Code Playgroud)
然后我得到这样的结果:
结果表明:
pcov = [[inf inf inf] [inf inf inf] [inf inf inf]]
popt = [1 1 611.83784]
Run Code Online (Sandbox Code Playgroud)
我不知道如何让我的曲线很好地拟合。你能打招呼吗?谢谢你!
在 JS 中,我们使用Number.toExponential()which Converts 将数字转换为其科学记数法(即 : for 1000 -> "1e3")。
我检查了 hoggle 但似乎找不到它。
注:以指数变化num -> string