Posts Tagged ‘ simulation ’

Simulate correlations by using the Wishart distribution

October 11, 2017
By
Simulate correlations by using the Wishart distribution

The article "Fisher's transformation of the correlation coefficient" featured a Monte Carlo simulation that generated sample correlations from bivariate normal data. The simulation used three steps: Simulate B samples of size N from a bivariate normal distribution with correlation ρ. Use PROC CORR to compute the sample correlation matrix for [...] The post Simulate correlations by using the Wishart distribution appeared first on The DO Loop.

Read more »

How Good is That Random Number Generator?

September 28, 2017
By
How Good is That Random Number Generator?

Recently, I saw a reference to an interesting piece from 2013 by Peter Grogono, a computer scientist now retired from Concordia University. It's to do with checking the "quality" of a (pseudo-) random number generator.Specifically, Peter discusses what...

Read more »

How Good is That Random Number Generator?

September 28, 2017
By
How Good is That Random Number Generator?

Recently, I saw a reference to an interesting piece from 2013 by Peter Grogono, a computer scientist now retired from Concordia University. It's to do with checking the "quality" of a (pseudo-) random number generator.Specifically, Peter discusses what...

Read more »

Data-driven simulation

September 27, 2017
By
Data-driven simulation

In a large simulation study, it can be convenient to have a "control file" that contains the parameters for the study. My recent article about how to simulate multivariate normal clusters demonstrates a simple example of this technique. The simulation in that article uses an input data set that contains [...] The post Data-driven simulation appeared first on The DO Loop.

Read more »

Simulate multivariate normal data in SAS by using PROC SIMNORMAL

September 25, 2017
By
Simulate multivariate normal data in SAS by using PROC SIMNORMAL

My article about Fisher's transformation of the Pearson correlation contained a simulation. The simulation uses the RANDNORMAL function in SAS/IML software to simulate multivariate normal data. If you are a SAS programmer who does not have access to SAS/IML software, you can use the SIMNORMAL procedure in SAS/STAT software to [...] The post Simulate multivariate normal data in SAS by using PROC SIMNORMAL appeared first on The DO Loop.

Read more »

Simulate multivariate clusters in SAS

September 13, 2017
By
Simulate multivariate clusters in SAS

This article shows how to simulate data from a mixture of multivariate normal distributions, which is also called a Gaussian mixture. You can use this simulation to generate clustered data. The adjacent graph shows three clusters, each simulated from a four-dimensional normal distribution. Each cluster has its own within-cluster covariance, [...] The post Simulate multivariate clusters in SAS appeared first on The DO Loop.

Read more »

Random segments and broken sticks

July 26, 2017
By
Random segments and broken sticks

A classical problem in elementary probability asks for the expected lengths of line segments that result from randomly selecting k points along a segment of unit length. It is both fun and instructive to simulate such problems. This article uses simulation in the SAS/IML language to estimate solutions to the [...] The post Random segments and broken sticks appeared first on The DO Loop.

Read more »

easy riddle

July 11, 2017
By
easy riddle

From the current Riddler, a problem that only requires a few lines of code and a few seconds of reasoning. Or not. N households each stole the earnings from one of the (N-1) other households, one at a time. What is the probability that a given household is not burglarised? And what are the expected […]

Read more »

Runs in coin tosses; patterns in random seating

June 5, 2017
By
Runs in coin tosses; patterns in random seating

If you toss a coin 28 times, you would not be surprised to see three heads in a row, such as ...THHHTH.... But what about eight heads in a row? Would a sequence such as THHHHHHHHTH... be a rare event? This question popped into my head last weekend as I [...] The post Runs in coin tosses; patterns in random seating appeared first on The DO Loop.

Read more »

How to choose a seed for generating random numbers in SAS

June 1, 2017
By
How to choose a seed for generating random numbers in SAS

Last week I was asked a simple question: "How do I choose a seed for the random number functions in SAS?" The answer might surprise you: use any seed you like. Each seed of a well-designed random number generator is likely to give rise to a stream of random numbers, [...] The post How to choose a seed for generating random numbers in SAS appeared first on The DO Loop.

Read more »


Subscribe

Email:

  Subscribe