Description Usage Arguments Value Examples

Simulate a data set, then compute the conditional likelihood matrix under a univariate normal likelihood and a mixture-of-normals prior. This models a simple nonparametric Empirical Bayes method applied to simulated data.

1 | ```
simulatemixdata(n, m, simtype = c("n", "nt"), normalize.rows = TRUE)
``` |

`n` |
Positive integer specifying the number of samples to generate and, consequently, the number of rows of the likelihood matrix L. |

`m` |
Integer 2 or greater specifying the number of mixture components. |

`simtype` |
The type of data to simulate. If |

`normalize.rows` |
If |

`simulatemixdata`

returns a list with three list
elements:

`x` |
The vector of simulated random numbers (it has length n). |

`s` |
The standard deviations of the mixture components in the
mixture-of-normals prior. The rules for selecting the standard
deviations are based on the |

`L` |
The n x m conditional likelihood matrix, in which
individual entries (i,j) of the likelihood matrix are given by the
normal density function with mean zero and variance |

1 2 3 4 | ```
# Generate the likelihood matrix for a data set with 1,000 samples
# and a nonparametric Empirical Bayes model with 20 mixture
# components.
dat <- simulatemixdata(1000,20)
``` |

stephenslab/mixsqp documentation built on Dec. 12, 2018, 12:49 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.