[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: running Person's correlation
From: |
Francesco Potortì |
Subject: |
Re: running Person's correlation |
Date: |
Mon, 02 Sep 2013 11:28:06 +0200 |
>> I have a signal (long) and a template (short, fixed). I have to compute
>> the Pearson's correlation of the short signal with a sliding window of
>> the long signal. This is a convolution where each sample is divided by
>> the (fixed) standard deviation of the short signal and the running
>> standard deviation of the long signal.
>>
>> The only loopless way I can think of is to compute a running sum, a
>> running sum of squares, and use them to compute a running standard
>> deviation to be multiplied with the convolution. Any more
>> straightforward methods?
Markus Bergholz:
>cumsum ?
Yes, cumsum(x) is the basis for a running sum, and cumsum(x.*x) is the
basis for a running sum of squares; the running sums can be used to get
a running standard deviation. I am writing a function to do just that.
I was wondering if there was a more straightforward way.
Thomas D. Dean:
>corr_test? Maybe look at the code and see how it is done there?
What is corr_test?
--
Francesco Potortì (ricercatore) Voice: +39.050.621.3058
ISTI - Area della ricerca CNR Mobile: +39.348.8283.107
via G. Moruzzi 1, I-56124 Pisa Skype: wnlabisti
(entrance 20, 1st floor, room C71) Web: http://fly.isti.cnr.it