4 Nisan 2011 Pazartesi

Binom Dağılıma Uygunluk (Ki-Kare Algoritması C#.NET)

float a = count / (float)deger;
int d = 0;
if (a > 0.20 || sayi>0)
{
for (int k = 0; k < list.Count; k++)
{
if ((float)(list[k]) < 5 && a > 0.20)
{

if (k == 0)
{
k++;
}
count++;
a = list.Count / count;
list[k - 1] = (float)list[k] + (float)list[k - 1];
list.RemoveAt(k);
list2[k - 1] = (float)list2[k] + (float)list2[k - 1];
list2.RemoveAt(k);
k--;
d++;
}

else if ((float)(list[k]) < 1)
{
count++;
a = list.Count / count;
list[k - 1] = (float)list[k] + (float)list[k - 1];
list.RemoveAt(k);
list2[k - 1] = (float)list2[k] + (float)list2[k - 1];
list2.RemoveAt(k);
k--;
d++;
}
else
{
}

}

for (int j = 0; j < list.Count; j++)
{
m_Grid[6, j].Value = list[j];
m_Grid[7, j].Value = list2[j];
}

if (d > 0)
{
kikare = 0;
for (int j = 0; j < list.Count; j++)
{
kikare = ((((float)m_Grid[7, j].Value - (float)m_Grid[6, j].Value) * ((float)(m_Grid[7, j].Value) - (float)(m_Grid[6, j].Value))) / (float)m_Grid[6, j].Value) + kikare;
}
}

Yaklaşık 200 satırlık bir kod mevcut. Yukarıda ise kısaca 1 den küçük göze varsa birleştir. 5 ten küçükleri oranla %20den büyükse yine göze birleştirme işlemi yap vb..

Algoritma Statistica binom dağılıma uygunluk ile aynı mantıkla çalışmaktadır.




Hiç yorum yok:

Yorum Gönder