libtpcmodel
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Functions
mestim.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "include/mestim.h"
#include "include/median.h"
Include dependency graph for mestim.c:

Go to the source code of this file.

Functions

double mEstim (double *data, int nr, int iterNr, double cutoff)
double huber (double x, double b)

Function Documentation

double huber ( double  x,
double  b 
)

Hubers function

Returns:
Returns x if |x|<b, and b otherwise.
Parameters:
xparameter x
bcutoff point

Definition at line 96 of file mestim.c.

Referenced by mEstim().

double mEstim ( double *  data,
int  nr,
int  iterNr,
double  cutoff 
)

Fit a constant (horisontal straight line) to the data with M-estimator.

The algorithm is described in the lecture notes of Nonlinear signal processing course of Tampere university of technology http://www.cs.tut.fi/~eeroh/nonlin.html

Returns:
Returns Hubers M-estimator for single dataset.
Parameters:
dataData array
nrNumber of data values
iterNrNumber of iterations
cutoffcutoff point

Definition at line 59 of file mestim.c.

References dmedian(), and huber().

Referenced by test_re().

Here is the call graph for this function: