Medial Code Documentation
Loading...
Searching...
No Matches
MedNumeric.h
1// General numeric macros and functions
2
3#ifndef __MED_NUMERIC_H__
4#define __MED_NUMERIC_H__
5
6#include <vector>
7
8using namespace std;
9
10//==========================================================================
11// Simple Fit of parameters to general 1d->1d functions
12//==========================================================================
14 public:
15 int n_params;
16 vector<pair<float,float>> range;
17 vector<float> jump;
18};
19
20double square_dist_for_fit(float (*f_to_fit)(vector<float> &p, float xp), vector<float> &p, vector<float> &x, vector<float> &y, vector<float> &w);
21int full_enumaration_fit(float (*f_to_fit)(vector<float> &p, float xp), MedFitParams &params, vector<float> &x, vector<float> &y, vector<float> &w, vector<float> &res, double &res_err);
22
23// some usefull fitting functions
24float scaled_normal_dist(vector<float> &p, float xp);
25float scaled_skewed_normal_dist(vector<float> &p, float xp);
26float scaled_log_normal_dist(vector<float> &p, float xp);
27float scaled_inv_gauss_dist(vector<float> &p, float xp);
28
29float normal_cdf(float mean, float std, float x);
30float log_normal_cdf(float mean, float std, float x);
31
32int get_normal_dist_quantiles(float mean, float sd, vector<float> &q, vector<float> &qv);
33int get_skewed_normal_dist_quantiles(float mean, float sd, float shape, vector<float> &q, vector<float> &qv);
34int get_log_normal_dist_quantiles(float mean, float sd, vector<float> &q, vector<float> &qv);
35int get_inv_gauss_dist_quantiles(float mean, float sd, vector<float> &q, vector<float> &qv);
36
37#endif
Definition MedNumeric.h:13
Definition StdDeque.h:58