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.

192 ACTA WASAENSIA185 fcash = fcash+dnc.*price; %(1*2) aggr. fundament. cash186187188 end %end inner loop over micro time steps189190 % Update history of state variables at integer time steps191192 phist(t,:)=p; %(T*2) history of logarithmic trading prices193 Phist(t,:)=price; %(T*2) history of ordinary trading prices194 nchist(t,:)=nc; %(T*2) history of chartist populations195 nfhist(t,:)=nf; %(T*2) history of fundamentalist populations196197198 % Record history of cash199200 cchist(t,:) = ccash; %(scalar) chartists aggregate cash201 cfhist(t,:) = fcash; %(scalar) fundamentalists aggr. cash202203204 end %end outer loop over integer time steps205206207 % Calculation of Return Series208209 %Individual logreturns210 rhist = phist-[pf;phist(1:T-1,:)]; %(T*2) individual logreturns211 corr = corrcoef(rhist); %(2*2) cross-correlation matrix of returns212213 %Equal weighted index returns214 ret = exp(rhist); %(T*2) individual gross returns215 ewret = mean(ret,2)-1; %(T*1) equally weighted index net-returns216217 %Capitalization weighted index returns218 price = exp([pf; phist(1:T-1,:)]); %(T*2) lagged price history219 weight = price./repmat(sum(price,2),1,2); %(T*2) cap. weigths220 cwret = sum(weight.*ret,2)-1; %(T*1) cap-weighted index net-returns221222 %Index logreturns223 ewlret = log(1+ewret); %(T*1) logreturns of equally weigthed index224 cwlret = log(1+cwret); %(T*1) logreturns of cap-weighted index225 avlret = mean(rhist,2); %(T*1) average logreturns226227228 % Calculate history of traders holdings normalized at tc=1229230 hchist = nchist; %(T*2) chartist aggr. holdings history for tc=1231 hfhist = nfhist.*(repmat(pf,T,1)-phist)/l; %(T*2) fund. holdings

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

Saved successfully!

Ooh no, something went wrong!