自回归 [英] Autoregressive

查看:93
本文介绍了自回归的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自回归模型捕获来自同一接入点的样本信号之间的自相关.使用此模型来计算n个相关样本的平均值的分布.这是在WiFi定位系统中完成的.请更正以下代码.我是新手,非常感谢您的协助.

谢谢!

The autoregressive model captures the autocorrelation between the sample signals from the same access point. Using this model to calculate the distribution of the average of n correlated samples. This is done in a WiFi location system. Please make corrections to the code below. I''m a newbie and would really appreciated your assistance.

Thanks!

static void Calculate_P(int x,int y)
        {
            double a, b = 0, c = 0;
            double h = 0;
            //calculate each location for each AP
            for(int i = 0; i <= 1; i++)
            {
                for(int j = 0; j <= 3; j++)
                {
                    for(int k = 0; k <= 3; k++)
                    {
                        h += GlobalVariable.Str[i, j, k];
                    }
                    h /= 4;
                    GlobalVariable.aves[i, j] = h;
                }
            }
            for(int i = 0; i <= 1; i++)
            {
                for(int j = 0; j <= 3; j++)
                {
                    for(int k = 0; k <= 2; k++)
                    {
                        b += (GlobalVariable.Str[i, j, k] - GlobalVariable.aves[i, j]) * (GlobalVariable.Str[i, j, k + 1 ] - GlobalVariable.aves[i, j]);
                    }
                    for(int k = 0; k <= 3; k++)
                    {
                        c += (GlobalVariable.Str[i, j, k] - GlobalVariable.aves[i, j]) * (GlobalVariable.Str[i, j, k] - GlobalVariable.aves[i, j]);
                    }
                    a = b / c;
                    Console.WriteLine("location{0},AP{1}
Autocorrelation coefficient:{2} ", i + 1, j + 1, a);
                }
            }
        }

推荐答案

是什么问题?以及它在代码中的什么地方出现?
what is the problem? And where in the code does it occur?


这篇关于自回归的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆