964. @无名啊,没有换,我在自己方式看性价比,好看看哪些高一点
| 价格 | 安兔兔跑分 |
| 500 | 541,971 |
| 550 | 596,168 |
| 600 | 650,365 |
| 650 | 704,562 |
| 700 | 758,759 |
| 750 | 812,956 |
| 800 | 867,153 |
| 850 | 921,350 |
| 900 | 975,547 |
| 950 | 1,029,744 |
| 1000 | 1,083,941 |
| 1050 | 1,138,138 |
| 1100 | 1,192,335 |
| 1150 | 1,246,532 |
| 1200 | 1,300,729 |
| 1250 | 1,354,926 |
| 1300 | 1,409,123 |
| 1350 | 1,463,320 |
| 1400 | 1,517,517 |
| 1450 | 1,571,714 |
| 1500 | 1,625,911 |
| 1550 | 1,680,108 |
| 1600 | 1,734,305 |
| 1650 | 1,788,502 |
| 1700 | 1,842,699 |
| 1750 | 1,896,896 |
| 1800 | 1,951,093 |
| 1850 | 2,005,290 |
| 1900 | 2,059,487 |
| 1950 | 2,113,684 |
| 2000 | 2,167,881 |
| 价格 | 安兔兔跑分 |
| 500 | 541,971 |
| 550 | 596,168 |
| 600 | 650,365 |
| 650 | 704,562 |
| 700 | 758,759 |
| 750 | 812,956 |
| 800 | 867,153 |
| 850 | 921,350 |
| 900 | 975,547 |
| 950 | 1,029,744 |
| 1000 | 1,083,941 |
| 1050 | 1,138,138 |
| 1100 | 1,192,335 |
| 1150 | 1,246,532 |
| 1200 | 1,300,729 |
| 1250 | 1,354,926 |
| 1300 | 1,409,123 |
| 1350 | 1,463,320 |
| 1400 | 1,517,517 |
| 1450 | 1,571,714 |
| 1500 | 1,625,911 |
| 1550 | 1,680,108 |
| 1600 | 1,734,305 |
| 1650 | 1,788,502 |
| 1700 | 1,842,699 |
| 1750 | 1,896,896 |
| 1800 | 1,951,093 |
| 1850 | 2,005,290 |
| 1900 | 2,059,487 |
| 1950 | 2,113,684 |
| 2000 | 2,167,881 |
962. 非二手性价比表
| 价格 | 安兔兔跑分 |
| 500 | 541,971 |
| 550 | 596,168 |
| 600 | 650,365 |
| 650 | 704,562 |
| 700 | 758,759 |
| 750 | 812,956 |
| 800 | 867,153 |
| 价格 | 安兔兔跑分 |
| 500 | 541,971 |
| 550 | 596,168 |
| 600 | 650,365 |
| 650 | 704,562 |
| 700 | 758,759 |
| 750 | 812,956 |
| 800 | 867,153 |
945. (code)'============================================================
' RobustAlphaBetaGamma.vb
' α-β-γ 跟踪器 + 动态 3σ 限幅
' 已处理:空队列 / 零方差 / 负阈值 / 数值溢出
'============================================================
Imports System.Collections.Generic
Imports System.Linq ' 低版本需引用 System.Core.dll
Public Class RobustAlphaBetaGamma
'--------------------- 可调参数 ---------------------------
Public Alpha As Double ' 位置修正系数
Public Beta As Double ' 速度修正系数
Public Gamma As Double ' 加速度修正系数
Public HistoryLen As Integer
'--------------------- 内部状态 ---------------------------
Private x As Double ' 滤波值
Private v As Double ' 速度
Private a As Double ' 加速度
Private ReadOnly residuals As New Queue(Of Double)()
'----------------------------------------------------------
' 构造函数(默认保守值)
'----------------------------------------------------------
Public Sub New(Optional alpha As Double = 0.001,
Optional beta As Double = 0.0001,
Optional gamma As Double = 0.00001,
Optional historyLen As Integer = 50)
Me.Alpha = alpha
Me.Beta = beta
Me.Gamma = gamma
Me.HistoryLen = historyLen
End Sub
'----------------------------------------------------------
' 每来一个新样本调用一次,返回滤波后的值
'----------------------------------------------------------
Public Function Update(raw As Double) As Double
' 1. 预测
Dim xPred As Double = x + v + 0.5 * a
Dim vPred As Double = v + a
Dim aPred As Double = a
' 2. 残差
Dim residual As Double = raw - xPred
' 3. 动态阈值(防零 / 防负 / 防空)
Dim threshold As Double = GetDynamicThreshold()
' 4. 限幅:残差被限制在 [-threshold, +threshold]
Dim useResidual As Double = Math.Max(-threshold,
Math.Min(threshold, residual))
' 5. 更新状态
x = xPred + Alpha * useResidual
v = vPred + Beta * useResidual
a = aPred + Gamma * useResidual
' 6. 保存残差
residuals.Enqueue(residual)
If residuals.Count > HistoryLen Then residuals.Dequeue()
Return x
End Function
'----------------------------------------------------------
' 计算 3σ 阈值(防零、防负、防空队列)
'----------------------------------------------------------
Private Function GetDynamicThreshold() As Double
Const MIN_THRESHOLD As Double = 0.001
Const MIN_SAMPLES As Integer = 3
If residuals.Count < MIN_SAMPLES Then Return 1.0
Dim arr = residuals.ToArray()
Dim avg As Double = arr.Average()
Dim var As Double = arr.Select(Function(val) (val - avg) ^ 2).Average()
If var < 0 Then var = 0 ' 防负
Dim std As Double = Math.Sqrt(var)
If std = 0 Then std = 0.001 ' 防零
Return Math.Max(MIN_THRESHOLD, 3.0 * std)
End Function
End Class
(/code)
' RobustAlphaBetaGamma.vb
' α-β-γ 跟踪器 + 动态 3σ 限幅
' 已处理:空队列 / 零方差 / 负阈值 / 数值溢出
'============================================================
Imports System.Collections.Generic
Imports System.Linq ' 低版本需引用 System.Core.dll
Public Class RobustAlphaBetaGamma
'--------------------- 可调参数 ---------------------------
Public Alpha As Double ' 位置修正系数
Public Beta As Double ' 速度修正系数
Public Gamma As Double ' 加速度修正系数
Public HistoryLen As Integer
'--------------------- 内部状态 ---------------------------
Private x As Double ' 滤波值
Private v As Double ' 速度
Private a As Double ' 加速度
Private ReadOnly residuals As New Queue(Of Double)()
'----------------------------------------------------------
' 构造函数(默认保守值)
'----------------------------------------------------------
Public Sub New(Optional alpha As Double = 0.001,
Optional beta As Double = 0.0001,
Optional gamma As Double = 0.00001,
Optional historyLen As Integer = 50)
Me.Alpha = alpha
Me.Beta = beta
Me.Gamma = gamma
Me.HistoryLen = historyLen
End Sub
'----------------------------------------------------------
' 每来一个新样本调用一次,返回滤波后的值
'----------------------------------------------------------
Public Function Update(raw As Double) As Double
' 1. 预测
Dim xPred As Double = x + v + 0.5 * a
Dim vPred As Double = v + a
Dim aPred As Double = a
' 2. 残差
Dim residual As Double = raw - xPred
' 3. 动态阈值(防零 / 防负 / 防空)
Dim threshold As Double = GetDynamicThreshold()
' 4. 限幅:残差被限制在 [-threshold, +threshold]
Dim useResidual As Double = Math.Max(-threshold,
Math.Min(threshold, residual))
' 5. 更新状态
x = xPred + Alpha * useResidual
v = vPred + Beta * useResidual
a = aPred + Gamma * useResidual
' 6. 保存残差
residuals.Enqueue(residual)
If residuals.Count > HistoryLen Then residuals.Dequeue()
Return x
End Function
'----------------------------------------------------------
' 计算 3σ 阈值(防零、防负、防空队列)
'----------------------------------------------------------
Private Function GetDynamicThreshold() As Double
Const MIN_THRESHOLD As Double = 0.001
Const MIN_SAMPLES As Integer = 3
If residuals.Count < MIN_SAMPLES Then Return 1.0
Dim arr = residuals.ToArray()
Dim avg As Double = arr.Average()
Dim var As Double = arr.Select(Function(val) (val - avg) ^ 2).Average()
If var < 0 Then var = 0 ' 防负
Dim std As Double = Math.Sqrt(var)
If std = 0 Then std = 0.001 ' 防零
Return Math.Max(MIN_THRESHOLD, 3.0 * std)
End Function
End Class
(/code)