-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from akkoyun/02.00.02
02.00.02
- Loading branch information
Showing
12 changed files
with
955 additions
and
767 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Include Statistal Library | ||
#include <Statistical.h> | ||
|
||
|
||
// Set Data | ||
float Data[5]; | ||
|
||
// Construct Object | ||
Array_Stats<float> Data_Array(Data, sizeof(Data) / sizeof(Data[0])); | ||
|
||
|
||
void setup() { | ||
|
||
// Start Serial | ||
Serial.begin(115200); | ||
|
||
// Set Data | ||
Serial.println(F("Learning Data...")); | ||
|
||
// Set FILO | ||
Data_Array.Set_FILO_Size(4); | ||
|
||
// Add Data to FILO Array | ||
Data_Array.FILO_Add_Data(220.12); | ||
Data_Array.FILO_Add_Data(214.35); | ||
Data_Array.FILO_Add_Data(200.14); | ||
Data_Array.FILO_Add_Data(212.80); | ||
Data_Array.FILO_Add_Data(242.33); | ||
Data_Array.FILO_Add_Data(215.99); | ||
Data_Array.FILO_Add_Data(220.12); | ||
|
||
// Print Stats | ||
Serial.println(F("------------------------------------------------")); | ||
Serial.print(F("Array Size : ")); Serial.println(Data_Array.Size()); | ||
Serial.println(F("------------------------------------------------")); | ||
Serial.print(F("Data Array : ")); Data_Array.Array(); | ||
Serial.print(F("Array Sum : ")); Serial.println(Data_Array.Sum()); | ||
Serial.print(F("Array Min : ")); Serial.println(Data_Array.Min()); | ||
Serial.print(F("Array Max : ")); Serial.println(Data_Array.Max()); | ||
Serial.print(F("Array Square Sum : ")); Serial.println(Data_Array.Sq_Sum()); | ||
Serial.print(F("Array Arithmetic Average : ")); Serial.println(Data_Array.Average(Data_Array.Arithmetic_Avg)); | ||
Serial.print(F("Array Geometric Average : ")); Serial.println(Data_Array.Average(Data_Array.Geometric_Avg)); | ||
Serial.print(F("Array RMS Average : ")); Serial.println(Data_Array.Average(Data_Array.RMS_Avg)); | ||
Serial.print(F("Array Extended RMS Average : ")); Serial.println(Data_Array.Average(Data_Array.Ext_RMS_Avg)); | ||
Serial.print(F("Array Q1 : ")); Serial.println(Data_Array.Quartile(1)); | ||
Serial.print(F("Array Q2 (Median) : ")); Serial.println(Data_Array.Quartile(2)); | ||
Serial.print(F("Array Q3 : ")); Serial.println(Data_Array.Quartile(3)); | ||
Serial.print(F("Array IQR : ")); Serial.println(Data_Array.IQR()); | ||
Serial.print(F("Array Standard Deviation : ")); Serial.println(Data_Array.Standard_Deviation()); | ||
Serial.print(F("Array Standard Deviation Error : ")); Serial.println(Data_Array.Standard_Deviation_Error()); | ||
Serial.print(F("Array Coefficient Factor : ")); Serial.println(Data_Array.Coefficient_Factor()); | ||
Serial.print(F("Array Variance : ")); Serial.println(Data_Array.Variance()); | ||
Serial.println(F("------------------------------------------------")); | ||
Serial.print(F("Sorted Data Array : ")); Data_Array.Array(); | ||
|
||
} | ||
|
||
void loop() { | ||
|
||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,48 @@ | ||
#include <Statistical.h> | ||
|
||
Statistical DataSet; | ||
|
||
void setup() { | ||
|
||
// Start Serial | ||
Serial.begin(115200); | ||
|
||
|
||
// Set Data | ||
Serial.println("Learning Data..."); | ||
|
||
} | ||
|
||
void loop() { | ||
|
||
// Set Data | ||
Serial.println("Learning Data..."); | ||
uint8_t Data_X[] = {1, 2, 3, 4, 5, 6, 7}; | ||
float Data_Y[] = {2, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7}; | ||
|
||
// Declare Object | ||
Linear_Regression<uint8_t, float> Regression(Data_X, Data_Y, sizeof(Data_X) / sizeof(Data_X[0])); | ||
|
||
// Print Array X | ||
Serial.print("Data X Array : "); | ||
for (size_t i = 0; i < sizeof(Data_X) / sizeof(Data_X[0]); i++) {Serial.print(F("[")); Serial.print(Data_X[i]); Serial.print(F("] "));} | ||
Serial.println(""); | ||
|
||
// Print Array X | ||
Serial.print("Data Y Array : "); | ||
for (size_t i = 0; i < sizeof(Data_X) / sizeof(Data_X[0]); i++) {Serial.print(F("[")); Serial.print(Data_Y[i]); Serial.print(F("] "));} | ||
Serial.println(""); | ||
|
||
// Print Regression Slope | ||
Serial.print("Slope : "); Serial.println(Regression.Slope(),5); | ||
|
||
// Print Regression Offset | ||
Serial.print("Offset : "); Serial.println(Regression.Offset(),5); | ||
|
||
// Print Regression R2 | ||
Serial.print("R2 : "); Serial.println(Regression.R2(),5); | ||
|
||
// Print Divider | ||
Serial.println("--------------------------"); | ||
|
||
// Set Precision | ||
uint8_t Linear_Regression_Precision = 5; | ||
|
||
// Set Array | ||
float Data[Linear_Regression_Precision][2]; | ||
|
||
// Learn Data | ||
DataSet.Array_FILO(Data, Linear_Regression_Precision, 1, 220.14); | ||
DataSet.Array_FILO(Data, Linear_Regression_Precision, 2, 221.36); | ||
DataSet.Array_FILO(Data, Linear_Regression_Precision, 3, 218.21); | ||
DataSet.Array_FILO(Data, Linear_Regression_Precision, 4, 217.06); | ||
DataSet.Array_FILO(Data, Linear_Regression_Precision, 5, 220.14); | ||
DataSet.Array_FILO(Data, Linear_Regression_Precision, 6, 222.14); | ||
DataSet.Array_FILO(Data, Linear_Regression_Precision, 7, 225.14); | ||
|
||
// Print FILO Array | ||
Serial.print("Regression Data Array : "); | ||
for (uint8_t i = 0; i < Linear_Regression_Precision; i++) { | ||
Serial.print("["); | ||
Serial.print(Data[i][0]); | ||
Serial.print(","); | ||
Serial.print(Data[i][1]); | ||
Serial.print("] "); | ||
} | ||
Serial.println(""); | ||
|
||
// Print Calculated Data | ||
Serial.print("Regression Data Count : "); Serial.println(Linear_Regression_Precision); | ||
Serial.print("Regression Slope : "); Serial.println(DataSet.Linear_Regression_Slope(Data, Linear_Regression_Precision), 4); | ||
Serial.print("Regression Offset : "); Serial.println(DataSet.Linear_Regression_Offset(Data, Linear_Regression_Precision), 4); | ||
Serial.print("Regression R2 : "); Serial.println(DataSet.Linear_Regression_R2(Data, Linear_Regression_Precision), 4); | ||
Serial.println("------------------------"); | ||
|
||
delay(10000); | ||
// Delay | ||
delay(1000); | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name=Statistical | ||
version=1.4.15 | ||
version=2.0.2 | ||
author=Gunce Akkoyun <[email protected]> | ||
maintainer=Gunce Akkoyun <[email protected]> | ||
sentence=Statistic, Sum, Max, Min, Sq_Sum, Arithmetic Average, Geometric Average, RMS Average, Ext RMS Average, Bubble Sort, Median, Standard Deviation, Standard Deviation Error, Coefficient Factor, Average, Stream, Regression, Slope, Data, Analyse | ||
|
Oops, something went wrong.