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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

172 ACTA WASAENSIA87 % a3 = 1; %importance of profit differentials for c/f switches88 % s = 0.75; %discount factor89 % sigma = 0.05; %imprecision in excess demand perception90919293 % Initialization of aggregated trading volume9495 Tc = N*tc; %aggregated chartists trading volume96 Tf = N*tf; %aggreg. fundamentalists trading volume per unit mispricing979899 % Initialization of vector and matrix dimensions100101 precent = repmat(pf,plag,1); %(plag*1) vector of recent prices102 phist = zeros(T,1); %(T*1) vector of price history at integer time steps103 xhist = zeros(T,1); %(T*1) vector of opinion index history104 zhist = zeros(T,1); %(T*1) history of fraction of chartists105106 hchist = zeros(T,1); %(T*1) history of chartist holdings107 hfhist = zeros(T,1); %(T*1) history of fundamentalist holdings108 cchist = zeros(T,1); %(T*1) history of chartist cash109 cfhist = zeros(T,1); %(T*1) history of fundamentalist cash110111112 expU = zeros(3,2); %(3*2) potential exponentials and their inverses113114115 % Upper threshold for fraction of chartists for stationary dynamics116 % from solving quadratic equation (condition 1, page 686) for z117118 a = 2*beta*Tc*(a2-a3/pf); %quadratic term in z119 b = 2*v1*(a1-1)+beta*(2*a3*Tc/pf+Tf); %linear term in z120 zmax = sqrt((b/(2*a))^2+beta*Tf/a)-b/(2*a); %upper crossing with 0121122123 % Randomly initialize population of trading strategies124 % with at least nmin agents in every stratgy125126 % number of chartists is random number between 0 and zmax*N,127 % but not less than 2*nmin and not more than N-nmin128 nc = min([max([fix(rand*zmax*N) 2*nmin]) N-nmin]);129 nf = N-nc; %number of fundamentalists130 % number of optimists is random number between 0 and nc,131 % but not less than nmin and not more than nc-nmin132 np = min([max([round(rand*nc) nmin]) nc-nmin]);133 nm = nc-np; %number of pessimistic chartists

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

Saved successfully!

Ooh no, something went wrong!