public class NormalUPM extends Continuous
MML.Normal
and NormalUPM.M
should
be enough, with little need to call upon NormalUPM directly?Modifier and Type | Class and Description |
---|---|
class |
NormalUPM.Est
The standard Estimator for a Normal Model with unknown
μ and σ.
|
class |
NormalUPM.M
NormalUPM.M, a fully parameterised Normal Model
(Gaussian probability distribution), Nμ,σ.
|
Continuous.Bounded, Continuous.Transform, Continuous.Uniform
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 | Constructor and Description |
---|---|
protected |
NormalUPM()
A constructor for any subclass of NormalUPM that deals with its
own problem-defining parameter(s), e.g.,
NormalMu . |
|
NormalUPM(Value t)
Constructor for UnParameterised Normal Models; note t=triv!
There is little need to call it -- use the previously
prepared
Normal . |
Modifier and Type | Method and Description |
---|---|
NormalUPM.M |
apply(Value ms)
apply((μ, σ)), return
a fully parameterised Normal
M Model . |
UPModel.Est |
estimator(Value ps)
Return an Estimator for the Normal distribution where parameter
|
UPModel.Est |
estimatorB(Value bounds)
Return an Estimator for the Normal distribution where parameter
nearly 1/σ and is unbounded. |
static Value.Cts |
estSigma(Value ss,
double k,
double mu,
double sigma1)
estSigma is called upon by
NormalUPM.
estimatorB and also by
NormalMu.estimatorB to estimate σ. |
NormalUPM.M |
sp2Model(double m1,
double m2,
Value mu_sig)
Given (msg1, msg2, (μ, σ)) return
a fully parameterised Normal
M Model . |
static Vector |
ss(Vector ds,
int lo,
int hi)
Given a data-set, ds, return its sufficient statistics, ss,
that is
|
Vector |
stats(boolean add,
Value ss0,
Value ss1)
Combine sufficient statisticses 'ss0' and 'ss1' additively
(add=true), or remove ss1 from ss0 (add=false).
|
Vector |
stats(Vector ds,
int lo,
int hi)
Return the sufficient statistics of data-set ds;
calls
ss(la.maths.Vector, int, int) (ds). |
java.lang.String |
toString()
Return a String representation of 'this' UnParameterised Model,
including its problem-
defining parameters. |
transform
public NormalUPM(Value t)
Normal
.protected NormalUPM()
NormalMu
.
Note '( )', no problem defining parameter seen here.public NormalUPM.M apply(Value ms)
M Model
.public NormalUPM.M sp2Model(double m1, double m2, Value mu_sig)
M Model
.sp2Model
in class Continuous
public Vector stats(Vector ds, int lo, int hi)
ss(la.maths.Vector, int, int)
(ds).
More on stats here
.public Vector stats(boolean add, Value ss0, Value ss1)
UPModel
stats(ds,lo,hi)
.public static Vector ss(Vector ds, int lo, int hi)
stats(ds)
, and
elsewhere. (Beware of possible numerical stability problems
if the data-set ds is huge.)public UPModel.Est estimator(Value ps)
public UPModel.Est estimatorB(Value bounds)
nearly 1/σ
and is unbounded.
This estimator requires minimal user input (parameter 'bounds').
It should not "blow up" even on zero data. It tries to behave
well in most situations. On the other hand if you do need more
control, implement another estimator. The Estimator calls
estSigma(la.la.Value, double, double, double)
to estimate σ.
Also see estimator((,,,))
.public static Value.Cts estSigma(Value ss, double k, double mu, double sigma1)
estimatorB
and also by
NormalMu.estimatorB
to estimate σ.
That is why estSigma is here and static. Note, k is
the appropriate lattice constant for two or one parameters.
The returned value may not be less than 2× the per-datum AoM.
If the number of data is ≤1, sigma1 is returned.