public abstract class UPModel extends Function.Native
UPModel.M
and Model
;
also see Estimator
. Statistical parameters are
not yet set in a UPModel but it holds any common-knowledge,
problem-defining
parameters, and returns a Model when
it is applied
to statistical-parameter(s) sp (or calls
sp2Model
(
msg1
,
msg2
,
sp
)),
and hopefully can also estimate
a
fully parameterised Model
from a given data-set.Normal
,
NormalMu
, Poisson0
,
Geometric0
, and
Multivariate
.UPFunctionModel
and
UPSeriesModel
.Modifier and Type | Class and Description |
---|---|
class |
UPModel.Est
Est, an Estimator that uses information from its enclosing
UnParameterised Model. |
class |
UPModel.M
A fully parameterised Model, M, nested within an UnParameterised
UPModel . |
class |
UPModel.Transform
Transform 'this' UPModel with Function f.
|
Function.Native.WithInverse
Function.Cts2Cts, Function.Cts2Cts2Cts, Function.CtsD2CtsD, Function.HasInverse, Function.Native, Function.Native2, Function.Native3
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
Modifier and Type | Field and Description |
---|---|
protected Value |
dp
The problem-defining parameter(s) of 'this'
UnParameterised Model; see
defnParams() . |
Constructor and Description |
---|
UPModel(Value dp)
Given common-knowledge problem-defining parameter(s), dp,
create an UnParameterised Model.
|
Modifier and Type | Method and Description |
---|---|
Model |
apply(Value sp)
Given statistical parameters, sp, return a Model,
sp2Model(0, 0, sp) ,
i.e., one that is not estimated, having zero part 1 and
part 2 message lengths. |
Value |
defnParams()
Return the common-knowledge, problem-defining parameter(s) for the
fully parameterised
M-Model s that 'this' UPModel
can and will produce. |
Estimator |
estimator(Value ps)
Given parameter(s), 'ps' (possibly parameters of a prior), return an
Estimator for 'this' UPModel.
|
static void |
main(java.lang.String[] argv)
Nothing new here; see
Test . |
abstract Model |
sp2Model(double msg1,
double msg2,
Value sp)
Given two-part message lengths msg1 & msg2, and statistical
parameter sp, return a fully parameterised
M-Model . |
abstract Value |
stats(boolean add,
Value ss0,
Value ss1)
Combine sufficient statisticses 'ss0' and 'ss1' additively
(add=true), or remove ss1 from ss0 (add=false).
|
Value |
stats(boolean add,
Value ss0,
Vector ds,
int lo,
int hi)
Combine statisticses ss0 and
stats(ds,lo,hi) . |
Value |
stats(Vector ds)
Return
stats(ds,0,ds.nElts())
(there is more on stats at the link). |
abstract Value |
stats(Vector ds,
int lo,
int hi)
Return sufficient statistics 'ss' of elements [lo, hi),
lo inclusive to hi exclusive, of data-set ds;
also see
M.stats(...) . |
java.lang.String |
toString()
Return a String representation of 'this' UnParameterised Model,
including its problem-
defining parameters. |
UPModel |
transform(Function f)
transform: (a→b)→UPModel a→UPModel b,
convenience function for 'new
Transform(f) '. |
protected final Value dp
defnParams()
.public UPModel(Value dp)
public Value defnParams()
M-Model
s that 'this' UPModel
can and will produce. This implementation returns dp
.
Also see Model.statParams()
.public Model apply(Value sp)
sp2Model(0, 0, sp)
,
i.e., one that is not estimated, having zero part 1 and
part 2 message lengths. (Also see Function.apply(la.la.Value)
.)apply
in class Function.Native
public Value stats(Vector ds)
stats(ds,0,ds.nElts())
(there is more on stats at the link).
There is unlikely to be any need for a subclass (a UPModel)
to override stats(ds).public abstract Value stats(Vector ds, int lo, int hi)
M.stats(...)
.
A simple option is to just return the elements –
which is sometimes the best that we can do.
Note, this.stats(...) must return statistics that are enough to
estimate
a fully parameterised M-model
,
whereas M.stats(...) must be enough to calculate
M.nlLH(.)
; often these are the same, but not always,
for example, see BestOf.stats(...)
.
In any case, ss = this.stats(ds,lo,hi) must be
compatible with ss2Model(ss)
(as must be
ss' = M.stats(ds,lo,hi)
with M.nlLH(ss')
).
Weighted
data must also be considered.
When defining a new UPModel stats(ds,lo,hi) and
stats(add,ss0,ss1)
are generally what must defined with regard to statistics.
The statistics are not necessarily those used under
maximum likelihood statistics, say, for example, nlAoM is
included for continous Models.public abstract Value stats(boolean add, Value ss0, Value ss1)
stats(ds,lo,hi)
.public Value stats(boolean add, Value ss0, Vector ds, int lo, int hi)
Combine
statisticses ss0 and
stats(ds,lo,hi)
. This allows
advantage to be taken of additive (incremental) statistics,
for example, by Intervals
. There is unlikely to be a need
for a subclass (a UPModel) to override stats(add,ss0,ds,lo,hi).public Estimator estimator(Value ps)
public java.lang.String toString()
defining
parameters.public UPModel transform(Function f)
Transform(f)
'.
Note that Function 'f' must be 1–to–1.
Also see the related but different Model.transform(la.la.Function)
; note
that, as distributions, upm.transform(f)(sp)=upm(sp).transform(f).Continuous.transform(la.la.Function.Cts2Cts)
.public static void main(java.lang.String[] argv)
Test
.