public class Adaptive.M extends Discretes.Bounded.M
Mdl
should be enough
for most purposes but here is its class, fully (trivially)
parameterised (M). Also see the
UnParameterised
Model. Note the remarks on
nlLH(ss)
and nlPr_n(n)
.Model.Defaults, Model.Transform
Value.Atomic, Value.Bool, Value.Char, Value.Chars, Value.Cts, Value.Defer, Value.Discrete, Value.Enum, Value.Inc_Or, Value.Int, Value.Lambda, Value.List, Value.Maybe, Value.Option, Value.Real, Value.Scannable, Value.Structured, Value.Triv, Value.Tuple
Constructor and Description |
---|
M(double msg1,
double msg2,
Value sp)
Requires msg1=0, sp=triv; msg2 may be > 0
for fair competition on training data.
|
Modifier and Type | Method and Description |
---|---|
double |
nlLH(Value ss)
The negative log likelihood of data-set 'ds', where
statistics
stats(ds) |
double |
nlPr_n(int n)
The negative log probability of datum int 'n', but pay careful
attention to the remarks on
nlLH(ss) . |
double |
nlPr(Value d)
The negative log probability of Discrete datum 'd', but pay careful
attention to the remarks on
nlLH(ss) . |
int |
random_n()
Not implemented, arguably it is not possible (do not think that
using
random(1) truly gets around this). |
Vector |
random(int n)
Uses
randomSeries() to
sample 'n' random homogeneous Values. |
Series.Discrete |
randomSeries()
Return a
Series.Discrete which is
random and homogeneous: Sample probabilities 'prs[]'
from Dirichlet.M (alpha) and then
repeatedly sample Ints from MultiState.M (prs),
i.e., the Series is random and homogeneous. |
asUPModel, bounds, lwb_n, lwb, random, type, upb_n, upb
pr_n, pr, shifted
asEstimator, m1m2sp, msg, msg1, msg1bits, msg2, msg2bits, msgBits, nl2LH, nl2Pr, statParams, stats, stats, sumNlPr, transform, zeroTriv
public M(double msg1, double msg2, Value sp)
public double nlPr(Value d)
nlLH(ss)
.
?Arguably nlPr(d) should be an Unsupported Operation?nlPr
in class Discretes.M
public double nlPr_n(int n)
nlLH(ss)
.
?Arguably nlPr_n(n) should be an Unsupported Operation?nlPr_n
in class Discretes.M
public double nlLH(Value ss)
public int random_n()
random(1)
truly gets around this).
For a data-set, random(n)
and
randomSeries()
are fine.random_n
in class Discretes.Bounded.M
public Vector random(int n)
randomSeries()
to
sample 'n' random homogeneous Values.random
in class Discretes.Bounded.M
public Series.Discrete randomSeries()
Series.Discrete
which is
random and homogeneous: Sample probabilities 'prs[]'
from Dirichlet.M
(alpha)
and then
repeatedly sample Ints from MultiState.M
(prs),
i.e., the Series is random and homogeneous. Don't forget to
advance()
!randomSeries
in class Discretes.Bounded.M