[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sliding window problem
From: |
Miroslaw Kwasniak |
Subject: |
Re: sliding window problem |
Date: |
Wed, 15 Dec 2004 10:01:19 +0100 |
User-agent: |
Mutt/1.5.6+20040907i |
On Tue, Dec 14, 2004 at 11:33:39PM -0800, charles sugihara wrote:
> i used
> retval(i) = sum(returns)/(wins+losses);
> and it is not returning any errors, now i am checking if it is
> computing what i want.
Which is equivalent to retval(i) = mean(returns) in case non-zero returns
(for action != 0).
> thank you so much for the help, if you can't tell i am a inexperienced
> programmer essentially working with existing code and trying to modify
My loopless approach so called vectorization (currently it assumes non-zero
returns, but it can easily modified) can save your time even >100 times (for
large inst_range).
> it. my next mod will be to compute a sharpe calculation at various
> window sizes, then i will be working on correlation coefficients. i
> expect i will be posting more problems soon.
I wrote in previous msg (comments in my code) about unfinished window
problem. My neigbour did blockwise poisson proces simulation and something
linke not unfinished window caused large bias.
Mirek
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------