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.

ACTA WASAENSIA 191138 dnmat(5,2) = fastbin(nf(2), pmat(5,2)); % f2 -> c1139 dnmat(6,1) = fastbin(nc(2), pmat(6,1)); % c2 -> f1140 dnmat(6,2) = fastbin(nf(1), pmat(6,2)); % f1 -> c2141142143 % (4*2) draws of traders switching between stocks / bonds144145 dnbmat(1,1) = fastbin(nb, pbmat(1,1)); % b -> c1146 dnbmat(2,1) = fastbin(nb, pbmat(2,1)); % b -> c2147 dnbmat(3,1) = fastbin(nb, pbmat(3,1)); % b -> f1148 dnbmat(4,1) = fastbin(nb, pbmat(4,1)); % b -> f2149150 dnbmat(1,2) = fastbin(nc(1), pbmat(1,2)); %c1 -> b151 dnbmat(2,2) = fastbin(nc(2), pbmat(2,2)); %c2 -> b152 dnbmat(3,2) = fastbin(nf(1), pbmat(3,2)); %f1 -> b153 dnbmat(4,2) = fastbin(nf(2), pbmat(4,2)); %f2 -> b154155156 % Calculation of stock population increments157158 dnc(1)= dnmat(1,2) + dnmat(3,2) + dnmat(5,2) + dnbmat(1,1) - ...159 dnmat(1,1) - dnmat(3,1) - dnmat(5,1) - dnbmat(1,2);160 dnc(2)= dnmat(1,1) + dnmat(4,2) + dnmat(6,2) + dnbmat(2,1) - ...161 dnmat(1,2) - dnmat(4,1) - dnmat(6,1) - dnbmat(2,2);162 dnf(1)= dnmat(2,2) + dnmat(3,1) + dnmat(6,1) + dnbmat(3,1) - ...163 dnmat(2,1) - dnmat(3,2) - dnmat(6,2) - dnbmat(3,2);164 dnf(2)= dnmat(2,1) + dnmat(4,1) + dnmat(5,1) + dnbmat(4,1) - ...165 dnmat(2,2) - dnmat(4,2) - dnmat(5,2) - dnbmat(4,2);166167168 % Update of trader populations169170 nc = nc + dnc; %(1*2) updated chartist populations171 nf = nf + dnf; %(1*2) updated fundamentalist populations172 nb = N - sum([nc nf]); %(scalar) upd. bond population173174175 % Update of (1*2) trading prices176177 dp = (l*dnc + (pf-p).*dnf)./nf; %(1*2) price increments178 p = p + dp; %(1*2) updated trading prices179180181 % Update of traders cash182183 price = exp(p); %(1*2) ordinary trading price184 ccash = ccash-dnc.*price; %(1*2) aggr. chartists cash

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

Saved successfully!

Ooh no, something went wrong!