Index: library/bdm/math/square_mat.h
===================================================================
--- library/bdm/math/square_mat.h (revision 766)
+++ library/bdm/math/square_mat.h (revision 1015)
@@ -307,12 +307,23 @@
 	}
 
-	//! Access functions
-	const vec& _D() const {
-		return D;
-	}
-	//! Access functions
-	const mat& _L() const {
-		return L;
-	}
+//! Access functions
+const vec& _D() const {
+	return D;
+}
+//! Access functions
+const mat& _L() const {
+	return L;
+}
+//! Access functions
+vec& __D() {
+	return D;
+}
+//! Access functions
+mat& __L() {
+	return L;
+}
+void validate(){
+	dim= L.rows();
+}
 
 	//! add another ldmat matrix
Index: library/bdm/base/user_info.h
===================================================================
--- library/bdm/base/user_info.h (revision 959)
+++ library/bdm/base/user_info.h (revision 1015)
@@ -25,4 +25,6 @@
 #include "../shared_ptr.h"
 #include "itpp/itbase.h"
+#include "../math/square_mat.h"
+#include "../math/chmat.h"
 
 using std::string;
@@ -302,4 +304,6 @@
 	//! This method converts a Setting into a matrix
 	static void from_setting ( mat& matrix, const Setting &element );
+	//! This method converts a Setting into a ldmat
+	static void from_setting ( ldmat& matrix, const Setting &element );
 	//! This method converts a Setting into an integer vector
 	static void from_setting ( ivec &vector, const Setting &element );
@@ -550,5 +554,8 @@
 	//! A matrix(of type mat) is stored in the new child Setting appended to the passed element
 	static void save ( const mat &matrix, Setting &element, const string &name = "" );
-
+	
+	//! A matrix(of type mat) is stored in the new child Setting appended to the passed element
+	static void save ( const ldmat &matrix, Setting &element, const string &name = "" );
+	
 	//! An integer vector (of type ivec) is stored in the new child Setting appended to the passed element
 	static void save ( const ivec &vec, Setting &element, const string &name = "" );
Index: library/bdm/base/user_info.cpp
===================================================================
--- library/bdm/base/user_info.cpp (revision 959)
+++ library/bdm/base/user_info.cpp (revision 1015)
@@ -257,4 +257,12 @@
 			new_field = matrix ( i, j );
 		}
+}
+
+void UI::save ( const ldmat &matrix, Setting &element, const string &name ) {
+	Setting &set = ( name == "" ) ? element.add ( Setting::TypeGroup)
+	: element.add ( name, Setting::TypeGroup );
+	
+	save (matrix._L(), set, "L");
+	save (matrix._D(), set, "D");
 }
 
@@ -371,4 +379,14 @@
 }
 
+void UI::from_setting ( ldmat& matrix, const Setting &element ) {
+	if(element.exists("L")){
+		UI::from_setting(matrix.__L(), element["L"]);
+	}
+	if(element.exists("D")){
+		UI::from_setting(matrix.__D(), element["D"]);
+	}
+	matrix.validate();
+}
+
 void UI::from_setting ( vec &vector, const Setting &element ) {
 	const SettingResolver link ( element );
Index: library/bdm/stat/exp_family.h
===================================================================
--- library/bdm/stat/exp_family.h (revision 1013)
+++ library/bdm/stat/exp_family.h (revision 1015)
@@ -443,12 +443,13 @@
 	\code
 	class = 'egiw';
-	V     = [];               // square matrix
-	dV    = [];               // vector of diagonal of V (when V not given)
-	nu    = [];               // scalar \nu ((almost) degrees of freedom)
+	V.L     = [];             // L part of matrix V
+	V.D     = [];             // D part of matrix V
+	-or- V  = []              // full matrix V
+	-or- dV = [];               // vector of diagonal of V (when V not given)
+	nu      = [];               // scalar \nu ((almost) degrees of freedom)
 							  // when missing, it will be computed to obtain proper pdf
-	dimx  = [];               // dimension of the wishart part
+	dimx    = [];               // dimension of the wishart part
 	rv = RV({'name'})         // description of RV
 	rvc = RV({'name'})        // description of RV in condition
-	log_level = 'tri';		  // set the level of logged details
 	\endcode
 
Index: library/bdm/stat/exp_family.cpp
===================================================================
--- library/bdm/stat/exp_family.cpp (revision 1013)
+++ library/bdm/stat/exp_family.cpp (revision 1015)
@@ -20,6 +20,5 @@
 void egiw::set_parameters ( int dimx0, ldmat V0, double nu0 ) {
 	dimx = dimx0;
-	nPsi = V0.rows() - dimx;
-
+	nPsi = V0.rows()-dimx;
 	V = V0;
 	if ( nu0 < 0 ) {
@@ -323,12 +322,14 @@
 			nu = -1;
 		}
-		mat V;
-		if ( !UI::get ( V, set, "V", UI::optional ) ) {
-			vec dV;
-			UI::get ( dV, set, "dV", UI::compulsory );
-			set_parameters ( dimx, ldmat ( dV ), nu );
-
-		} else {
-			set_parameters ( dimx, V, nu );
+		mat Vful;
+		if (!UI::get(V, set, "V", UI::optional)){
+			if ( !UI::get ( Vful, set, "V", UI::optional ) ) {
+				vec dV;
+				UI::get ( dV, set, "dV", UI::compulsory );
+				set_parameters ( dimx, ldmat ( dV ), nu );
+
+			} else {
+				set_parameters ( dimx, Vful, nu );
+			}
 		}
 	}
@@ -337,5 +338,5 @@
 		epdf::to_setting ( set );
 		UI::save ( dimx, set, "dimx" );
-		UI::save ( V.to_mat(), set, "V" );
+		UI::save ( V, set, "V" );
 		UI::save ( nu, set, "nu" );
 	};
@@ -343,5 +344,11 @@
 void egiw::validate() {
 	eEF::validate();
+	nPsi = V.rows() - dimx;
 	dim = dimx * ( dimx + nPsi ); 	
+	
+	if ( nu < 0 ) {
+		nu = 0.1 + nPsi + 2 * dimx + 2; // +2 assures finite expected value of R
+		// terms before that are sufficient for finite normalization
+	}
 	
 	    // check sizes, rvs etc.
