Description Details References
This documentation gives a detailed description of the npfixedcompR object. This implementation uses the R6 object.
The structure of the object currently has three layers: The foundation layer is the npfixedcompR class, which has components common to all the specific classes; The second layer is the distributional layer, which has components common to all the classes with the same distribution (the npnorm class); The third layer is the specific layer (the npnormll class), which contains components specific to this particular loss. Since the nptll and the npnormcll class only has one loss implemented, they are implemented in the second layer.
For the following, if a component is listed as public, then it can be accessed as needed. If a component is listed as private, then it can not be accessed. There might be functions listed as public can be used to modified the private values.
The component in the npfixedcompR class are as follows.
mu0fixed
(public) : The vector of the locations of fixed support points.
This can be set by initialize
or modified
implemented in the last year.
pi0fixed
(public) : The vector of the weights of fixed support points.
This can be set by initialize
or modified
implemented in the last year.
data
(public) : The observations. The observations can only be set by
makeobject
via initialzed
. Once the object is defined, the observations
can not be modified.
len
(public) : The length of the observations. This is different to the effective
sample size when dealing with the binned version.
result
(public) : The estimated mixing distribution. This is used to store the result
computed by computemixdist
or estpi0
.
methodflag
(public) : This function is used to print or set the algorithm used for
finding the new support points. The default argument is NULL
, which prints the private
component mflag
implemented in the final layer. Other inputs can be d0
, d1
and d2
, which change the algorithm used. The algorithm used should depend on the final layer
(hence mflag
is implemented in the final layer).
checklossfunction
(public) : The function used for Armijo rule; see Wang (2007).
collapsemix
(public) : The function used for collapsing mixing distributions; see cnm
.
compareattr
(public) : The function used for comparing the attributes mu0
and pi0
for performence
purposes. If the geometry of mu0
and pi0
is close to the stored ones, there is no need to recompute
the information related to this pair.
solvegradientmultiple
(public) : The function used for computing the new support points.
This is function calls for solvegradientmultipled0
, solvegradientmultipled1
and
solvegradientmultipled2
according to the private component mflag
. The detailed descriptions
of the algorithms used can be found in Appendix B of the thesis. The break points of the smaller intervals
are computed through printgridpoints
implemented in the distributional layer.
computemixdist
(public) : The function used for computing the mixing distribution given
mu0fixed
and pi0fixd
. The result is stored in result
component.
estpi0d
(public) : The function used for computing the derivative when estimate the null proportion.
This default implementation can be used in the Newton-Raphson method. This is overwritten by the
espti0d in the last layer, which can be used in the Halley method.
solvegradientmultipled0
(private), solvegradientmultipled1
(private) and
solvegradientmultipled2
(private) : The functions for computing the new support points. The underlying
computing functions solvegradientsingled1
and solvegradientsingled2
are vectorised
implementations while solvegradientsingled0
uses the optimize
.
solveestpi0
(private) : The function for computing the null proportion. The algofithm used depends
on estpi0d
. This is essentially the root-finding algorithm and the formulation can be found in
Appendix B of the thesis.
gridpoints
(private) : The break points for the smaller interval when computing the new support
points. This is initialised by printgridpoints
in the distributional layer.
The components in the distributional layer are as follows.
setgridpoints
(public) : The function used to initialise gridpoints
. The range of the
support can be found in Chapter 3 of the thesis.
initpoints
(public) : The function for generating the starting mixing distribution, if not
specified in computemixdist
; see link[nspmix]{npnorm}
for example.
The componets in the final layer are as follows.
beta
(public) : The structural parameter. The structural parameter is always considered as fixed
and can be changed using initisalize
and modified
.
type
(public) : The flag for component distributions.
initialize
(public) : The function for initialising the object for computing. It sets the data,
the length, fixed support points, structural parameter and any precomputed values.
modified
(public) : The function for modifying the object for further computing. It sets the
fixed support points, the structural parameter and any precomputed values related to the change of
the fixed support points.
lossfunction
(public) : THe function for computing the loss function given a mixing distribution.
setflexden
(public) : This function is used to set the precomputed values for performance
purposes.
gradientfunction
(public) : This function computes the gradient for the implemented families.
The output is a list of length 3: The gradient d0
, the first derivative with respect to the location
parameter d1
and the second derivateive with respect to the location parameter d2
.
computeweights
(public) : This function computes the new weights given fixed support points,
which is needed in computemixdist
in the first layer.
estpi0dS
(public) : Generating precomputed values for estimating the null proportion. This is
primarily for performance purposes.
estpi0d
(public) : This function overwrites the function of the same name in the first layer
for a faster computation of the null proportions.
estpi0
(public) : This function computes the null proportions depending on the given loss/distance.
precompute
(private), flexden
(private), S1
(private) : The object for storing the
precomputed values for performance purposes.
Wang, Yong. "On Fast Computation of the Non-Parametric Maximum Likelihood Estimate of a Mixing Distribution." Journal of the Royal Statistical Society. Series B (Statistical Methodology) 69, no. 2 (2007): 185-98. http://www.jstor.org/stable/4623262.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.