public abstract static class Model.Defaults extends Model
Model
that sets default methods
stats(ds,lo,hi)
,
stats(add,ss0,ss1)
and
nlLH(ss)
, even if they are slow. Only use (extend)
Defaults if you cannot think of anything better, or
you are very lazy.Model.Defaults
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 |
---|
Defaults(double msg1,
double msg2,
Value sp) |
Modifier and Type | Method and Description |
---|---|
double |
nlLH(Value ss)
This default implementation assumes that statistics are the
data themselves and uses
sumNlPr but many
Models can do better. |
Value |
stats(boolean add,
Value ss0,
Value ss1)
statistics
ss0 ± ss1,
'+' if 'add' is true othewise '-'. |
Value |
stats(Vector ds,
int lo,
int hi)
This default returns the data itself,
ds.
slice(lo,hi) , as
statistics but many Models can do much better. |
asEstimator, asGiven, asGiven, asUPModel, m1m2sp, msg, msg1, msg1bits, msg2, msg2bits, msgBits, nl2LH, nl2Pr, nlPr, pr, random, random, randomSeries, statParams, stats, stats, sumNlPr, toString, type, zeroTriv
public Defaults(double msg1, double msg2, Value sp)
public Value stats(Vector ds, int lo, int hi)
slice(lo,hi)
, as
statistics but many Models can do much better.
Note that ss=stats(ds,lo,hi),
stats(add,ss0,ss1)
and
nlLH(ss))
must be consistent.
Also see Model.stats(Vector,int,int)
.public Value stats(boolean add, Value ss0, Value ss1)
statistics
ss0 ± ss1,
'+' if 'add' is true othewise '-'.
This default implementation assumes statistics are the
data themselves but many Models can do better.