Polyfit
fit a polynomial
|
Polynomial data generator. More...
#include <config.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <inttypes.h>
#include <math.h>
#include <jwsc/base/error.h>
#include <jwsc/base/option.h>
#include <jwsc/vector/vector.h>
#include <jwsc/vector/vector_io.h>
#include <jwsc/matrix/matrix.h>
#include <jwsc/matrix/matrix_io.h>
#include <jwsc/matrix/matrix_math.h>
#include <jwsc/prob/pdf.h>
#include <jwsc/prob/mv_pdf.h>
#include <jwsc/stat/regress.h>
Go to the source code of this file.
Defines | |
#define | NUM_OPTS_NO_ARG 2 |
#define | NUM_OPTS_WITH_ARG 9 |
#define | DEFAULT_SEED 289375 |
#define | DEFAULT_SIGMA 1.0f |
#define | DEFAULT_DEGREE 1 |
#define | DEFAULT_NUM_PTS 100 |
#define | DEFAULT_W_MU 0.0 |
#define | DEFAULT_W_SIGMA 0.1 |
#define | DEFAULT_W_MIN -2 |
#define | DEFAULT_W_MAX 2 |
#define | DEFAULT_X_MIN -10 |
#define | DEFAULT_X_MAX 10 |
#define | DEFAULT_OUTLIER 0 |
#define | DEFAULT_OUTLIER_SIGMA 6.0f |
Enumerations | |
enum | { GAUSS = 0, UNIFORM } |
Functions | |
static void | print_usage (void) |
Prints the usage of the program. | |
static Error * | process_help_opt (void) |
Processes the 'help' program options. | |
static Error * | process_version_opt (void) |
Processes the 'version' program options. | |
static Error * | process_seed_opt (Option_arg arg) |
Processes the 'seed' program options. | |
static Error * | process_sigma_opt (Option_arg arg) |
Processes the 'sigma' program options. | |
static Error * | process_degree_opt (Option_arg arg) |
Processes the 'degree' program options. | |
static Error * | process_num_pts_opt (Option_arg arg) |
Processes the 'num-pts' program options. | |
static Error * | process_w_gauss_opt (Option_arg arg) |
Processes the 'w-gauss' program options. | |
static Error * | process_w_uni_opt (Option_arg arg) |
Processes the 'w-uni' program options. | |
static Error * | process_x_range_opt (Option_arg arg) |
Processes the 'x-range' program options. | |
static Error * | process_outlier_opt (Option_arg arg) |
Processes the 'outlier' program options. | |
static Error * | process_outlier_sigma_opt (Option_arg arg) |
Processes the 'outlier-sigma' program options. | |
static void | sample_w (Vector_d **w_out) |
int | main (int argc, const char **argv) |
Main function for the polygen program. | |
Variables | |
static Option_no_arg | opts_no_arg [NUM_OPTS_NO_ARG] |
Program options taking no argument. | |
static Option_with_arg | opts_with_arg [NUM_OPTS_WITH_ARG] |
Program options taking an argument. | |
static uint32_t | seed = DEFAULT_SEED |
Random seed. | |
static float | sigma = DEFAULT_SIGMA |
Sigma for generating points from the polynomial. | |
static uint32_t | degree = DEFAULT_DEGREE |
Degree of the polynomial. | |
static uint32_t | num_pts = DEFAULT_NUM_PTS |
Number of points to generate from the polynomial. | |
static float | w_mu = DEFAULT_W_MU |
Mean value for w. | |
static float | w_sigma = DEFAULT_W_SIGMA |
Standard variation value for w. | |
static float | w_min = DEFAULT_W_MIN |
Minimum value for w. | |
static float | w_max = DEFAULT_W_MAX |
Maximum value for w. | |
static float | x_min = DEFAULT_X_MIN |
Minimum value for x. | |
static float | x_max = DEFAULT_X_MAX |
Maximum value for x. | |
static float | outlier = DEFAULT_OUTLIER |
Percentage of points to generate as outliers. | |
static float | outlier_sigma = DEFAULT_OUTLIER_SIGMA |
Sigma for generating outlier points from the polynomial. | |
static enum { ... } | w_sample_t |
static void print_usage | ( | void | ) | [static] |
static Error* process_help_opt | ( | void | ) | [static] |
static Error* process_version_opt | ( | void | ) | [static] |
static Error* process_seed_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_sigma_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_degree_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_num_pts_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_w_gauss_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_w_uni_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_x_range_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_outlier_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_outlier_sigma_opt | ( | Option_arg | arg | ) | [static] |
int main | ( | int | argc, |
const char ** | argv | ||
) |
Option_no_arg opts_no_arg[NUM_OPTS_NO_ARG] [static] |
Option_with_arg opts_with_arg[NUM_OPTS_WITH_ARG] [static] |
float sigma = DEFAULT_SIGMA [static] |
uint32_t degree = DEFAULT_DEGREE [static] |
uint32_t num_pts = DEFAULT_NUM_PTS [static] |
float w_sigma = DEFAULT_W_SIGMA [static] |
float outlier = DEFAULT_OUTLIER [static] |
float outlier_sigma = DEFAULT_OUTLIER_SIGMA [static] |
enum { ... } w_sample_t [static] |