correlation

How can I extract peak values from auto-correlated data in MATLAB?

落花浮王杯 提交于 2019-12-10 16:02:47
问题 I have information (20,000 frames of data) about an audio track that I have auto-correlated using: [r,lags] = xcorr(XX,XX,'biased'); And it looks like this: Which hopefully is so far so good. Ideally I would like to be able to take the frame number that corresponds to the highest part of the second peak. I've read around and tried a load of different methods but I just can't seem to get it to retrieve the information for me. Would anybody be able to shed some light on what I have to do? Many

Efficient algorithm to calculate Correlation between two Arrays [closed]

大兔子大兔子 提交于 2019-12-10 15:55:03
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . I'm looking for an algorithm to calculate correlation between two array of doubles. What are the names of the algorithms and I need c++ source code if it's possible. And by correlation I mean the similarity of

Python Scipy: scipy.stats.spearmanr returning nans

天涯浪子 提交于 2019-12-10 15:26:35
问题 Edit: Basically solved I think. I am using spearmanr from scipy.stats to find the correlations between variables across a number of different samples. I have around 2500 variables and 36 samples (or 'observations') If I calculate the correlations using all 36 samples, spearmanr works fine. If I use only the first 18 samples it also works fine. However if I use the latter 18 samples I get an error and nans are returned. This is the error: /Home/s1215235/.local/lib/python2.7/site-packages/numpy

R cor.test : “not enough finite observations”

北战南征 提交于 2019-12-10 15:05:40
问题 I'm currently trying to create an R function computing the corr.test correlation of a specified column with all the numeric columns of a dataframe. Here's my code : #function returning only numeric columns only_num <- function(dataframe) { nums <- sapply(dataframe, is.numeric) dataframe[ , nums] } #function returning a one-variable function computing the cor.test correlation of the variable #with the specified column function_generator <- function(column) { function(x) { cor.test(x, column,

How correlation helps in compression

我们两清 提交于 2019-12-10 14:42:22
问题 Hy, I would like to know how correlation between pixels in image helps in compression? Also, why I would like to reduce correlation between pixels to get better compression (I found that information in one literature, but I don't understand it)? My last question is: If correlation is R=0.9, how this information can help in compressing? Thanks. 回答1: I'll make an example. Let's say that every pixel is very much correlated with the pixel above it. Instead of compressing the pixel values directly

Correlationmatrix from data table

梦想的初衷 提交于 2019-12-10 13:44:54
问题 If I have the following data table: set.seed(1) TDT <- data.table(Group = c(rep("A",40),rep("B",60)), Id = c(rep(1,20),rep(2,20),rep(3,20),rep(4,20),rep(5,20)), Time = rep(seq(as.Date("2010-01-03"), length=20, by="1 month") - 1,5), norm = round(runif(100)/10,2), x1 = sample(100,100), x2 = round(rnorm(100,0.75,0.3),2), x3 = round(rnorm(100,0.75,0.3),2), x4 = round(rnorm(100,0.75,0.3),2), x5 = round(rnorm(100,0.75,0.3),2)) How can I calculate the correlations between x1, x2, x3, x4 and x5 by

How to find correlation between two sine waves for specific intervals and save the value in an array?

喜欢而已 提交于 2019-12-10 12:06:51
问题 I have created two sine wave each with a different frequency. Time period for both waves is 2sec or 2000msecs. Code works well when i find correlation value for whole time period. Buth i want to get correlation values after every 200msec interval. That means i need an array that can store 10 correlation values for the whole 2000msecs. Here's the code how am i calculating correlation for time period of 2000msecs. delta=0.005; %200 hz Fs samples=200; t=0:delta:delta*(samples-1); % Time Samples

Pearson Correlation without using zero element in Matlab

我是研究僧i 提交于 2019-12-10 11:48:03
问题 I have 2 example vector in Matlab : A = [5,3,3,0,4,1,5,0,2,5,5,0,5,3,4,0,1,4,4,0,4,2]; B = [1,0,0,0,1,0,4,0,0,0,0,4,4,0,1,0,0,0,0,0,0,0]; When, I try to calculate pearson correlation with manual method and do it with excel I have the same result ( 0.667 ) 1 0,667 0,667 1 But when I tried in MatLab with simple code: pearson = corr(A',B'); it return the result with different score ( 0,2139 ). 1 0,2139 0,2139 1 Maybe Its happen because the zero score(0) is using to calculate it. In happen

translation/rotation through phase correlation in python

旧城冷巷雨未停 提交于 2019-12-10 11:33:12
问题 I have two pictures, one that was the original and another one that I have modified so that it's translated up and left a bit and then rotated 90 degrees (so the shape of the picture is transposed as well). Now I'd like to determine how many pixels (or any distance unit) the modified picture is translated from the original, as well as the degrees of rotation relative to the original. Phase correlation is supposed to solve this problem by first converting the coordinates to logpolar

Correlation matrix with dplyr, tidyverse and broom - P-value matrix

一个人想着一个人 提交于 2019-12-10 10:09:12
问题 all. I want to obtain the p-value from a correlation matrix using dplyr and/or broom packages and testing multiple variables at the same time . I'm aware of other methods, but dplyr seems easier and more intuitive for me. In addition, dplyr will need to correlate each variable to obtain the specific p-value, what makes the process easier and faster. I checked other links, but they did not work for this question (example 1, example 2, example 3) When I use this code, the correlation