correlation

JMS encoded message selector not matching when using special characters

对着背影说爱祢 提交于 2020-01-15 11:44:10
问题 I have 2 applications (client and server) using a request-reply pattern. The client sends a request to the server the message ID is set to something like this: ID=Hostname-52991-1357677886768-3:1:2:1:1 . Now the client has to listen to a message with a correlation ID set to the same value. Since the value contains special characters (:) I have to encode the value (using UTF-8). Sets the JMS Selector, which is an SQL 92 predicate that is used to filter messages within the broker. You may have

R - Inconsistent p-value in running Spearman correlation

孤街浪徒 提交于 2020-01-15 10:30:33
问题 My problem is when I compute running correlation for some odd reason I do not get the same p-value for the same estimates/correlations values. My target is to calculate a running Spearman correlation on two vectors in the same data.frame (subject1 and subject2 in the example below). In addition, my window (length of the vector) and stide (the jumps/steps between each window) are constant. As such, when looking at the formula below (from wiki) I should get the same critical t hence the same p

Combined Pearson/Spearman rank correlation matrix with significance stars in Stata

我只是一个虾纸丫 提交于 2020-01-15 07:11:34
问题 I want to calculate a correlation matrix, where the lower triangle consists of Pearson and the upper triangle consists of Spearman rank correlation coefficients. I am using corr and spearman , which works fine. But with corr I cannot get the significance (p-value or stars and so on). So I tried pwcorr, list which gives me the exact results but with significance. Using this "new combination" I cannot create the matrix as with corr . //Get Pearson Matrix corr var1 var2 var3 matrix R = r(C) /

How to calculate p-values for pairwise correlation of columns in Pandas?

旧城冷巷雨未停 提交于 2020-01-14 18:51:21
问题 Pandas has the very handy function to do pairwise correlation of columns using pd.corr(). That means it is possible to compare correlations between columns of any length. For instance: df = pd.DataFrame(np.random.randint(0,100,size=(100, 10))) 0 1 2 3 4 5 6 7 8 9 0 9 17 55 32 7 97 61 47 48 46 1 8 83 87 56 17 96 81 8 87 0 2 60 29 8 68 56 63 81 5 24 52 3 42 76 6 75 7 59 19 17 3 63 ... Now it is possible to test correlation between all 10 columns with df.corr(method='pearson') : 0 1 2 3 4 5 6 7

How to calculate p-values for pairwise correlation of columns in Pandas?

寵の児 提交于 2020-01-14 18:50:07
问题 Pandas has the very handy function to do pairwise correlation of columns using pd.corr(). That means it is possible to compare correlations between columns of any length. For instance: df = pd.DataFrame(np.random.randint(0,100,size=(100, 10))) 0 1 2 3 4 5 6 7 8 9 0 9 17 55 32 7 97 61 47 48 46 1 8 83 87 56 17 96 81 8 87 0 2 60 29 8 68 56 63 81 5 24 52 3 42 76 6 75 7 59 19 17 3 63 ... Now it is possible to test correlation between all 10 columns with df.corr(method='pearson') : 0 1 2 3 4 5 6 7

Python, Pandas: Calculate Spearman Correlation on 4000 observations efficiently

旧巷老猫 提交于 2020-01-14 15:05:08
问题 I have a DataFrame with 2000 rows and 4000 columns (observations). I want to calculate the spearman correlation row-wise. Currently I´m using: df.T.corr(method="spearman") It seems to take a very long time (20min and still not finished). Is there a more efficient module? Can I preprocess the DataFrame to speed things up? UPDATE: Using scipy.stats.spearmanr is 20x faster SCC, pval = scp.spearmanr(df, axis=1) SCC = pd.DataFrame(SCC, index=df.index, columns=df.index) 来源: https://stackoverflow

Run correlation between unequal sized blocks of data in 2 time series

眉间皱痕 提交于 2020-01-14 05:32:06
问题 I have two datasets and I need to estimate correlation of the series in these two datasets. For example, one series in of length 189 and the other series is of length 192. The end point of these series respond to the same time period ,i.e., Dec 2015. The difference is in the start point of this series. I need to estimate the correlation for the blocks of 12 data points in both the series starting from the last point. For ex, the first block would be from Jan 2015 to Dec 2015, second block

Scipy: distance correlation is higher than 1

跟風遠走 提交于 2020-01-13 10:03:26
问题 I'm trying to find distance correlation between columns, look at the code below. Most of time it returns higher than 1 result, which is not possible, because distance correlation is between 0 and 1. You can read about scipy's distance correlation here. import numpy as np from scipy.spatial import distance x = np.random.uniform(-1, 1, 10000) print distance.correlation(x, x**2) 1.00210811815 What is wrong here or how can I measure it? upd1: Link to issue on github 回答1: I don't see why this is a

How to calculate correlation In R

余生长醉 提交于 2020-01-11 10:07:40
问题 I wanted to calculate correlation coeficient between colunms of a subset of a data set x in R I have rows of 40 models each 200 simulations in total 8000 rows I wanted to calculate the corr coeficient between colums for each simulation (40 rows) cor(x[c(3,5)]) calculates from all 8000 rows I need cor(x[c(3,5)]) but only when X$nsimul=1 and so on would you help me in this regards San 回答1: I'm not sure what exactly you're doing with x[c(3,5)] but it looks like you want to do something like the

How to calculate correlation In R

旧时模样 提交于 2020-01-11 10:04:43
问题 I wanted to calculate correlation coeficient between colunms of a subset of a data set x in R I have rows of 40 models each 200 simulations in total 8000 rows I wanted to calculate the corr coeficient between colums for each simulation (40 rows) cor(x[c(3,5)]) calculates from all 8000 rows I need cor(x[c(3,5)]) but only when X$nsimul=1 and so on would you help me in this regards San 回答1: I'm not sure what exactly you're doing with x[c(3,5)] but it looks like you want to do something like the