UQTk: Uncertainty Quantification Toolkit 3.1.5
regression.cpp File Reference

Command-line utility for linear regression. More...

#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <math.h>
#include <assert.h>
#include "Array1D.h"
#include "Array2D.h"
#include "PCSet.h"
#include "lreg.h"
#include <getopt.h>
#include "tools.h"
#include "arraytools.h"
#include "arrayio.h"

Macros

#define XFILE   "xdata.dat"
 default x-file
 
#define YFILE   "ydata.dat"
 default y-file
 
#define BTYPE   "PC"
 default basis type
 
#define METH   "lsq"
 default method
 
#define MSC   "m"
 default flag to output mean (m), mean+std (ms) or mean+std+cov (msc)
 
#define INTPAR   5
 default int parameter
 
#define STRPAR   "LU"
 default string parameter
 
#define MINDEXFILE   "mindex.dat"
 default multiindex file
 
#define ETADEFAULT   1.e-3
 default tolerance for bcs
 

Functions

int usage ()
 Displays information about this program.
 
int main (int argc, char *argv[])
 Main program of linear regression given data.
 

Detailed Description

Command-line utility for linear regression.

Author
K. Sargsyan 2015 -

Macro Definition Documentation

◆ BTYPE

#define BTYPE   "PC"

default basis type

◆ ETADEFAULT

#define ETADEFAULT   1.e-3

default tolerance for bcs

◆ INTPAR

#define INTPAR   5

default int parameter

◆ METH

#define METH   "lsq"

default method

◆ MINDEXFILE

#define MINDEXFILE   "mindex.dat"

default multiindex file

◆ MSC

#define MSC   "m"

default flag to output mean (m), mean+std (ms) or mean+std+cov (msc)

◆ STRPAR

#define STRPAR   "LU"

default string parameter

◆ XFILE

#define XFILE   "xdata.dat"

default x-file

◆ YFILE

#define YFILE   "ydata.dat"

default y-file

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Main program of linear regression given data.

Set the default values

Read the user input

Sanity checks

Print the input information on screen

Read data

Read validation check data, if any

Declare the 'parent' regression object

Go through options, RBF, PC, PC_MI, POL, POL_MI

Initialize regression

Set the regression model

Setup data

Set the regularization parameters

Go through methods, lsq, wbcs

Write out coefficients

Get the data variance

Evaluate at validation points

Print standard error measures for the lsq method

◆ usage()

int usage ( )

Displays information about this program.