<jupyter_start><jupyter_text>Tuning Curve, Week 2 Tutorial 3 In this notebook we will illustrate simple spike analysis for repeated Trials.  Libraries<jupyter_code># LIBRARY

import numpy as np # vector manipulation
from scipy.stats import norm # Psychometric Function
from scipy.stats import poisson

# THIS IS FOR PLOTTING
%matplotlib inline
import matplotlib.pyplot as plt # side-stepping mpl backend
import warnings
warnings.filterwarnings("ignore")<jupyter_output><empty_output><jupyter_text>Gaussian Tunning FunctionTo simulate a single 1000ms trial we generate a matrix of 1000 time 100 trials random numbers between 0 and 1.<jupyter_code>Orientation=np.arange(-40,40,1)
Max_Firing=60
Preferred_Direction=0
tunning_curve= Max_Firing*norm.pdf(Orientation,Preferred_Direction,10)/max(norm.pdf(Orientation,Preferred_Direction,10))
fig = plt.figure(figsize=(8,4)) # This setups the size of the figure
plt.plot(Orientation,tunning_curve,'-',color='black')
plt.xlabel('Orientation')
plt.ylabel('Firing Rate (Hz)')
plt.show() # This plots the figure<jupyter_output><empty_output><jupyter_text>Sigmoid Tunning FunctionA neuron will only fire if the probability is below the threshold.We set the neuron to have 0 spikes at all 1000 time points and 100 trials.<jupyter_code>Disparity=np.arange(-1,1,0.025)

Disparity_tunning_curve= 40*norm.cdf(Disparity,0,0.2)



fig = plt.figure(figsize=(8,4)) # This setups the size of the figure
plt.plot(Disparity,Disparity_tunning_curve,'-',color='black')
plt.xlabel('Disparity')
plt.ylabel('Firing Rate (Hz)')
plt.show() # This plots the figure<jupyter_output><empty_output><jupyter_text>Problem 1Plot a gaussian tuning for oriention with a max firing rate of 50Hz at 10 degrees and a baseline firing rate of 10Hz with a standard deviation of 5 degrees.<jupyter_code>Orientation=np.arange(-40,40,1)
##############################################################################
## INSERT: Plot a gaussian tuning for oriention with a max firing rate of 50Hz 
## at 10 degrees and a baseline firing rate of 10Hz with a standard deviation of 5 degrees.
##############################################################################
#######################ANSWER#################################



#######################ANSWER#################################

fig = plt.figure(figsize=(8,4)) # This setups the size of the figure
plt.plot(Orientation,tunning_curve,'-',color='black')
plt.xlabel('Orientation')
plt.ylabel('Firing Rate (Hz)')
plt.show() # This plots the figure<jupyter_output><empty_output><jupyter_text>--- SummaryIn this tutorial, we learned:* To plot and manipulate a neuronal Tuning function.  ReferencesBritten, <NAME>., et al. "The analysis of visual motion: a comparison of neuronal and psychophysical performance." Journal of Neuroscience 12.12 (1992): 4745-4765.<jupyter_code><jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18080279232111693, 'fraction_numerical': 0.030715532286212915, 'mean_word_length': 7.3313953488372094, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '190377', 'license': 'MIT', 'n_tokens_mistral': 957, 'n_tokens_neox': 834, 'n_words': 263, 'path': 'W2T3 Tuning Curve.ipynb', 'repo_name': 'vishrawji/Basic-Introdyction-to-Python', 'size': '2868'}