Random Number Generation Using Continous Distributions

Discrete Distributions

The aim of  this lecture is to drawn random population from different discrete distributions. (Error or Omission id Expected). Please provide your comments for the further improvement in codes.

#####################################

Exponential Distribution

rexp(N, m)

For Example

rexp(10,3)

Uniform Distribution 

runif( N, a, b)

For Example

runif(10,2,3)

Random Numbers by Discrete Distributions

Gamma Distribution 

rgamma( N, a, b)

For example

rgamma(10,3,4)

Normal Distribution 

rnorm(N, mu, sigma)

rnorm(10,3,4)

Multivariate Normal Distribution

 sigma=matrix(c(6,3,3,8),2,2)

mu=c(0,1)

mvrnorm(10,mu,sigma);

######################################################

For Simulation codes (Please visit here)


Please write your suggestions in the comment box

Comments

Post a Comment