View Single Post
  #27  
Old 11-07-2007, 10:17 AM
DcifrThs DcifrThs is offline
Senior Member
 
Join Date: Aug 2003
Location: Spewin them chips
Posts: 10,115
Default Re: Market Model Thingy

[ QUOTE ]
One easy way to check your code is to generate random data with 0 mean returns:

e.g. rand(m,n)-0.5 in matlab with m,n desired size

and see if your code generates profit (of course it shouldn't). This is not foolproof, but it's quick.

Then, you could remove stocks that have low market caps or low daily volume. Transaction cost/slippage could be fairly high for small stocks so much of your excess return could come from these.

Also, small stocks can have sick drawdowns. So if you hold a portfolio of these, you'd have to assume that some of your money is in cash. This would reduce the returns.

Also, you migh want to use pinv() instead of regress() function...sometimes it makes a difference. Same thing, just more stable numerically.

[/ QUOTE ]

interesting...i learn new things everyday [img]/images/graemlins/smile.gif[/img]

so why exactly is pinv(X'*X) more stable numerically than (X'*X)^-1? i read the "help pinv" on it and it looks like it just calculates the inverse:

[ QUOTE ]
X = PINV(A) produces a matrix X of the same dimensions
as A' so that A*X*A = A, X*A*X = X and A*X and X*A
are Hermitian.

[/ QUOTE ]

i tested it on a few things i've done and in no case got anything different down to 4 decimal places.

also, how do i change the view so that it shows n number of decimal places?

thanks,
Barron
Reply With Quote