Calculation of LvR and correlation coefficients of ground state
Created by: neworderofjamie
Thanks to you awesome help with #12 (closed), I've been comparing some of our simulation runs with the 33fb5955558ba8bb15a3fdce49dfd914682ef3ea
dataset and are having some issues especially with the populations with low firing rates. To try and narrow down where this is coming from, I tried re-using the analysis code from the repository on the FEF spike data from the 33fb5955558ba8bb15a3fdce49dfd914682ef3ea
dataset as follows:
from correlation_toolbox import helper as ch
import numpy as np
# **NOTE** this is heavily based off the analysis code from the paper
def load(filename, duration_s):
tmin = 500.
subsample = 2000
resolution = 1.
spikes = np.load(filename)
ids = np.unique(spikes[:, 0])
dat = ch.sort_gdf_by_id(spikes, idmin=ids[0], idmax=ids[0]+subsample+1000)
bins, hist = ch.instantaneous_spike_count(dat[1], resolution, tmin=tmin, tmax=duration_s * 1000.0)
rates = ch.strip_binned_spiketrains(hist)[:subsample]
cc = np.corrcoef(rates)
cc = np.extract(1-np.eye(cc[0].size), cc)
cc[np.where(np.isnan(cc))] = 0.
return np.mean(cc)
# Values from the json file on gnode
dataset_fef_6e_corr = 0.0004061593782540619
dataset_fef_5i_corr = 0.0020706629333541817
duration_s = 10.5
# Population sizes
num_fef_5i = 3721
num_fef_6e = 16128
# Load data
nest_fef_5i_corr = load("33fb5955558ba8bb15a3fdce49dfd914682ef3ea-spikes-FEF-5I.npy", duration_s)
nest_fef_6e_corr = load("33fb5955558ba8bb15a3fdce49dfd914682ef3ea-spikes-FEF-6E.npy", duration_s)
print("FEF 5I corr coeff - NEST:%f, Dataset:%f" % (nest_fef_5i_corr, dataset_fef_5i_corr))
print("FEF 6E corr coeff - NEST:%f, Dataset:%f" % (nest_fef_6e_corr, dataset_fef_6e_corr))
The output shows fairly significant differences between the versions from the json file in the same directory:
FEF 5I corr coeff - NEST:0.001910, Dataset:0.002071
FEF 6E corr coeff - NEST:0.000156, Dataset:0.000406
Am I doing something dumb or missing something?
Thanks in advance for your help!