|
Revision 944, 0.9 kB
(checked in by smidl, 15 years ago)
|
|
Doc + new examples
|
| Line | |
|---|
| 1 | classdef mexEpdf |
|---|
| 2 | properties |
|---|
| 3 | rv=RV; %empty description add some valid RV when needed |
|---|
| 4 | end |
|---|
| 5 | methods |
|---|
| 6 | function m=mean(p) |
|---|
| 7 | error('define how to compute mean') |
|---|
| 8 | end |
|---|
| 9 | function validate(p) |
|---|
| 10 | error('check if the density is consistent') |
|---|
| 11 | end |
|---|
| 12 | function dim=dimension(p) |
|---|
| 13 | error('return dimension of the density') |
|---|
| 14 | end |
|---|
| 15 | function v=variance(p) |
|---|
| 16 | error('define how to compute mean') |
|---|
| 17 | end |
|---|
| 18 | function l=evallog(p,x) |
|---|
| 19 | error('define how to evaluate log of this density at point x') |
|---|
| 20 | end |
|---|
| 21 | |
|---|
| 22 | %%% default functions -- no need to redefine %%% |
|---|
| 23 | |
|---|
| 24 | function l=evallog_nn(p,x) |
|---|
| 25 | % define how to evaluate non-normalized log of this density at point x |
|---|
| 26 | % makes sense if faster than normalized |
|---|
| 27 | evallog(p,x); |
|---|
| 28 | end |
|---|
| 29 | function r=get_rv(p) |
|---|
| 30 | r=p.rv; |
|---|
| 31 | end |
|---|
| 32 | end |
|---|
| 33 | end |
|---|