diff --git a/multi-area-model.ipynb b/multi-area-model.ipynb index 96a61e24311037d2c22488385fcb878f1bfe6c4b..7ad71e44b893ea4ca56e31bd87c3cd1ce3490e28 100644 --- a/multi-area-model.ipynb +++ b/multi-area-model.ipynb @@ -172,7 +172,7 @@ "3. Replace non-simulated areas (`replace_non_simulated_areas`) <br>\n", "Replace non-simulated areas (replace_non_simulated_areas) defines how non-simulated areas will be replaced. <br>\n", "4. Simulation areas (`simulation_areas`) <br>\n", - "Simulation areas (simulation_areas) specifies the cortical areas included in the simulation process." + "Simulation areas (simulation_areas) specify the cortical areas included in the simulation process." ] }, { @@ -554,14 +554,6 @@ "rate = spikecount / M.simulation.params['dt'] * 1e3 / np.sum(M.N_vec)" ] }, - { - "cell_type": "markdown", - "id": "ca603daf", - "metadata": {}, - "source": [ - "Go back to [Notebook structure](#toc)" - ] - }, { "cell_type": "markdown", "id": "b1320ab1", @@ -612,6 +604,167 @@ "ax.legend()" ] }, + { + "cell_type": "markdown", + "id": "ae19bcc3", + "metadata": {}, + "source": [ + "### 4.2 Resting state for single area\n", + "Raster plot of spiking activity of 3% of the neurons in area V1 (A), V2 (B), and FEF (C). Blue: excitatory neurons, red: inhibitory neurons. (D-F) Spiking statistics across all 32 areas for the respective populations shown as area-averaged box plots. Crosses: medians, boxes: interquartile range (IQR), whiskers extend to the most extremeobservat ions within 1.5×IQR beyond the IQR." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1da18fee", + "metadata": {}, + "outputs": [], + "source": [ + "\"\"\"\n", + "Create raster display of a single area with populations stacked\n", + "onto each other. Excitatory neurons in blue, inhibitory\n", + "neurons in red.\n", + "\n", + "Parameters\n", + "----------\n", + "area : string {area}\n", + " Area to be plotted.\n", + "frac_neurons : float, [0,1]\n", + " Fraction of cells to be considered.\n", + "t_min : float, optional\n", + " Minimal time in ms of spikes to be shown. Defaults to 0 ms.\n", + "t_max : float, optional\n", + " Minimal time in ms of spikes to be shown. Defaults to simulation time.\n", + "output : {'pdf', 'png', 'eps'}, optional\n", + " If given, the function stores the plot to a file of the given format.\n", + "\n", + "\"\"\"\n", + "area = 'V1'\n", + "frac_neurons = 0.03\n", + "M.analysis.single_dot_display(area, frac_neurons, t_min=500., t_max='T')\n", + "\n", + "area = 'V2'\n", + "frac_neurons = 0.03\n", + "M.analysis.single_dot_display(area, frac_neurons, t_min=500., t_max='T')\n", + "\n", + "area = 'FEF'\n", + "frac_neurons = 0.03\n", + "M.analysis.single_dot_display(area, frac_neurons, t_min=500., t_max='T')" + ] + }, + { + "cell_type": "markdown", + "id": "019d805e", + "metadata": {}, + "source": [ + "### 4.3 Firing rates for the whole population\n", + "Population-averaged firing rates" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "95c57114", + "metadata": {}, + "outputs": [], + "source": [ + "\"\"\"\n", + "Calculate time-averaged population rates and store them in member pop_rates.\n", + "If the rates had previously been stored with the same\n", + "parameters, they are loaded from file.\n", + "\n", + "Parameters\n", + "----------\n", + "t_min : float, optional\n", + " Minimal time in ms of the simulation to take into account\n", + " for the calculation. Defaults to 500 ms.\n", + "t_max : float, optional\n", + " Maximal time in ms of the simulation to take into account\n", + " for the calculation. Defaults to the simulation time.\n", + "compute_stat : bool, optional\n", + " If set to true, the mean and variance of the population rate\n", + " is calculated. Defaults to False.\n", + " Caution: Setting to True slows down the computation.\n", + "areas : list, optional\n", + " Which areas to include in the calculcation.\n", + " Defaults to all loaded areas.\n", + "pops : list or {'complete'}, optional\n", + " Which populations to include in the calculation.\n", + " If set to 'complete', all populations the respective areas\n", + " are included. Defaults to 'complete'.\n", + "\"\"\"\n", + "M.analysis.create_pop_rates(t_min=1000.)\n", + "# M.analysis.save()" + ] + }, + { + "cell_type": "markdown", + "id": "06a595de", + "metadata": {}, + "source": [ + "### 4.4 Average pairwise correlation coefficients of spiking activity" + ] + }, + { + "cell_type": "markdown", + "id": "a3847e67", + "metadata": {}, + "source": [ + "### 4.5 Irregularity measured by revised local variation LvR averaged across neurons" + ] + }, + { + "cell_type": "markdown", + "id": "90ae8f4c", + "metadata": {}, + "source": [ + "### 4.6 Time series of population- and area-averaged firing rates.\n", + "Area-averaged firing rates, shown as raw binned spike histograms with 1ms bin width (gray) and convolved histograms, with aGaussian kernel (black) of optimal width" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bd9d4912", + "metadata": {}, + "outputs": [], + "source": [ + "\"\"\"\n", + "Calculate time series of population- and area-averaged firing rates.\n", + "Uses ah.pop_rate_time_series.\n", + "If the rates have previously been stored with the\n", + "same parameters, they are loaded from file.\n", + "\n", + "\n", + "Parameters\n", + "----------\n", + "t_min : float, optional\n", + " Minimal time in ms of the simulation to take into account\n", + " for the calculation. Defaults to 500 ms.\n", + "t_max : float, optional\n", + " Maximal time in ms of the simulation to take into account\n", + " for the calculation. Defaults to the simulation time.\n", + "areas : list, optional\n", + " Which areas to include in the calculcation.\n", + " Defaults to all loaded areas.\n", + "pops : list or {'complete'}, optional\n", + " Which populations to include in the calculation.\n", + " If set to 'complete', all populations the respective areas\n", + " are included. Defaults to 'complete'.\n", + "kernel : {'gauss_time_window', 'alpha_time_window', 'rect_time_window'}, optional\n", + " Specifies the kernel to be convolved with the spike histogram.\n", + " Defaults to 'binned', which corresponds to no convolution.\n", + "resolution: float, optional\n", + " Width of the convolution kernel. Specifically it correponds to:\n", + " - 'binned' : bin width of the histogram\n", + " - 'gauss_time_window' : sigma\n", + " - 'alpha_time_window' : time constant of the alpha function\n", + " - 'rect_time_window' : width of the moving rectangular function\n", + "\"\"\"\n", + "M.analysisi.create_rate_time_series(t_max=1000.)\n", + "# M.analysis.save()" + ] + }, { "cell_type": "markdown", "id": "ef74ca3e-98dc-49c9-a4a0-2c640e29b1d9",