Library: | distribs |
See also: | normalmix normalmixdens normal |
Quantlet: | normalmixselect | |
Description: | chooses among a set of normal mixture example densities |
Usage: | {w,mu,sigma} = normalmixselect({example}) | |
Input: | ||
example | optional string, if omitted, a menu is opened. If the example is set to "Park_Turlach_X", X=1,...,6 or to "Marron_Wand_X", X=1,...,11, the examples from Park and Turlach 1992, Marron and Wand 1992 are selected (without menu); the default is N(0,1), i.e. Marron_Wand_1, Park_Turlach_1 | |
Output: | ||
w | p x 1 vector, weight of the mixture components | |
mu | p x 1 vector, mean of the mixture components | |
sigma | p x 1 vector, standard deviation of the mixture components |
- own examples may be easily added
library("distribs") {w,mu,sigma}=normalmixselect("Marron_Wand_6") w~mu~sigma
shows the parameters of the normal mixture example density "Marron_Wand_6". Contents of _tmp [1,] 1 -1 0.66667 [2,] 1 1 0.66667
library("distribs") library("plot") {w,mu,sigma}=normalmixselect() x=grid(-3,0.1,60) fx=normalmixdens(x,w,mu,sigma) px=setmask(fx,"line") plot(px)
A menu for choosing a normal mixture example is opened and the selected density function is plotted on a grid.