JWS C Library
C language utility library
|
00001 /* 00002 * This work is licensed under a Creative Commons 00003 * Attribution-Noncommercial-Share Alike 3.0 United States License. 00004 * 00005 * http://creativecommons.org/licenses/by-nc-sa/3.0/us/ 00006 * 00007 * You are free: 00008 * 00009 * to Share - to copy, distribute, display, and perform the work 00010 * to Remix - to make derivative works 00011 * 00012 * Under the following conditions: 00013 * 00014 * Attribution. You must attribute the work in the manner specified by the 00015 * author or licensor (but not in any way that suggests that they endorse you 00016 * or your use of the work). 00017 * 00018 * Noncommercial. You may not use this work for commercial purposes. 00019 * 00020 * Share Alike. If you alter, transform, or build upon this work, you may 00021 * distribute the resulting work only under the same or similar license to 00022 * this one. 00023 * 00024 * For any reuse or distribution, you must make clear to others the license 00025 * terms of this work. The best way to do this is by including this header. 00026 * 00027 * Any of the above conditions can be waived if you get permission from the 00028 * copyright holder. 00029 * 00030 * Apart from the remix rights granted under this license, nothing in this 00031 * license impairs or restricts the author's moral rights. 00032 */ 00033 00034 00046 #ifndef STAT_H 00047 #define STAT_H 00048 00049 00050 #include <jwsc/config.h> 00051 00052 #include <stdlib.h> 00053 #include <inttypes.h> 00054 00055 #include "jwsc/base/error.h" 00056 #include "jwsc/vector/vector.h" 00057 #include "jwsc/matrix/matrix.h" 00058 00059 00060 #ifdef __cplusplus 00061 namespace jwsc { 00062 extern "C" { 00063 #endif 00064 00065 00074 void sample_mean_f(float* mean_out, const Vector_f* x); 00075 00077 void sample_mean_d(double* mean_out, const Vector_d* x); 00078 00090 void sample_variance_f(float* var_out, const Vector_f* x); 00091 00093 void sample_variance_d(double* var_out, const Vector_d* x); 00094 00109 void sample_error_f(float* err_out, const Vector_f* x); 00110 00115 void sample_error_d(double* err_out, const Vector_d* x); 00116 00131 void sample_stats_f 00132 ( 00133 float* mean_out, 00134 float* var_out, 00135 float* err_out, 00136 const Vector_f* x 00137 ); 00138 00143 void sample_stats_d 00144 ( 00145 double* mean_out, 00146 double* var_out, 00147 double* err_out, 00148 const Vector_d* x 00149 ); 00150 00166 void ind_mv_sample_stats_f 00167 ( 00168 Vector_f** means_out, 00169 Vector_f** vars_out, 00170 Vector_f** errs_out, 00171 const Matrix_f* x 00172 ); 00173 00178 void ind_mv_sample_stats_d 00179 ( 00180 Vector_d** means_out, 00181 Vector_d** vars_out, 00182 Vector_d** errs_out, 00183 const Matrix_d* x 00184 ); 00185 00200 void mv_sample_mean_f(Vector_f** mean_out, const Matrix_f* x); 00201 00206 void mv_sample_mean_d(Vector_d** mean_out, const Matrix_d* x); 00207 00222 void mv_sample_covariance_f(Matrix_f** cov_out, const Matrix_f* x); 00223 00228 void mv_sample_covariance_d(Matrix_d** cov_out, const Matrix_d* x); 00229 00245 void mv_sample_stats_f 00246 ( 00247 Vector_f** mean_out, 00248 Matrix_f** cov_out, 00249 const Matrix_f* x 00250 ); 00251 00256 void mv_sample_stats_d 00257 ( 00258 Vector_d** mean_out, 00259 Matrix_d** cov_out, 00260 const Matrix_d* x 00261 ); 00262 00266 #ifdef __cplusplus 00267 } 00268 } 00269 #endif 00270 00271 00272 #endif