RATS 11
RATS 11

Statistics and Algorithms /

Simulations and Bootstrapping

Home Page

← Previous Next →

RATS provides several instructions, including SIMULATE, FORECAST, and BOOT, and a number of built-in functions, such as %RAN and %UNIFORM, which make it possible to implement a wide variety of Monte Carlo experiments and simulations. We will discuss these special instructions and functions in detail later on.

 

Usually, it is a fairly simple task to set up for a single draw from your model. However, there is very little call for the results of a single draw—the typical goal is an estimate of the probability of an event, or a moment of a distribution. To compute these, you need to loop over the code performing the simulations and do some bookkeeping with the results. RATS provides the following tools to accomplish this:

DO for looping over a block of instructions. RATS provides several other looping functions (DOFOR, LOOP, WHILE, and UNTIL), but DO is the one most often used for simulations.

COMPUTE for updating counters and totals.

EWISE for general record keeping with matrices.

SET and GSET for updating counters and totals with series.

 

The "Bookkeeping" page describes a set of basic bookkeeping techniques that will be a part of almost any bootstrapping or simulation task. "Bootstrapping and Simulation Tools" discusses the basic methods for generating random numbers or random entry numbers.

 


Copyright © 2025 Thomas A. Doan