
#include "estim/particles.h"
#include "math/square_mat.h"
#include "stat/exp_family.h"

using namespace bdm;

//These lines are needed for use of cout and endl
using std::cout;
using std::endl;

int main() {

	RV x ( "1" );
	RV xm = x;
	xm.t_plus ( -1 );
	const
	RV y ( "2" );

	mat A = "1";
	vec vR = "1";
	ldmat R ( vR );

	eEmp emp;
	euni eun;
	eun.set_parameters ( "0", "1" );
	emp.set_statistics ( ones ( 10 ), eun );
	vec &v = emp._w();
	Array<vec> &S = emp._samples();

	for ( int i = 0; i < 10; i++ ) {
		v ( i ) = exp ( -0.5 * sum ( pow ( S ( i ) - 1, 2.0 ) ) * 10 );
	}
	v /= sum ( v );

	cout << "p:" << S << endl;
	cout << "w:" << v << endl;

	ivec ind;
	emp.resample(ind);

	cout << ind << endl;

	//Exit program:
	return 0;

}
