Description Usage Arguments Value Examples
View source: R/SimNonNormalDist.R
SimMixDist is a support function for generating samples from mixture distribution. The main purpose of this function is to generate samples from non-normal distribution.
1 | SimMixDist(nInv, mean, std, p1, p2)
|
nInv |
is a number of samples the function will generate. |
mean |
is a mean of a normal distribution part of mixture distribution. |
std |
is a standard deviation of a normal distribution part of mixture distribution. |
p1 |
is a ratio of a normal distribution within a mixture distribution. |
p2 |
is a ratio of a Cauchy distribution within a mixture distribution. |
This function returns a list of samples V
generated by a mixture distribution.
1 2 3 4 5 6 7 | # Generate simulation data with 100 samples with a mixture distribution
# The distribution consist of the following distributions:
# 1) 10% of uniform distribution range [-400,400];
# 2) 50% of normal distribution with mean = 40 and std =8; and
# 3) 40% of Cauchy distribution with location= 45 and scale = 2.
V<-SimMixDist(nInv=100,mean=40,std=8,p1=0.1,p2=0.5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.