mercredi 4 mars 2020

R function with inputs

I am creating a model for mixture distribution model. Can anyone help me in creating a function that takes as input two vectors (MU1; MU2) and ((Sigma^2)1; (Sigma^2)2) and a sample size n, and simulates n observations from a mixture of two Normal distributions, N(MU1; (Sigma^2)1) and N((MU1; (Sigma^2)2), with equal probability in R.

I am not sure if I need to initialize an empty vector or not.




Aucun commentaire:

Enregistrer un commentaire