SimMixDist: SimMixDist function

Description Usage Arguments Value Examples

View source: R/SimNonNormalDist.R

Description

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.

Usage

1
SimMixDist(nInv, mean, std, p1, p2)

Arguments

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.

Value

This function returns a list of samples V generated by a mixture distribution.

Examples

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)

EDOIF documentation built on March 28, 2021, 9:11 a.m.