# [R-SIG-Finance] Generating Data for Portfolio Simulation

Rowe, Brian Lee Yung (Portfolio Analytics) B_Rowe at ml.com
Tue Feb 17 21:38:25 CET 2009

```Hi Tom,

>From your construction of the problem, you do have a circular
dependency. Your simple factor model is basically CAPM, and if you think
about it from that perspective then you should generate the market
returns independently of your factor model, since you are trying to
explain your asset returns based on the market.

My 2c,
Brian

-----Original Message-----
From: r-sig-finance-bounces at stat.math.ethz.ch
[mailto:r-sig-finance-bounces at stat.math.ethz.ch] On Behalf Of Tom Smythe
Sent: Tuesday, February 17, 2009 2:24 PM
To: r-sig-finance at stat.math.ethz.ch
Subject: [R-SIG-Finance] Generating Data for Portfolio Simulation

Hi All,

I am looking for a way to generate generate M snapshots of return data
for all securities in an N security universe.  The return for the n-th
security at the m-th snapshot should come from a simple factor model
such that
r[n,m] = alpha[n] + beta[n] * rm[m] + epsilon[n,m],
where rm[m] is the market return, and epsilon[n,m] is noise with zero
mean and given covariance (more on this below).

The issue that I am facing is that I want the market return to be the
weighted sum of the individual security returns.  That is
rm[m] = sum_n b[n] r[n,m]
where b[n] is the ratio of the n-th security's market capitalization
to the total market capitalization, and rm[m] has a given (time
series) mean and variance.

Some other constraints of the problem are that the weighted alpha is
zero
sum_n b[n] alpha[n] = 0
and the weighted beta is one
sum_n b[n] beta[n] = 1.
It would be nice if the noise term epsilon[n,m] had zero column (i.e.,
cross-sectional) mean and zero row (i.e., time series) mean; but both
of these requirements cannot be met simultaneously because they force
the covariance matrix to be singular.  For simplicity, I'd like to
assume that the covariance is non-singular and diagonal, with known
constant diagonal elements.

This appears to be a circular problem.  I seem to be unable to specify
r[n,m] without rm[m], and vice versa.

Can anybody advise me how to generate such factor-model data that is
compatible with the given market return statistics and given noise
covariance matrix?  Unless I'm missing something silly, this seems to
be an under-determined problem (if M >> N), with no unique solution.
However, in my case, any non-trivial but internally consistent
solution will do.

Thanks.

_______________________________________________
R-SIG-Finance at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.

--------------------------------------------------------------------------
This message w/attachments (message) may be privileged, confidential or proprietary, and if you are not an intended recipient, please notify the sender, do not use or share it and delete it. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Merrill Lynch. Subject to applicable law, Merrill Lynch may monitor, review and retain e-communications (EC) traveling through its networks/systems. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or error-free. References to "Merrill Lynch" are references to any company in the Merrill Lynch & Co., Inc. group of companies, which are wholly-owned by Bank of America Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a Condition to Any Banking Service or Activity * Are Not Insured by Any Federal Government Agency. Attachments that are part of this E-communication may have additional important disclosures and disclaimers, which you should read. This message is subject to terms available at the following link: http://www.ml.com/e-communications_terms/. By messaging with Merrill Lynch you consent to the foregoing.
--------------------------------------------------------------------------

```