rmixnorm: Draw from a mixture of normals.

Description Usage Arguments Details Value

View source: R/ash_wrap.R

Description

Draw from a mean zero mixture of normals given mixing proportions, mixing standard deviations, and mixing means.

Usage

1
rmixnorm(n, pi_vals, sd_seq, mean_seq = rep(0, length(pi_vals)))

Arguments

n

An integer. The number of samples to draw.

pi_vals

A vector length M. The mixing proportions.

sd_seq

A vector of length M. The mixing standard deviations.

mean_seq

A vector of length M. The mixing means.

Details

Given mixing proportions pi_vals, and mixing standard deviations (not variances) sd_seq, this function will draw p samples from the mean zero mixture of normals.

Value

A vector of length p that are drawn from the mean zero mixture of normals.


dcgerard/vicar documentation built on July 7, 2021, 1:08 p.m.