#include <statdist.h>
Inheritance diagram for matvec::DiscreteUniformDist:

Definition at line 344 of file statdist.h.
Public Methods | |
| DiscreteUniformDist (const long a, const long b) | |
| DiscreteUniformDist (const DiscreteUniformDist &u) | |
| void | display (void) const |
| void | reset (const long a, const long b) |
| void | sample (Vector< double > &x) const |
| void | sample (doubleMatrix &x) const |
| double | sample (void) const |
| Vector< double > | sample (unsigned n) const |
| doubleMatrix | sample (unsigned m, unsigned n) const |
| double | mean (void) const |
| double | variance (void) const |
| double | pdf (const double x) const |
| double | cdf (const double x) const |
| double | pdf (const long x) const |
| double | cdf (const long x) const |
| double | mgf (const double t) const |
| double | inv (const double p) const |
| double | parameter (const int k) const |
| void | parameter (const int k, const double x) |
| virtual const std::string | name (void) const |
| virtual double | nonct (const double cv, const double p) |
Protected Attributes | |
| long | a_value |
| long | b_value |
| std::string | distname |
|
||||||||||||
|
Definition at line 348 of file statdist.h. References matvec::StatDistBase::distname, and reset().
|
|
|
Definition at line 350 of file statdist.h. References matvec::StatDistBase::distname, and reset().
00350 :StatDistBase() 00351 {distname="DiscreteUniformDist"; 00352 reset(u.a_value,u.b_value);} |
|
|
Definition at line 367 of file statdist.h. References a_value, and b_value.
|
|
|
Implements matvec::StatDistBase. Definition at line 365 of file statdist.h.
00365 {return cdf(long(x));}
|
|
|
Implements matvec::StatDistBase. Definition at line 354 of file statdist.h. References a_value, b_value, and matvec::StatDistBase::distname.
|
|
|
Implements matvec::StatDistBase. Definition at line 370 of file statdist.h.
00371 {std::cerr << " DiscreteUniformDist::inv(): not available\n"; return p;}
|
|
|
Implements matvec::StatDistBase. Definition at line 362 of file statdist.h. References a_value, and b_value.
|
|
|
Implements matvec::StatDistBase. Definition at line 1079 of file statdist.cpp.
01080 {
01081 throw exception("BetaDist::parameter(): bad arg1");
01082 }
01083 }
|
|
|
Definition at line 45 of file statdistbase.h. References matvec::StatDistBase::distname.
00045 {return distname;}
|
|
||||||||||||
|
Definition at line 58 of file statdistbase.h.
00058 {std::cerr << "error\n"; return 0.0;}
|
|
||||||||||||
|
Implements matvec::StatDistBase. Definition at line 1132 of file statdist.cpp.
01133 {
01134 double par = 0.0;
01135 if (k==1) {
01136 par = static_cast<double>(a_value);
01137 }
01138 else if (k==2) {
01139 par = static_cast<double>(b_value);
01140 }
01141 else {
01142 throw exception("DiscreteUniformDist::parameter(): bad arg, 1 or 2 is expected");
01143 }
01144 return par;
01145 }
01146
01147 void DiscreteUniformDist::parameter(const int k, const double x)
01148 {
01149 if (k==1) {
01150 if (x <= b_value) {
01151 a_value = static_cast<long int>(x);
01152 }
01153 else {
|
|
|
Implements matvec::StatDistBase. Definition at line 1117 of file statdist.cpp. References sample().
01119 {
01120 Vector<double> x(n);
01121 sample(x);
01122 return x;
01123 }
01124
01125 doubleMatrix DiscreteUniformDist::sample(unsigned m,unsigned n) const
01126 {
01127 doubleMatrix x(m,n);
01128 sample(x);
01129 return x;
01130 }
|
|
|
Definition at line 366 of file statdist.h. References a_value, and b_value.
|
|
|
Implements matvec::StatDistBase. Definition at line 364 of file statdist.h.
00364 {return pdf(long(x));}
|
|
||||||||||||
|
Definition at line 1072 of file statdist.cpp. References matvec::BetaDist::alpha_value. Referenced by DiscreteUniformDist().
01074 {
01075 beta_value = x;
01076 }
01077 else if (k==3) {
|
|
||||||||||||
|
Implements matvec::StatDistBase. Definition at line 1110 of file statdist.cpp. References a_value, and b_value.
|
|
|
Implements matvec::StatDistBase. Definition at line 1103 of file statdist.cpp. References a_value, and b_value.
01108 {
|
|
|
Implements matvec::StatDistBase. Definition at line 359 of file statdist.h. References a_value, b_value, and matvec::ignuin(). Referenced by parameter().
|
|
|
Implements matvec::StatDistBase. Definition at line 1092 of file statdist.cpp.
01095 {
01096 throw exception("DiscreteUniformDist:mgf(): not available yet");
01097 return 0.0;
01098 }
01099
01100 void DiscreteUniformDist::sample(Vector<double>& x) const
01101 {
|
|
|
Implements matvec::StatDistBase. Definition at line 1085 of file statdist.cpp. References a_value, and b_value.
01088 {
01089 if (a > b) throw exception("DiscreUniformDist::reset(a,b): b must be larger than a");
01090 a_value = a;
|
|
|
Implements matvec::StatDistBase. Definition at line 363 of file statdist.h. References a_value, and b_value.
|
|
|
Definition at line 346 of file statdist.h. Referenced by cdf(), display(), mean(), pdf(), matvec::BinomialDist::reset(), sample(), and variance(). |
|
|
Definition at line 346 of file statdist.h. Referenced by cdf(), display(), mean(), pdf(), matvec::BinomialDist::reset(), sample(), and variance(). |
|
1.2.16