13.07.2015 Views

BERND PAPE Asset Allocation, Multivariate Position Based Trading ...

BERND PAPE Asset Allocation, Multivariate Position Based Trading ...

BERND PAPE Asset Allocation, Multivariate Position Based Trading ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

188 ACTA WASAENSIAA6Matlab code for simulation of the allocation model inchapter 51 function [stock1,stock2,ewindex,cwindex] = <strong>Allocation</strong>(T)2 % ALLOCATION simulates <strong>Asset</strong> <strong>Allocation</strong> model3 % SYNTAX: [STOCK1,STOCK2,EWINDEX,CWINDEX] = ALLOCATION(T)4 % INPUT: T = scalar number of observations to simulate5 % OUTPUT: STOCK1 = (T*1) logreturns of stock 16 % STOCK2 = (T*1) logreturns of stock 27 % EWINDEX = (T*1) logreturns of equal weighted index8 % CWINDEX = (T*1) logreturns of cap. weighted index9 %10 % written by Bernd Pape, University of Vaasa, Finland111213 tic %start clock1415 % Technical Parameters1617 steps = 500; %nuber of microsteps per integer time step18 N = 500; %number of traders1920 % Model Parameters2122 pf=zeros(1,2); %(1*2) logarithmic fundamental prices23 v=0.001; %# stock/strategy revaluations per macro time step24 vb=0.04; %# asset allocation revaluations p. macro time step25 a=0.1; %strength of infection within stocks26 ab=0.4; %strength of infection between stocks / bonds27 l=0.5; %leverage parameter (tc/tf)28 s=0.8; %discount factor for fundamentalist profits293031 % Initialization of vector and matrix dimensions3233 p=pf; %(1*2) vector of current trading prices34 dp=zeros(1,2); %(1*2) price increments at micro time step35 phist=zeros(T,2); %(T*2) logprice history at integer steps36 Phist=zeros(T,2); %(T*2) trading price history at integer steps3738 c = zeros(1,2); %(1*2) current chartist utilities3940 nc=zeros(1,2); %(1*2) vector of current chartist populations41 dnc=zeros(1,2); %(1*2) increments in chart. pop’s at microstep42 nchist=zeros(T,2); %(T*2) history of chartist populations43

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!