SAS Applicatin: develpment SAS PORTFOLIO ANALYSIS: RANDOM PORTFOLIOS FOR EVALUATING TRADING PAUWELS STEFAAN ECKERMAN EWOUT ABSTRACT Prtfli pprtunity distributins can prvide a statistical test that a trading strategy perfrms better than chance. Each run f the mutual fund manager is cmpared t a number f matching prtflis that have zer skill. With this SAS prgram we try t answer the questin: what if I had applied investment strategy X during the perid Y. By implementing a back test, applying an investment strategy t histrical financial infrmatin, we are able t assess the results f a mutual fund. The gal is t asses live prtflis and t allw infrmed decisins. If the market is efficient there shuld be n reliably way f beating the market. Instead the best bet wuld be t jin the market by fllwing an index r a buy and hld strategy. Key wrds: tracking hldings, matching prtflis, prtfli pprtunity distributins, randm prtflis, evaluating trading strategy, Mnte Carl simulatin, live prtflis, prtfli management, efficient market hypthesis INTRODUCTION The underlying idea is that f cmparing results f a randm managerial strategy with a real ne. Verifying if results btained by well infrmed managers are cnsistent with thse generated by unskilled nes. T define a minimum return level, under which results cannt be ascribed t management skill and, thus, cannt justify management fees. This back test applicatin develped at the University f Ghent is used fr practical implementatin. All currently available stcks are used t measure mutual fund perfrmance. The user f this prgram might request a back test f a prtfli F, with 30 stcks, fr the perid 2004 till 2011. This prgram allws us t create randm prtflis with value-weighted sampling. This means that the prbability f chsing a certain stck is prprtinate t the market capitalizatin f that particular stck. Preliminary versin 1.0 Page 1
SAS Applicatin: develpment The prtfli perfrmance is measured by cmparing the return f the target prtfli against the return f different randmly created matching prtflis. The matching prtfli is a prtfli sharing the same expsures but hlding different stcks. Breadth: hw many stcks are held lng and shrt? Risk: what are the betas f the individual stcks (and hence standard deviatin)? Directin: hw much is held lng, hw much is held shrt? Investment style: what apprach is used by the manager, different expsures t the market? Turnver: it is recmmended that the matching prtflis transact every mnth t reflect the real wrld. Fees: the ttal expense rati f the mutual fund? The user can cntrl the characteristics f the matching prtfli. SAS uses these inputs t randmly create 10.000 matching prtflis cnfrm the prtfli cnstructin fllwed by the real manager. HYPOTHESIS We test the ability f a fund t yield returns, net f the manager s reward that is significantly higher than that which culd be btained by a manager withut any specific skill. With this specific test we make a distinctin between skill and luck. Given a fund F, we fcus n evaluating the hypthesis system: H 0 : F shw skill H 1 : F des nt shw skill. A crrect statistical evaluatin f system requires a perfrmance measure r(f) and its distributin under H0. Testing this system, thus, cnsists f cmparing bserved perfrmance r(f) with distributin under the null hypthesis. The n-skill perfrmance distributin may be btained by cnsidering randm matching prtflis, i.e., thse cmpsed f randmly selected assets. Preliminary versin 1.0 Page 2
SAS Applicatin: develpment DATA A. CREATING THE SOURCE FILE The surce file is btained frm DataStream (all stcks frm the S&P500). We cllect daily and mnthly stck data (daily and mnthly prices and returns). Annual accunting and specific stck (sectr) data are als btained. Daily stck data Specific stck data Surce file fr matching prtfli Table 1: SAS data file t create matching prtflis /*Calculatin f daily returns creating the surce file/ Data surce_file Set raw_file... Preliminary versin 1.0 Page 3
SAS Applicatin: develpment B. CREATING A BACK TEST Once the data file has been created in SAS, matching prtflis can be defines using user defined parameters: Structural parameters (prtfli attributes) Data range (2004 - ): testing perid Number f prtflis (# > 1000) Refilling frequency (replacing a stck) Prtfli criteria (expsure f the real fund) Breadth: hw many stcks are held lng and shrt? Risk: what are the betas f the individual stcks (and hence standard deviatin)? Diversificatin: Number f stcks (range frm 20 t 100 stcks) Weightings fr each security Between 0 and 20% Directin: hw much is held lng, hw much is held shrt? Investment style: what apprach is used by the manager, different expsures t the market? Typically this might be Class (equities, Bnds, Cash, Freign Prperty) Sectr (resurces, financials, ) Size (large, mid r small cap) Style (Value, grwth r cre) Turnver: it is recmmended that the matching prtflis transact every mnth t reflect the real wrld (rebalancing frequency) Transactin csts: setting up the transactin csts Fees: the ttal expense rati f the mutual fund? Surce file fr matching prtfli Prtfli criteria X 1,X 2,X 3 Matching prtfli file Analysis Preliminary versin 1.0 Page 4
SAS Applicatin: develpment PROGRAMMING TASKS: CREATING MATCHING PORTFOLIOS We will intrduce a number f prgramming steps t create the matching prtfli file frm the surce database. Measuring perfrmance is based n thse matching prtflis. By default, all available stcks are cnsidered t be included. The universe f stcks can be filtered by adding ne r mre criteria defined by the user. Multiple prtflis are created are created by putting securities int baskets. We can fr example set the sectr expsure t nn financial. All financial stcks are thus excluded t be set int the basket. 1. Fr the start date create percentiles fr the prtfli criteria a. At start date (sectr expsure, risk, ) b. At refill date 2. At the start date, randmly draw stcks fr each prtfli frm qualifying stcks a. During the creatin f a back test, securities within a matching prtfli are randmly selected (accrding t the sectr expsure, riskiness, ) i. Generating a randm number fr each stck_id 3. Track daily/weekly/mnthly cumulative return f each stck in the prtfli a. Track the stck b. Track the prtfli (hlding perid return) 4. Turnver: sell/buy stcks accrding t the turnver set in the parameters 5. Stcks stp trading; reallcate the residual value t the rest f the prtfli 6. At the refill date a. We can chse between tw prcesses i. Keep all stcks that are still eligible (buy and hld) ii. Randmly select replacements fr all stcks n lnger eligible b. We can randmly select stcks that have t be replaced i. Defining the turnver f the fund 7. At the during/end f each evaluatin perid a. Lk at the randmly prtfli distributin (Net asset value =NAV) b. Calculate the p-value i. Cmbining k statistically independent p-values c. Let V be the prtin f randm prtflis which led t a perfrmance greater than that f the fund. It is intuitive that, the higher V is, the mre we are inclined t cnclude fr the n-skill hypthesis d. Fr each given time t, if F >α, the null hypthesis is accepted at the (1 α) cnfidence level. Alternatively, we can cnsider return level rt(f α) crrespnding t the (1 α) th quantile f the distributin f rt(fi): it represents the best perfrmance that can be reached, at the (1 α) cnfidence level, withut skill. Rt(F α) can als be viewed as the minimum perfrmance level that a skilled manager shuld reach. Preliminary versin 1.0 Page 5
SAS Applicatin: develpment PROBLEMS WE HAVE ENCOUNTERED IN THE PAPERS: This might be interesting t deal with these issues when implementatin takes place in SAS. Hw t accunt fr the degree f risk inherent in varius prtflis One might cnclude that higher perfrmance is nly due t a higher risk Ex pst cmparisn: if the percentage with risk level lwer than r equal t that f the bserved fund is very high, then the cmparisn may be cnsidered fair. Adjusting perfrmance with a penalty cnnected t the risk level Setting up the randm prtfli Hw t make a randm prtfli? Accunting fr risk Standard deviatin Semi-variance 1% Value-at-risk The prcedure t knw the F manager s investment universe Implied by the benchmark declared in the fund prspectus: the assumptin that the investment universe f the manager is knwn, whereas in practice this piece f infrmatin may nt be knwn t the analyst. Eliminate lucky versus unlucky situatins The number f M prtflis shuld be high (Mnte carl situatin shuld be set t high >1000) The number f stck in the prtfli Nt t lw, in rder t have a differentiated prtfli (k > 30 t 40) Imitating the fund manager? Weights f the assets Equally weighted assets? (t be preferred in initial phase, simplest t implement) w j = (1/k, j) Randmly selected? w j = randm Cmpsitin f the prtflis? Updated peridically: reinvesting in new stcks randmly with accrdance t style) Transactin csts (hw much?) Turnver (hw t implement this?) The prblem is hw t evaluate the prcedure nt nly in a given time interval, but als with respect t several perids, fr example defining the starting time but nt the final time Difficult t achieve a well defined cnfidence level because the fund return mre ften ut- r underperfrms Rt(F1 α) nly in sme perids. Daily P-value (PVt): Percentage f Outperfrmance (POt) Quantile Tracking Errr Quantile Tracking Errr Vlatilty The main statistical limitatin is that when the fund is evaluated cnsidering several time intervals, the level f the test can n lnger be cntrlled. Stck selectin Hw t define the set f stcks? Defining market capitalizatin (number f shares X prices) Preliminary versin 1.0 Page 6
SAS Applicatin: develpment Creating randm prtflis Randmly weighted prtflis N restrictin n stck cmpsitin N individual asset was allwed t amunt t mre than 5% f the ttal value f the prtfli at creatin Until weights equal t ne Prprtinally weighted randm prtflis The average number f stcks in each prtfli was set t the same average as that f the real funds The maximum weight f any individual asset was set at 10%. The dds f selecting each stck were the same, but nce selected the amunt invested in each asset was prprtinal t the market capitalizatin f that asset Risk free asset represented by the 1-mnth T-bill was included. The prtflis fllw a buy and hld strategy Simulate randmly pick stcks during the investment hrizn? The ability t trade during the perfrmance evaluatin perid Measure perfrmance f a prtfli? Sharpe rati Perid average return, R The infrmatin rati (IR) Risk adjusted prfitability index, PI Investment style cnsideratins: Implied by the self impsed cnstraints that the managers were facing the cannt hld all prtflis Randmly weighted prtflis are nt useful?!? Mre small cap funds; if we randmly select we culd have an verexpsure t utperfrming small stcks in ur randmly generated prtfli versus the real prtfli (nt a fair cmparisn?!?) Equally (prprtinally) weighted prtflis With r withut management fees? Lking at the TER? Hw t set the vlatility f the randmly generated funds? Ex pst (use nly these prtflis that have the same risk?) Ex ante (hw t implement? Using ptimizers?) D nt accunt fr this and use the Sharpe rati? Testing the persistency Spearman rank crrelatin t define persistency Is the fund perfrming better than the randmly generated prtflis in every time perid (mnthly/quarterly/yearly?) Lking at the level f diversificatin Herfindahl index identify sub-perids in which the strategy f a fund manager wrked well r prly p values per day Stuffer s methd t cmbine p values Implementing a vlatility cnstraint T prvide a faired assessment Cntrl chart p values Pltting multiple p values (every day) - p values ver time Highlighting when the fund des well Cmbined p values Randmly selecting stcks Culd we assign mre chance t select high market cap stcks? Preliminary versin 1.0 Page 7