Index: library/matlab/mex/ill_polyfit.m
===================================================================
--- library/matlab/mex/ill_polyfit.m (revision 116)
+++  (revision )
@@ -1,62 +1,0 @@
-% Test example for polynomial regression
-x = 0.1:0.1:1;
-Data = x.^3 - 0.1*x  + 1;
-%DataC = Data+0.02*randn(1,10);
-
-xP = 0:0.01:1.2;
-
-close all
-figure(1);
-%subplot(2,2,1);
-plot(x,DataC,'+');
-set(gca,'XLim',[0,1.4]);
-title('y=x^3-0.1x+1 + 0.1 N(0,1)');
-set(gcf,'Position',[100 100 350 250]);
-set(gcf,'PaperPositionMode','auto');
-print -depsc2 f0
-
-
-ind = 2;
-for n=1:5
-	Pn = polyfit(x,DataC,n);
-	devn = DataC-polyval(Pn,x);
-	Yn = polyval(Pn,xP);
-	
-	%	subplot(2,2,ind);
-	figure
-	ind = ind+1;
-	plot(x,DataC,'+');
-	hold on;
-	plot(xP,Yn);
-	title(['Order=' num2str(n) ', MSE=' num2str(devn*devn'/10)]);
-	set(gcf,'Position',[100 100 350 250]);
-	set(gcf,'PaperPositionMode','auto');
-	eval(['print -depsc2 f' num2str(n)]);
-	close all
-	mse(n) = devn*devn'/10;
-end
-
-for o=1:5
-	D = DataC;
-	for n=1:o
-		D = [D; x.^n];
-	end
-	[th,tll]=arx([D;ones(size(x))]);
-	marll(o) = tll;
-end
-emar = exp(marll);
-figure;
-subplot(1,2,1);
-bar(emar/sum(emar));
-title('Probability of the correct order');
-
-subplot(1,2,2);
-plot(-marll/100);
-hold on
-plot(1:5,mse*10,'r');
-title('Bayes factor and MSE')
-
-set(gcf,'Position',[100 100 600 250]);
-set(gcf,'PaperPositionMode','auto');
-
-print -depsc2 prob
Index: library/matlab/mex/sumitpp.cpp
===================================================================
--- library/matlab/mex/sumitpp.cpp (revision 116)
+++  (revision )
@@ -1,28 +1,0 @@
-#include <itpp/itcomm.h>
-#include <itpp/itmex.h>
-
-#include <../../bdm/estim/arx.h>
-
-using namespace itpp;
-
-void mexFunction ( int n_output, mxArray *output[], int n_input, const mxArray *input[] ) {
-	// Check the number of inputs and output arguments
-	if ( n_output!=1 ) mexErrMsgTxt ( "Wrong number of output variables!" );
-	if ( n_input!=1 ) mexErrMsgTxt ( "Wrong number of input variables!" );
-
-	// Convert input variables to IT++ format
-	mat Data = mxArray2mat ( input[0] );
-	vec mn;
-	// ------------------ Start of routine ---------------------------
-	
-	mn = sum(Data);
-	
-	
-	// ------------------ End of routine -----------------------------
-
-	// Create output vectors
-	output[0] = mxCreateDoubleMatrix ( 1,mn.length(), mxREAL );
-
-	// Convert the IT++ format to Matlab format for output
-	vec2mxArray ( mn, output[0] );
-}
Index: library/matlab/mex/arx.cpp
===================================================================
--- library/matlab/mex/arx.cpp (revision 116)
+++  (revision )
@@ -1,47 +1,0 @@
-#include <itpp/itcomm.h>
-#include <itpp/itmex.h>
-
-#include "../../bdm/estim/arx.h"
-
-using namespace itpp;
-
-void mexFunction ( int n_output, mxArray *output[], int n_input, const mxArray *input[] ) {
-	// Check the number of inputs and output arguments
-	if ( n_output<1 ) mexErrMsgTxt ( "Wrong number of output variables!" );
-	if ( n_input!=1 ) mexErrMsgTxt ( "Wrong number of input variables!" );
-
-	// Convert input variables to IT++ format
-	mat Data = mxArray2mat ( input[0] );
-
-	// ------------------ Start of routine ---------------------------
-	int ndat=Data.cols();
-	int npsi=Data.rows();
-	RV thr ( "1","{ theta_r }",vec_1 ( npsi ),vec_1 ( 0 ) );
-
-	mat V0=1e-8*eye ( npsi ); V0 ( 0,0 ) *=100.0;
-	double nu0=npsi;
-	ARX Ar ( thr,V0,nu0 );
-	// estimate
-	for (int i=0;i<ndat;i++ ) {Ar.bayes ( Data.get_col ( i ) );	}
-
-	vec th = Ar._epdf().mean();
-
-	// ------------------ End of routine -----------------------------
-
-	// Create output vectors
-	output[0] = mxCreateDoubleMatrix ( 1,th.length(), mxREAL );
-	// Convert the IT++ format to Matlab format for output
-	vec2mxArray ( th, output[0] );
-
-	if ( n_output>1 ) {
-		double ll=Ar._tll();
-		output[1] = mxCreateDoubleMatrix ( 1,1, mxREAL );
-		double2mxArray ( ll, output[1] );
-	}
-	
-	if ( n_output>2 ) {
-		ivec str = Ar.structure_est ( egiw ( thr,V0,nu0 ) );
-		output[2] = mxCreateDoubleMatrix ( 1,str.length(), mxREAL );
-		ivec2mxArray ( str, output[2] );
-	}
-}
Index: library/matlab/mex/linefit.cpp
===================================================================
--- library/matlab/mex/linefit.cpp (revision 133)
+++  (revision )
@@ -1,74 +1,0 @@
-#include <itpp/itmex.h>
-
-#include "../../bdm/estim/arx.h"
-
-using namespace itpp;
-
-void mexFunction ( int n_output, mxArray *output[], int n_input, const mxArray *input[] ) {
-	// Check the number of inputs and output arguments
-	if ( n_output<1 ) mexErrMsgTxt ( "Wrong number of output variables!" );
-	if ( n_input!=3 ) mexErrMsgTxt ( "Wrong number of input variables!" );
-
-	// Convert input variables to IT++ format
-	mat Data = mxArray2mat ( input[0] );
-	if (Data.rows()!=2)
-		{ if (Data.cols()==2) Data=Data.T(); else mexErrMsgTxt("Data are not 2D!");}
-	int ilow = mxArray2int ( input[1] );
-	int ihi = mxArray2int ( input[2] );
-
-	// ------------------ Start of routine ---------------------------
-	int ndat=Data.cols();
-	int npsi=Data.rows()+1; //add a constant
-	RV thr ( "1","{ theta_r }",vec_1 ( npsi ),vec_1 ( 0 ) );
-
-	mat V0=1e-8*eye ( npsi ); V0 ( 0,0 ) =10.0;
-	vec rgr(npsi);
-	double nu0=npsi+2;
-	// fitting a linear part => third coef is "1"
-	rgr(2) = 1.0;
-
-	// AR model
-	ARX Ar ( thr,V0,nu0 );
-	// start at i0
-	bool gohi=true; bool golow=true;
-	// certain period 
-	for (int i=ilow;i<ihi;i++){
-		rgr.set_subvector(0,Data.get_col ( i ));
-		Ar.bayes ( rgr );
-	}
-	double tll=Ar._tll();
-	// go hi
-	do {
-		rgr.set_subvector(0,Data.get_col ( ++ihi ));
-		Ar.bayes (rgr);
-		if (Ar._tll()>tll) tll=Ar._tll();
-		else gohi=false;
-	} while (gohi);
-	// go low
-	do { 
-		rgr.set_subvector(0,Data.get_col ( --ilow ));
-		Ar.bayes (rgr);
-		if (Ar._tll()>tll) tll=Ar._tll();
-		else golow=false;
-	} while (golow);
-
-	vec th = Ar._epdf().mean();
-
-
-	// ------------------ End of routine -----------------------------
-
-	// Create output vectors
-	output[0] = mxCreateDoubleMatrix ( 1,th.length(), mxREAL );
-	// Convert the IT++ format to Matlab format for output
-	vec2mxArray ( th, output[0] );
-
-	if ( n_output>1 ) {
-		output[1] = mxCreateDoubleMatrix ( 1,1, mxREAL );
-		double2mxArray ( ilow, output[1] );
-	}
-	if ( n_output>1 ) {
-		output[2] = mxCreateDoubleMatrix ( 1,1, mxREAL );
-		double2mxArray ( ihi, output[2] );
-	}
-	
-}
Index: library/matlab/mex/arx_c.cpp
===================================================================
--- library/matlab/mex/arx_c.cpp (revision 116)
+++  (revision )
@@ -1,33 +1,0 @@
-#include "../../bdm/estim/arx.h"
-
-using namespace itpp;
-
-int main() {
-	it_file itf("DD");
-	// Convert input variables to IT++ format
-	mat Data;
-	itf >> Name("DD") >> Data;
-
-	// ------------------ Start of routine ---------------------------
-	int ndat=Data.cols();
-	int npsi=Data.rows();
-	RV thr ( "1","{ theta_r }",vec_1 ( npsi ),vec_1 ( 0 ) );
-
-	mat V0=1e-8*eye ( npsi ); //V0 ( 0,0 ) *=1.0;
-	double nu0=3;
-	ARX Ar ( thr,V0,nu0 );
-	// estimate
-	for (int i=0;i<ndat;i++ ) {Ar.bayes ( Data.get_col ( i ) );	}
-
-	vec th = Ar._epdf().mean();
-
-	// ------------------ End of routine -----------------------------
-
-	cout << th <<endl;
-
-		double ll=Ar._ll();
-	cout << ll <<endl;
-	
-		ivec str = Ar.structure_est ( egiw ( thr,V0,nu0 ) );
-	cout <<	str <<endl;
-}
Index: library/matlab/mex/linefit2.cpp
===================================================================
--- library/matlab/mex/linefit2.cpp (revision 135)
+++  (revision )
@@ -1,85 +1,0 @@
-#include <itpp/itmex.h>
-
-#include "../../bdm/estim/arx.h"
-
-using namespace itpp;
-
-void mexFunction ( int n_output, mxArray *output[], int n_input, const mxArray *input[] ) {
-	// Check the number of inputs and output arguments
-	if ( n_output<1 ) mexErrMsgTxt ( "Wrong number of output variables!" );
-	if ( n_input!=3 ) mexErrMsgTxt ( "Wrong number of input variables!" );
-
-	// Convert input variables to IT++ format
-	mat Data = mxArray2mat ( input[0] );
-	if ( Data.rows() !=2 )
-		{ if ( Data.cols() ==2 ) Data=Data.T(); else mexErrMsgTxt ( "Data are not 2D!" );}
-	int ilow = mxArray2int ( input[1] )-1;
-	int ihi = mxArray2int ( input[2] )-1; //coreection for different indeces
-
-	// ------------------ Start of routine ---------------------------
-	// ------------------ Start of routine ---------------------------
-	int ndat=Data.cols();
-	int npsi=Data.rows() +1; //add a constant
-	RV thr ( "1","{ theta_r }",vec_1 ( npsi ),vec_1 ( 0 ) );
-
-	mat V0=1e-8*eye ( npsi ); V0 ( 0,0 ) =1e-4;
-	vec rgr ( npsi );
-	double nu0=0.1;
-	// fitting a linear part => third coef is "1"
-	rgr ( 2 ) = 1.0;
-
-	// RESULTS
-	mat Tlls=zeros ( ihi+1,ihi+1);
-	// AR model
-	ARX Ar ( thr,V0,nu0 );
-
-	//Initialize
-	for ( int i=ilow+2; i<ihi-2; i++ ) {
-		rgr.set_subvector ( 0,Data.get_col ( i ) );
-		Ar.bayes ( rgr );
-	}
-	// FLATTEN
-/*	Ar.get_parameters ( V0,nu0 );
-	V0 *=1.0/nu0/10000.; // same flattening factor as for nu0
-	nu0=1./10000.;*/
- 	Ar.set_parameters ( V0,nu0 );
-
-	for ( int i=ilow; i<=ihi; i++ ) {
-		Ar.set_parameters ( V0,nu0 );
-		for ( int t=i; t<=ihi; t++ ) {
-			rgr.set_subvector ( 0,Data.get_col ( t ) );
-			Ar.bayes ( rgr );
-			Tlls ( i,t ) =Ar._tll();
-		}
-	}
-
-	max_index ( Tlls,ilow,ihi );
-
-	// ------------------ End of routine -----------------------------
-
-	output[0] = mxCreateDoubleMatrix ( 2,1, mxREAL );
-	ivec2mxArray ( vec_2 ( ilow+1,ihi+1 ) , output[0] );
-
-	if ( n_output>1 ) {
-		// Create output vectors
-		output[1] = mxCreateDoubleMatrix ( Tlls.rows(),Tlls.cols(), mxREAL );
-		// Convert the IT++ format to Matlab format for output
-		mat2mxArray ( Tlls, output[1] );
-	}
-
-	if ( n_output>2 ) {
-		Ar.set_parameters ( V0,nu0 );
-		// Redo Ar for given points
-		for ( int i=ilow; i<=ihi; i++ ) {
-			rgr.set_subvector ( 0,Data.get_col ( i ) );
- 			Ar.bayes ( rgr );
-		}
-
-		// Create output vectors
-		output[2] = mxCreateDoubleMatrix ( 3,1, mxREAL );
-		// Convert the IT++ format to Matlab format for output
-//		mat2mxArray ( Ar._epdf().mean(), output[2] );
-		mat2mxArray ( Ar._epdf().mean(), output[2] );
-	}
-
-}
