Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/algorithm/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Algorithm 物联网故障检测算法的实现_Algorithm_Math_Statistics_Iot_Error Detection - Fatal编程技术网

Algorithm 物联网故障检测算法的实现

Algorithm 物联网故障检测算法的实现,algorithm,math,statistics,iot,error-detection,Algorithm,Math,Statistics,Iot,Error Detection,我正试图实现我在这里找到的白皮书中的传感器故障检测算法: 我的数学技能不错,但本文并没有详细介绍如何设置所有内容 我当前的实现如下所示: /******************************************************************************* How this algorithm works: 1) There exists W historical windows which hold the distribution objec

我正试图实现我在这里找到的白皮书中的传感器故障检测算法: 我的数学技能不错,但本文并没有详细介绍如何设置所有内容

我当前的实现如下所示:

/*******************************************************************************
How this algorithm works:
    1) There exists W historical windows which hold the distribution objects (mean, variance)
        for that window. Each window is of size m (the sliding window size)
    2) There exists a current window which changes every iteration by popping the 
        oldest value into the buffer window.
    3) There exists a buffer window which takes the oldest values from the current window
        each iteration. Once the buffer window reaches size m
        it then becomes the newest historical window.
*******************************************************************************/

int m = 10; //Statistics sliding window size
float outlierDetectionThreshold; // The outlier detection threshold for sensor s, also called epsilon
List<float> U; // Holds the last 10 windows mean
List<float> V; // Holds the last 10 windows variance
List<float> CurrentWindow; // Holds the last m values

procedure GFD()
    do
        get a value vi 
        Detection(vi)
    while not end
return

procedure Detection(vi)
    init outlierDetectionThreshold
    init U and V, loading last m distribution characteristics from DB
    init CurrentWindow loading the last m - 1 values

    Xi; // What is this?
    Tau; // What is this?

    Insert vi into CurrentWindow // CurrentWindow now has the m latest values 

    float CurrentWindowMean = Mean(CurrentWindow)
    float CurrentWindowVariance = Variance(CurrentWindow)

    if (IsStuck(CurrentWindowVariance) or IsSpikes(vi))
        return
    If (IsOutlier(vi) and not IsRatStatChagne(vi))
        return;
    IsRatStatChagne(vi);
    return

procedure IsStuck(variance)
    if (variance == 0)
        return true;
    return false;

procedure IsSpike(windowMean, windowVariance, historicalMeans, historicalVariances, xi, tau)
    if ( (mean / Mean(historicalMeans)) < xi)
        if ( (variance / Mean(historicalVariances)) > tau)
            return true;
    return false;

procedure IsOutlier(historicalMeans, historicalVariances, outlierDetectionThreshold)
    // use historicalMeans and historicalVariances to calculate theta
    if (theta > outlierDetectionThreshold)
        return true;
/*******************************************************************************
该算法的工作原理:
1) 存在W个保存分布对象(均值、方差)的历史窗口
为了那扇窗户。每个窗口的大小为m(滑动窗口大小)
2) 存在一个当前窗口,通过弹出
将最早的值放入缓冲区窗口。
3) 存在一个缓冲区窗口,它从当前窗口获取最旧的值
每次迭代。一旦缓冲区窗口达到大小m
然后它成为最新的历史窗口。
*******************************************************************************/
int m=10//统计滑动窗口大小
浮点异常值检测阈值;//传感器s的异常值检测阈值,也称为epsilon
列表U;//保存最后10个窗口的平均值
列表V;//保存最后10个窗口
列出当前窗口;//保存最后的m值
程序GFD()
做
得到一个值vi
检测(六)
而不是结束
返回
程序检测(vi)
初始异常检测阈值
初始U和V,从DB加载最后m个分布特征
init CurrentWindow加载最后的m-1值
席;这是什么?
Tau;//这是什么?
将vi插入CurrentWindow//CurrentWindow现在具有m个最新值
浮点CurrentWindowMean=平均值(CurrentWindow)
浮动CurrentWindowVariance=方差(CurrentWindow)
if(IsStuck(当前窗口方差)或IsSpikes(vi))
返回
If(国际标准(vi)而非以色列标准(vi))
返回;
伊斯拉特斯塔切涅(六);
返回
程序IsStuck(差异)
如果(方差==0)
返回true;
返回false;
程序ISSPS(窗均值,窗方差,历史平均值,历史方差,席,τ)
如果((平均值/平均值(历史平均值))tau)
返回true;
返回false;
程序更优(历史平均值、历史变量、异常值检测阈值)
//使用历史均值和历史方差计算θ
if(θ>异常检测阈值)
返回true;
我在实现IsOutlier和IsRatStatChange功能时遇到困难

在ISPACK中,席和τ是如何计算的,或者它们代表什么?
  • 对于IsOutlier函数,如何计算θ
  • 对于IsRatStatStange函数,我还没有深入研究过,但是有人对编写这个函数有很好的理解吗
  • 如果您有任何其他见解,我们将不胜感激。 提前谢谢