Changeset 1068 for library/bdm/stat/exp_family.h
- Timestamp:
- 06/09/10 18:35:14 (14 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/stat/exp_family.h
r1066 r1068 124 124 }; 125 125 126 /*! Dirac delta density with predefined transformation126 /*! \brief Dirac delta density with predefined transformation 127 127 128 128 Density of the type:\f[ f(x_t | y_t) = \delta (x_t - g(y_t)) \f] … … 141 141 return std::numeric_limits< double >::max(); 142 142 } 143 144 /*! Create object from the following structure 145 146 \code 147 class = 'mgdirac'; 148 g = function bdm::fnc; % any offspring of fnc, bdm::fnc::from_setting 149 --- inherited fields --- 150 bdm::pdf::from_setting 151 \endcode 152 */ 143 153 void from_setting(const Setting& set); 144 154 void to_setting(Setting &set) const; … … 666 676 UIREGISTER ( eBeta ); 667 677 668 /*! Random Walk on Dirichlet 678 /*! \brief Random Walk on Dirichlet 679 669 680 Using simple assignment 670 681 \f[ \beta = rvc / k + \beta_c \f] … … 676 687 By default is it set to 0.1; 677 688 */ 678 679 689 class mDirich: public pdf_internal<eDirich> { 680 690 protected: … … 690 700 _beta = val / k + betac; 691 701 }; 692 /*! Create Dirichlet random walk 693 \f[ f(rv|rvc) = Di(rvc*k) \f] 694 from structure 702 703 /*! Create object from the following structure 695 704 \code 696 705 class = 'mDirich'; 697 k = 1; //multiplicative constant k706 k = 1; % multiplicative constant k 698 707 --- optional --- 699 rv = RV({'name'},size) // description of RV 700 beta0 = []; // initial value of beta 701 betac = []; // initial value of beta 708 beta0 = [...]; % initial values of beta 709 betac = [...]; % initial values of beta stabilizing coefficients 710 --- inherited fields --- 711 bdm::pdf::from_setting 712 \endcode 713 fulfilling form \f[ f(rv|rvc) = Di(rvc*k) \f] 714 715 If the optional fields are not given, they will be filled as follows: 716 \code 717 beta0 = [1,1,1,...]; 718 betac = 0.1 * [1,1,1,...]; 702 719 \endcode 703 720 */ … … 709 726 710 727 /*! \brief Random Walk with vector Beta distribution 728 711 729 Using simple assignment 712 730 \f{eqnarray*} … … 733 751 }; 734 752 735 /*! Create Beta random walk 736 \f[ f(rv|rvc) = \prod Beta(rvc,k) \f] 737 from structure 753 /*! Create object from the following structure 738 754 \code 739 755 class = 'mBeta'; 740 k = 1; // multiplicative constant k 741 --- optional --- 742 rv = RV({'name'},size) // description of RV 743 beta = []; // initial value of beta 744 betac = []; // initial value of beta stabilizing constant 756 k = [...]; % vector of multiplicative constants k 757 --- optional fields --- 758 beta = [...]; % initial values of beta 759 betac = [...]; % initial values of beta stabilizing constants 760 --- inherited fields --- 761 bdm::pdf::from_setting 745 762 \endcode 763 fulfilling form \f[ f(rv|rvc) = \prod Beta(rvc,k) \f] 764 765 If the optional fields are not given, they will be filled as follows: 766 \code 767 beta = [1,1,1,...]; 768 betac = 0.1 * [1,1,1,...]; 769 \endcode 770 746 771 */ 747 772 void from_setting ( const Setting &set ); … … 928 953 */ 929 954 930 //! Uniform distributed density on a rectangular support 931 955 //! \brief Uniform distributed density on a rectangular support 932 956 class euni: public epdf { 933 957 protected: … … 976 1000 return ( pow ( high, 2 ) + pow ( low, 2 ) + elem_mult ( high, low ) ) / 3.0; 977 1001 } 978 /*! Create Uniform density 979 \f[ f(rv) = U(low,high) \f] 980 fromstructure1002 1003 1004 /*! Create object from the following structure 981 1005 \code 1006 982 1007 class = 'euni' 983 high = [...]; // vector of upper bounds 984 low = [...]; // vector of lower bounds 985 rv = RV({'name'}); // description of RV 1008 high = [...]; % vector of upper bounds 1009 low = [...]; % vector of lower bounds 1010 rv = RV({'names',...},[sizes,...],[times,...]); % description of RV 1011 --- inherited fields --- 1012 bdm::epdf::from_setting 986 1013 \endcode 1014 1015 fulfilling form \f[ f(rv) = U(low,high) \f] 987 1016 */ 988 1017 void from_setting ( const Setting &set ); … … 1003 1032 iepdf.set_parameters ( mea - delta, mea + delta ); 1004 1033 } 1005 //! load from 1034 1035 /*! Create object from the following structure 1036 \code 1037 class = 'mguni'; 1038 mean = function bdm::fnc; % any offspring of fnc, bdm::fnc::from_setting 1039 delta = [...]; % distance from mean to both sides 1040 --- inherited fields --- 1041 bdm::pdf::from_setting 1042 \endcode 1043 */ 1006 1044 void from_setting ( const Setting &set ) { 1007 1045 pdf::from_setting ( set ); //reads rv and rvc … … 1204 1242 1205 1243 1206 /*! (Approximate) Student t density with linear function of mean value1244 /*! \brief (Approximate) Student t density with linear function of mean value 1207 1245 1208 1246 The internal epdf of this class is of the type of a Gaussian (enorm). … … 1271 1309 _beta = k / val; 1272 1310 }; 1273 /*! Create Gamma density with conditional mean value 1274 \f[ f(rv|rvc) = \Gamma(k, k/rvc) \f] 1275 from structure 1311 1312 /*! Create object from the following structure 1276 1313 \code 1277 class = 'mgamma'; 1278 beta = [...]; // vector of initial alpha 1279 k = 1.1; // multiplicative constant k 1280 rv = RV({'name'}) // description of RV 1281 rvc = RV({'name'}) // description of RV in condition 1282 \endcode 1314 class = 'mgamma'; 1315 beta = [...]; % vector of initial beta 1316 k = x; % multiplicative scalar constant k 1317 --- inherited fields --- 1318 bdm::pdf::from_setting 1319 \endcode 1320 fulfilling form \f[ f(rv|rvc) = \Gamma(k, k/rvc) \f] 1283 1321 */ 1284 1322 void from_setting ( const Setting &set ); … … 1340 1378 }; 1341 1379 }; 1342 1343 1380 1344 1381 /*! … … 1369 1406 }; 1370 1407 1371 void 1408 void validate () { 1372 1409 mgamma::validate(); 1373 1410 dimc = dimension(); … … 1420 1457 }; 1421 1458 1422 1423 /*! Create inverse-Gamma density with conditional mean value 1424 \f[ f(rv|rvc) = i\Gamma(k, k/(rvc^l \circ ref^{(1-l)}) \f] 1425 from structure 1459 /*! Create object from the following structure 1426 1460 \code 1427 1461 class = 'migamma_ref'; 1428 ref = [ 1e-5; 1e-5; 1e-2 1e-3]; //reference vector1429 l = 0.999; // constantl1430 k = 0.1; // constant k1431 rv = RV({'name'}) // description of RV1432 rvc = RV({'name'}) // description of RV in condition1462 ref = [...]; % reference vector 1463 l = []; % constant scalar l 1464 k = []; % constant scalar k 1465 --- inherited fields --- 1466 bdm::migamma::from_setting 1433 1467 \endcode 1468 fulfilling form \f[ f(rv|rvc) = i\Gamma(k, k/(rvc^l \circ ref^{(1-l)}) \f] 1434 1469 */ 1435 1470 void from_setting ( const Setting &set ); … … 1442 1477 SHAREDPTR ( migamma_ref ); 1443 1478 1444 /*! Log-Normal probability density 1445 only allow diagonal covariances! 1479 /*! \brief Log-Normal probability density - it allows only diagonal covariances! 1446 1480 1447 1481 Density of the form \f$ \log(x)\sim \mathcal{N}(\mu,\sigma^2) \f$ , i.e. … … 1499 1533 }; 1500 1534 1501 /*! Create logNormal random Walk 1502 \f[ f(rv|rvc) = log\mathcal{N}( \log(rvc)-0.5\log(k^2+1), k I) \f] 1503 from structure 1535 /*! Create object from the following structure 1504 1536 \code 1505 1537 class = 'mlognorm'; 1506 k = 0.1; //"variance" k1507 mu0 = 0.1; // Initial value of mean1508 rv = RV({'name'}) // description of RV1509 rvc = RV({'name'}) // description of RV in condition1538 k = []; % "variance" k 1539 mu0 = []; % initial value of mean 1540 --- inherited fields --- 1541 bdm::pdf_internal<elognorm>::from_setting 1510 1542 \endcode 1543 fulfilling form \f[ f(rv|rvc) = log\mathcal{N}( \log(rvc)-0.5\log(k^2+1), k I) \f] 1511 1544 */ 1512 1545 void from_setting ( const Setting &set ); … … 1518 1551 SHAREDPTR ( mlognorm ); 1519 1552 1520 /*! inverse Wishart density defined on Choleski decomposition 1521 1553 /*! \brief Inverse Wishart density defined on Choleski decomposition 1522 1554 */ 1523 1555 class eWishartCh : public epdf {