Frequently Asked Questions about SHAZAM
This FAQ accompanies the latest version of SHAZAM. Some answers may not apply to earlier versions of SHAZAM. Section 1: Working with it
Section 2: Using Windows SHAZAM
Section 3: Some SHAZAM tricks
Section 4: Numerical problems
Section 5: Technical Questions
Q1.1: How do I get help?
Q1.2: How do I get examples of SHAZAM command files?
Q1.3: How do I produce and print graphs?SHAZAM has an interface to the gnuplot package. The Professional Edition integrates Graph creation, editing and manipulation using menus and dialogs. Because Gnuplot is a commanddriven interactive plotting program both the Standard and Professional editions of SHAZAM allow full access to all Gnuplot commands for full customization of your Graphs. Q1.4: What are the limits on problem size?SHAZAM sets defaults for memory limits and variable size limits.
These can be changed with the SHAZAM also sets a default for the command line length. This can be
changed with the Q2.1: Problems with loading a data set in repeated runs.With Windows SHAZAM Versions 9 and 10 the If multiple Q3.1: Getting the minimum of more than 2 variables.Suppose you have variables
Q3.2: Getting the inverse of the NCDF.To obtain the inverse of the NCDF and save the result in the variable X use the command: GENR P=1P DISTRIB P / INV TYPE=NORMAL CRIT=X Q3.3: How to sort with 2 sort variables.The GENR SORTVAR=A*1000+B SORT SORTVAR A B C D Q3.4: How to compute skewness and kurtosis statistics.Suppose you have a variable X. You can get skewness and kurtosis with the command:
The Q3.5 Problem with READ / LIST FORMATThe first character is often interpreted as a carriage control
character when output is printed to an output file. If a FORMAT(A8,2F10.2) READ(filename) name var2 var3 / FORMAT FORMAT(1X,A8,2F10.2) PRINT name var2 var3 / FORMAT Instead of the Q3.6 Problem with GENR INDEX=INDEX/INDEX(3) This example comes from Tim Coelli. Suppose that a price index series
is available in the variable
With the above command SHAZAM does a "dynamic calculation". SHAZAM computes: 1) INDEX(1) = INDEX(1) / INDEX(3) 2) INDEX(2) = INDEX(2) / INDEX(3) 3) INDEX(3) = INDEX(3) / INDEX(3) = 1 4) INDEX(4) = INDEX(4) / INDEX(3) (BUT INDEX(3) IS NOW 1 !) = INDEX(4) 5) INDEX(5) = INDEX(5) ETC. To keep the calculation "static" the left hand side variable should be a new variable as in the following command:
Q3.7 Problem with character strings in DOloopsCharacter string names cannot be referenced with a DOloop index. This is shown in the next list of SHAZAM commands.
Q3.8: Last line in data file or command file not read !There must be a hard return at the end of a file  otherwise SHAZAM may not recognize the last line. When an excel file is saved as a text file the return character may be placed at the end of the final line. Therefore a text editor must be used to add another return and place the cursor below the final line. Q3.9: Problem with scalar variables in TEST or RESTRICT commands.Use the GEN1 A=1 OLS CONSUME INCOME PRICE TEST INCOME=A*PRICE Q3.10: Is there a command to compute factorials (that is, n!) ?An example of calculating factorials is available. This should be used with caution since as n increases the value for n! rapidly becomes extremely large. Q3.11: How to compute row and column totals of a matrix ?You can use the
Q3.12: How to include dummy variables in BoxCox regression01 dummy variables may not work in BoxCox regression that is implemented
with the Q3.13: How to calculate the normal pdfThe probability density function for a standard normal random variable is:
The following
To make the order of priority clear, an alternative command is:
To avoid programming errors when using the SET NOOUTPUT DISTRIB X / TYPE=NORMAL PDF=NPDF Q3.14: Problem with divide by zero messages when calculating a matrix Hadamard productBefore the SET MISSVALU=0 SET NOWARN NOWARNMISS An example is shown below.
Q3.15: How can a coefficient be restricted to the interval (1,0) ?With nonlinear least squares, a logit transformation can be used to force a coefficient to be in the (0,1) interval. That is, the coefficient can be expressed as: 1 / (1 + exp(b)) This is shown in the example below. A linear regression equation is considered. The coefficient on the price variable is restricted to be negative and between 1 and 0.
Q3.16: How can a 12period moving average by calculated ?The
It is useful to note that SHAZAM programming commands can
be used to replicate many calculations. The SHAZAM commands below
show use the of a
Q4.1: Why are random numbers different for different SHAZAM versions ?Different compilers may be used to make different SHAZAM versions for various operating systems and therefore, the random numbers generated by SHAZAM will be different. To guarantee the same random numbers in a repeat run of
an installed version of SHAZAM, use the command
Alternatively, to ensure the same random numbers in various
runs of SHAZAM, first save a set of random numbers to a data file
and then load the random numbers from the file with a
Q4.2: ARIMA estimation results different from other packages.The estimation of ARIMA models requires nonlinear algorithms and so there may be numerical differences in results reported by SHAZAM and other packages. The following differences should be noted when comparing results from SHAZAM and RATS. Algorithm Differences
Reporting Differences
A user has pointed out the following differences for ARIMA estimation in SHAZAM and MINITAB.
Q5.1: For NL, what is the meaning of GTRANSPOSE*INVERSE(H)*G STATISTIC ?This statistic has 2 purposes:
Q5.2: For the

SAMPLE 1 1 * Define the system of 2 equations FX1: X1**2 + 3*X1*X2  22 FX2: X2**2 + 2*X1*X2  21 * Solve the 2 equations NL 2 / NCOEF=2 SOLVE EQ [FX1] EQ [FX2] COEF X1 1 X2 1 END * Repeat using the MINFUNC option NL 1 / NCOEF=2 MINFUNC EQ ([FX1])**2 + ([FX2])**2 COEF X1 1 X2 1 END STOP 