UQTk: Uncertainty Quantification Toolkit  3.1.1
Macros | Functions
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 More...
 
#define YFILE   "ydata.dat"
 default y-file More...
 
#define BTYPE   "PC"
 default basis type More...
 
#define METH   "lsq"
 default method More...
 
#define MSC   "m"
 default flag to output mean (m), mean+std (ms) or mean+std+cov (msc) More...
 
#define INTPAR   5
 default int parameter More...
 
#define STRPAR   "LU"
 default string parameter More...
 
#define MINDEXFILE   "mindex.dat"
 default multiindex file More...
 
#define ETADEFAULT   1.e-3
 default tolerance for bcs More...
 

Functions

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

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.