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

Definition at line 39 of file statdist.h.
Public Methods | |
| UniformDist (const double a=0.0, const double b=1.0) | |
| UniformDist (const UniformDist &u) | |
| void | display (void) const |
| void | reset (const double a, const double 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 | 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 | |
| double | a_value |
| double | b_value |
| std::string | distname |
|
||||||||||||
|
Definition at line 41 of file statdist.h. References matvec::StatDistBase::distname, and reset().
|
|
|
Definition at line 43 of file statdist.h. References matvec::StatDistBase::distname, and reset().
00043 :StatDistBase() 00044 {distname = "UniformDist";reset(u.a_value,u.b_value);} |
|
|
Implements matvec::StatDistBase. Definition at line 57 of file statdist.h. References a_value, and b_value.
|
|
|
Implements matvec::StatDistBase. Definition at line 46 of file statdist.h. References a_value, b_value, and matvec::StatDistBase::distname.
|
|
|
Implements matvec::StatDistBase. Definition at line 82 of file statdist.cpp. References a_value, and b_value.
|
|
|
Implements matvec::StatDistBase. Definition at line 54 of file statdist.h. References a_value, and b_value.
|
|
|
Implements matvec::StatDistBase. Definition at line 90 of file statdist.cpp. References a_value, and b_value.
|
|
|
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 114 of file statdist.cpp. References a_value, and b_value.
|
|
|
Implements matvec::StatDistBase. Definition at line 99 of file statdist.cpp. References a_value, and b_value.
|
|
|
Implements matvec::StatDistBase. Definition at line 56 of file statdist.h. References a_value, and b_value.
|
|
||||||||||||
|
Definition at line 28 of file statdist.cpp. References a_value, and b_value. Referenced by UniformDist().
|
|
||||||||||||
|
Implements matvec::StatDistBase. Definition at line 75 of file statdist.cpp. References sample().
00076 {
00077 doubleMatrix x(m,n);
00078 sample(x);
00079 return x;
00080 }
|
|
|
Implements matvec::StatDistBase. Definition at line 68 of file statdist.cpp. References sample().
00069 {
00070 Vector<double> x(n);
00071 sample(x);
00072 return x;
00073 }
|
|
|
Implements matvec::StatDistBase. Definition at line 51 of file statdist.h. References a_value, b_value, and matvec::genunf(). Referenced by sample().
|
|
|
Implements matvec::StatDistBase. Definition at line 47 of file statdist.cpp. References a_value, b_value, matvec::Matrix< double >::num_cols(), matvec::Matrix< double >::num_rows(), and matvec::ranf().
00048 {
00049 int nr = x.num_rows();
00050 int nc = x.num_cols();
00051 double *bot,*top;
00052 unsigned i;
00053 if (a_value==0.0 && b_value==1.0) {
00054 for (i=0; i<nr; i++) {
00055 bot = x[i]; top = &bot[nc];
00056 while (bot < top ) *bot++ = ranf();
00057 }
00058 }
00059 else {
00060 double c = b_value-a_value;
00061 for (i=0; i<nr; i++) {
00062 bot = x[i]; top = &bot[nc];
00063 while (bot < top ) *bot++ = a_value + c*ranf();
00064 }
00065 }
00066 }
|
|
|
Implements matvec::StatDistBase. Definition at line 35 of file statdist.cpp. References a_value, b_value, matvec::Vector< T >::begin(), matvec::Vector< T >::end(), and matvec::ranf(). Referenced by matvec::GLMM::residual(), and matvec::GLMM::SSQCP().
|
|
|
Implements matvec::StatDistBase. Definition at line 55 of file statdist.h. References a_value, and b_value.
|
|
|
Definition at line 63 of file statdist.h. Referenced by cdf(), display(), inv(), mean(), mgf(), parameter(), pdf(), reset(), sample(), and variance(). |
|
|
Definition at line 63 of file statdist.h. Referenced by cdf(), display(), inv(), mean(), mgf(), parameter(), pdf(), reset(), sample(), and variance(). |
|
1.2.16