Esempio n. 1
0
        public static Vector GetMeanOfVectorsMDF(List <Vector> vectors)
        {
            Vector result = new Vector(vectors[0].values.Length, vectors[0].valuesMDF.Length, 0.0);

            foreach (Vector item in vectors)
            {
                result.AddMDF(item);
            }

            result.DivideMDF((double)vectors.Count);

            return(result);
        }
Esempio n. 2
0
        public static Vector GetVarianceOfVectors(List <Vector> vectors, Vector mean)
        {
            Vector result = new Vector(vectors[0].values.Length, vectors[0].valuesMDF.Length, 0.0);

            foreach (var item in vectors)
            {
                Vector diff = new Vector(item.valuesMDF.ToArray());
                diff.SubtractMDF(mean);
                diff.MultiplyMDF(diff);
                result.AddMDF(diff);
            }

            result.DivideMDF(vectors.Count - 1);

            return(result);
        }
Esempio n. 3
0
        public static Vector GetVarianceOfVectors(List<Vector> vectors, Vector mean)
        {
            Vector result = new Vector(vectors[0].values.Length, vectors[0].valuesMDF.Length, 0.0);

            foreach (var item in vectors)
            {
                Vector diff = new Vector(item.valuesMDF.ToArray());
                diff.SubtractMDF(mean);
                diff.MultiplyMDF(diff);
                result.AddMDF(diff);
            }

            result.DivideMDF(vectors.Count - 1);

            return result;
        }
Esempio n. 4
0
        public static Vector GetMeanOfVectorsMDF(List<Vector> vectors)
        {
            Vector result = new Vector(vectors[0].values.Length, vectors[0].valuesMDF.Length, 0.0);

            foreach (Vector item in vectors)
            {
                result.AddMDF(item);
            }

            result.DivideMDF((double)vectors.Count);

            return result;
        }