Posts Tagged ‘ Sampling and Simulation ’

A surprising result: The expected number of uniform variates whose sum exceeds one

September 26, 2012
By
A surprising result: The expected number of uniform variates whose sum exceeds one

I was recently flipping through Ross' Simulation (2006, 4th Edition) and saw the following exercise: Let N be the minimum number of draws from a uniform distribution that exceed 1. What is the expected value of N? Write a simulation to estimate the expected value. For example, if v =
Read more »

Tags: , ,
Posted in SAS | Comments Off

When is a correlation matrix not a correlation matrix?

September 12, 2012
By
When is a correlation matrix not a correlation matrix?

This article is an excerpt from my forthcoming book Simulating Data with SAS. Not every matrix with 1 on the diagonal and off-diagonal elements in the range is a valid correlation matrix. A correlation matrix has a special property known as positive semidefiniteness. All correlation matrices are positive
Read more »

Tags: , ,
Posted in SAS | Comments Off

Simulation in SAS: The slow way or the BY way

July 18, 2012
By
Simulation in SAS: The slow way or the BY way

Over the past few years, and especially since I posted my article on eight tips to make your simulation run faster, I have received many emails (often with attached SAS programs) from SAS users who ask, beg, and—in one case—even offer to pay for advice about how to speed up
Read more »

Tags: , , ,
Posted in SAS | Comments Off

Is using zero as a random number seed the same as not specifying a seed?

June 29, 2012
By

I received the following query regarding the RAND function in Base SAS: In SAS, is specifying 0 as a random number seed the same as not specifying a seed at all? The question concerns initializing the SAS random number stream by using the internal system clock. You can do this
Read more »

Tags: ,
Posted in SAS | Comments Off

Eight tips to make your simulation run faster

June 6, 2012
By

"Help! My simulation is taking too long to run! How can I make it go faster?" I frequently talk with statistical programmers who claim that their "simulations are too slow" (by which they mean, "they take too long"). They suspect that their program is inefficient, but they aren't sure why.
Read more »

Tags: , ,
Posted in SAS | Comments Off

The curious case of random eigenvalues

May 16, 2012
By
The curious case of random eigenvalues

I've been a fan of statistical simulation and other kinds of computer experimentation for many years. For me, simulation is a good way to understand how the world of statistics works, and to formulate and test conjectures. Last week, while investigating the efficiency of the power method for finding dominant
Read more »

Tags: , , ,
Posted in SAS | Comments Off

Generate a random matrix with specified eigenvalues

March 30, 2012
By
Generate a random matrix with specified eigenvalues

In a previous post I showed how to implement Stewart's (1980) algorithm for generating random orthogonal matrices in SAS/IML software. By using the algorithm, it is easy to generate a random matrix that contains a specified set of eigenvalues. If D = diag(λ1, ..., λp) is a diagonal matrix and
Read more »

Tags: , , ,
Posted in SAS | Comments Off

Generating a random orthogonal matrix

March 28, 2012
By
Generating a random orthogonal matrix

Because I am writing a new book about simulating data in SAS, I have been doing a lot of reading and research about how to simulate various quantities. Random integers? Check! Random univariate samples? Check! Random multivariate samples? Check! Recently I've been researching how to generate random matrices. I've blogged
Read more »

Tags: , , ,
Posted in SAS | Comments Off

Welcome!

SAS-X.com offers news and tutorials about the various SAS® software packages, contributed by bloggers. You are welcome to subscribe to e-mail updates, or add your SAS-blog to the site.

SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.