MeanVariance Optimization Frequently Asked Questions
What is a positive semidefinite matrix?
Here is the technical definition: a matrix M is
positive definite if for all nonzero vectors x,
the quantity x^{T}Mx is
positive. (The notation x^{T}
indicates the transpose of the vector x.) The matrix M
is positive semidefinite if x^{T}Mx is
nonnegative for all nonzero vectors x. To put this concept
into context, we are concerned with correlation
(R = r_{ij})
and covariance matrices (S = s_{ij})
of assets in our universe. By definition, these matrices are
symmetric and related to each other in the following way:
s_{ij} = r_{ij}v_{i}v_{j}
, where the asset volatility
v_{i} is the square root of s_{ii}.
If the vector x represents the allocation of assets in
a feasible portfolio, we can calculate the volatility of the
portfolio as the square root of x^{T}Sx.
For this to be welldefined for all feasible portfolios, we require
that x^{T}Sx be at least nonnegative.
Why isn't my correlation matrix positive semidefinite?
This can be caused in several ways  a nonexhaustive
list follows. The most common reason is that you used fewer dates
than assets when you calculated your correlation matrix. This
leads to a correlation matrix that is theoretically singular;
i.e., its determinant is zero. (A necessary condition that a
matrix is positive semidefinite is that its determinant is nonnegative,
but this is not sufficient; a more thorough test is performed
within MV Optimizer and WAoptimize.) This in itself is not disallowed
(although it has implications regarding the uniqueness of the
riskfree portfolio), but it makes your matrix more susceptible
to being detected as nonpositive semidefinite. Computers have
finite precision, and calculations which involve adding and subtracting
a lot of small numbers (as is the case when a determinant is
computed) are prone to roundoff error. This is the likely culprit,
but it isn't the only one. You can also achieve this effect if
you have a pair of assets that are almost perfectly correlated,
or you have an asset with volatility very close to zero. If you
entered your correlation matrix manually, you may have entered
a few values incorrectly or your correlation matrix has insufficient
precision (e.g., the values all have three place accuracy, and
this loss of precision is sufficient to make the matrix nonpositive
semidefinite). In rare cases you have a complex combination
of several of these effects.
What can I do to make my correlation matrix positive semidefinite?
Sophisticated techniques involve using maximum likelihood
estimation or principal components analysis methods to estimate
the "closest" positive definite matrix to your nonpositive
semidefinite matrix. This is outside the scope of MV Optimizer
and WAoptimize, and probably a little bit beyond the capabilities
of most individual users. We suggest the following general purpose
approach. The basic idea is to perturb your matrix just enough
to overcome the roundoff and precision problems that are triggering
the error report. Working with your correlation matrix, multiply
the offdiagonal entries in the matrix by a number very close
to 1 (say 0.9999). If this still fails, try 0.9995, 0.999, 0.995,
0.99, and so forth, until you find a value that works. The closer
the multiplier is to 1, the less you disturb the basic correlation
structure of your matrix. This works almost all the time as long
as you started with a matrix that was generated in a reasonable
way; i.e., this won't work with randomly generated matrices.
The spreadsheet capabilities of Microsoft Excel are ideal for
setting up such a procedure and systematically trying your multipliers.
The latest release of MV Optimizer has a version of this technique
builtin (although it stops its attempts at 0.995  we feel
deviations beyond this point should be made with full knowledge
by the user). For previous purchasers, contact us and we will
be happy to provide you with a patch via email.
How much time series return data should I use?
Most users use MV Optimizer and WAoptimize to help them rebalance
their portfolio on an annual basis. Assuming this longterm investment
assumption, users seek to find asset statistics (return and volatility)
that approximate their longterm values. It would seem prudent
to select a range of recent years that covers not only the recent
bull market but also bear markets in the notsodistant past.
For example, a recent major bear market occurred in 198182,
and a recent major crash (in percentage terms) occurred in October
1987. This would imply that 10 to 20 years worth of data would
be a reasonable collection.
Where can I get time series return data?
Wagner Associates does not supply return data, nor do
we recommend any particular data source. We communicate with
current users from timetotime, and they relay to us the data
sources they have found useful in their investment planning.
We reproduce this list here solely for transfer of information
purposes. If you know of a data source and would like to share
it with other users, please contact us and we will be happy to
update this list with your information:

Morningstar

Worden Brothers Telechart 2000

Steele's Mutual Fund Expert, Pro Plus edition

Yahoo! Finance

Russell
Can I use price data instead of return data?
You will need to convert the prices into returns.
What do I do if I have different amounts of data for different assets?
MV Optimizer replaces missing data values with zero. If you
have a cell here or there that is empty, then this should not
be a big deal. However, if you have 20 dates of data for asset
A and 10 dates of data for asset B, then assuming the missing
10 dates of data for asset B are zero will severely bias your
calculations. You have two simple choices for how to handle this
situation: a) use only the number of dates that all assets have
in common and use MV Optimizer's or Excel's builtin functionality
for calculating the statistics, or 2) use only the number of
dates that each pair of assets have in common and manually build
(i.e., use Excel's CORREL function) the correlation matrix one
entry at a time.
How do I print the MV Optimizer or WAoptimize sheets to a black and white printer?
In Excel, go to your "File" pulldown and select
"Page Setup". This should give you a dialog with several
tabs. Go to the "Sheet" tab and check the box next
to "Black and White". You will need to do this for
each sheet you want to print. You need only do this once if you
now save your workbook.
What do the error codes mean in MV Optimizer and WAoptimize?
MV Optimizer and WAoptimize perform many internal tests.
They check the input data as well as test the calculations performed
inside the optimizer for consistency. There are many potential
error codes that can be produced, most of which will be meaningful
only to the developers of the software. If you receive an error
code and cannot reasonably determine its source, then please
contact technical support at Wagner Associates
(MVOSupport@pa.wagner.com).
In the vast majority of cases, the user is the source of the
error. But as part of our continuing improvement program, our
interest is in diagnosing and correcting any potential problem
in the software. Some of the most common error codes are as follows:
0 
This is not an error. It is the normal
output of the optimizer. 
303 
The INI variable is not defined (MVOPTINI
or WAOPTINI). You probably didn't reboot your computer. 
304 
The INI file was not found (MVOPTIM.INI
or WAOPTIM.INI). Did you move or rename your installation directory? 
305 
Corrupt INI file. Send us your INI file
(MVOPTIM.INI or WAOPTIM.INI) and we will determine the problem. 
307 
Corrupt INI file. Send us your INI file
(MVOPTIM.INI or WAOPTIM.INI) and we will determine the problem. 
315 
Corrupt INI file. Send us your INI file
(MVOPTIM.INI or WAOPTIM.INI) and we will determine the problem. 
325 
Corrupt INI file. Send us your INI file
(MVOPTIM.INI or WAOPTIM.INI) and we will determine the problem. 
407 
Your problem is infeasible. Review your
constraints. 
2002 
Your trial has expired. 
21xx 
You have an authorization problem. Contact
tech support. 
Why does MV Optimizer return Error 2001 when I click OPTIMIZE PORTFOLIO?
Here are the known causes for Error 2001:
A) You did not reboot after installing MV Optimizer.
Corrective action: reboot, then try again.
B) The required DLLs were installed to a network drive.
Corrective action: reinstall the software, accepting the default
location for the DLLs.
C) The required DLLs were installed to different directories.
Corrective action: reinstall the software, accepting the default
location for the DLLs. Verify that Crp9516a.dll, Cryp95a.dll,
and MVOptim.dll all are in the Windows System directory.
D) You did not have permission to add files to the Windows
System directory, or you did not have permission to add drivers
and services to a Windows NT platform.
Corrective action: have someone with full permissions reinstall
the software.
E) Windows was reinstalled, and the Windows System directory
is not in the same place as before, or the Windows NT drivers
and services required by the licensing system did not survive
the reinstall.
Corrective action: have someone with full permissions reinstall
the software.
Make a copy of MVOptimizer.xls before reinstalling, if you
don't want to retype any of your input data.
I paid for
a copy of MV Optimizer, obtained a Site Key, and have been using
it on a daily basis with no problems. When I tried to run an Optimize
Portfolio today, I was told that my free trial had expired and
I need to purchase a license. Why did this happen, and how can
I prevent it from happening again?
Your MV Optimizer license depends upon certain files remaining
exactly where they were installed. It's possible that a Windows
reinstall, or a disk defragmenting utility has moved or corrupted
these files. In particular, if you use the Speed Disk defragmenting
utility from Symantec's Norton Utilities, you could damage the
licensing files, causing an interruption of your license.
Before you defragment your hard drive with the Norton Utilities
Speed Disk, you need to change its settings to avoid damaging
the license files.

Open Speed Disk and choose File>Options>Customize>Unmovable
Files.

Specify that *.ENT, *.KEY, and *.RST files cannot be moved.
NOTE: Speed Disk's default settings allow system files to be
moved, but moving any of these 3 file types can disrupt your
license.

Choose File>Options>Optimization>Save to save
these settings.
It now should be safe to use Speed Disk without disrupting
your license.
Can I calculate tracking portfolios using MV Optimizer or WAoptimize?
The classic tracking portfolio problem has the following form:
n = number of assets in the universe
x_{0} = benchmark portfolio
weights (n by 1 vector)
x = tracking portfolio weights (n by 1 vector)
a = expected returns (n by 1 vector)
S = covariance matrix (n by n symmetric positive definite
matrix)
Objective: determine x which minimizes the tracking
index
(x  x_{0})^{T}S(x  x_{0})
while maximizing
the marginal return
a^{T}(x  x_{0})
You can solve this problem using the MVO library by setting
up the following problem:
n´ = n + 1 = number of assets in the universe
x´ = portfolio weights (n´ by 1 vector)
a´ = expected returns (n´ by 1 vector)
S´ = covariance matrix (n´ by n´ symmetric
positive definite matrix)
where
x´ = [1 , x]
a´ = [a^{T}x_{0} , a]
S´ = [x_{0}^{T}Sx_{0} x_{0}^{T}S , Sx_{0}^{T} S]
Objective: determine x´ which minimizes the squared
risk
x´^{T}S´x´
while maximizing
the return
a´^{T}x´
Note that
x´^{T}S´x´ = (x  x_{0})^{T}S(x  x_{0})
and
a´^{T}x´ = a^{T}(x  x_{0})
To set this up using the MVO library, simply fix the holdings
of the "additional asset" to 1 and build the return
and covariance matrices as illustrated above.
To set this up using WAoptimize or MV Optimizer, set the
minimum allocation and maximum allocation of the "additional asset"
to 1. Set the return of the "additional asset"
to a^{T}x_{0}. Assume that the
original correlation matrix is Y and the volatilities
are given by the n by 1 vector s. Thus, the (i,j) entry
of S is equal to the (i,j) entry of Y multiplied
by s_{i}s_{j}, or S =
diag(s)Ydiag(s). (diag(s) is an n
by n diagonal matrix with the volatilities on the diagonal.)
The volatility, s_{a}, of
the "additional asset" is then given by the square
root of
x_{0}^{T}Sx_{0} = x_{0}^{T}diag(s)Ydiag(s)x_{0}
. The new correlation
matrix has the form
Y´ = [1 (1/s_{a})x_{0}^{T}diag(s)Y , Ydiag(s)x_{0}(1/s_{a}) Y]
Copyright 19982000 by Daniel H. Wagner Associates, Inc.  All rights reserved.
