Function plotgrad plots the gradient function or its first derivative of a nonparametric mixture.
plotgrad( x, mix, beta, len =500, order =0, col ="blue", col2 ="red", add =FALSE, main = paste0("Class: ", class(x)), xlab = expression(theta), ylab = paste0("Gradient (order = ", order,")"), cex =1, pch =1, lwd =1, xlim, ylim,...)
Arguments
x: a data object of a mixture model class.
mix: an object of class 'disc', for a discrete mixing distribution.
beta: the structural parameter.
len: number of points used to plot the smooth curve.
order: the order of the derivative of the gradient function to be plotted. If 0, it is the gradient function itself.
col: color for the curve.
col2: color for the support points.
add: if FALSE, create a new plot; if TRUE, add the curve and points to the current one.
main, xlab, ylab, cex, pch, lwd, xlim, ylim: arguments for graphical parameters (see par).
...: arguments passed on to function plot.
Details
data must belong to a mixture family, as specified by its class.
The support points are shown on the horizontal line of gradient 0. The vertical lines going downwards at the support points are proportional to the mixing proportions at these points.
Wang, Y. (2007). On fast computation of the non-parametric maximum likelihood estimate of a mixing distribution. Journal of the Royal Statistical Society, Ser. B, 69 , 185-198.
Wang, Y. (2010). Maximum likelihood computation for fitting semiparametric mixture models. Statistics and Computing, 20 , 75-86