首页 > > 详细

代写18-698 / 42-632 Neural Signal Processing Spring 2025 Problem Set 2帮做Matlab编程

项目预算:   开发周期:  发布时间:   要求地区:

18-698 / 42-632

Neural Signal Processing

Spring 2025

Problem Set 2

This problem set is due on Tuesday, February 25, 11:59pm.

Be sure to show your work and include all Matlab code and plots. Also, please carefully label the plot axes with units.

If you have questions, please post them on the Piazza Q&A webpage, rather than emailing the course staff. This will allow other students with the same question to see the response and any ensuing discussion.

Please submit your work as a single PDF file on Gradescope, which is linked from Canvas. When preparing your solutions, please complete each problem on a separate page. Grade-scope will ask you select the pages that contain the solution to each problem.

Submissions can be written in LaTeX or they can be handwritten and scanned. Handwritten work should be clearly labeled and legible.

1. Please justify each answer below with a short mathematical explanation.

(a) (5 points) For a homogeneous Poisson process,

i. Are the inter-spike intervals (t1, t2, . . .) independent?

ii. Are the spike times (T1, T2, . . .) independent?

iii. Are the inter-spike intervals (t1, t2, . . .) independent given that N spikes were observed in [0, T ]?

iv. Are the spike times (T1, T2, . . .) independent given that N spikes were ob-served in [0, T ]?

(b) (10 points) For an inhomogeneous Poisson process,

i. Are the inter-spike intervals (t1, t2, . . .) independent?

ii. Are the spike times (T1, T2, . . .) independent?

iii. Are the inter-spike intervals (t1, t2, . . .) independent given that N spikes were observed in [0, T ]?

iv. Are the spike times (T1, T2, . . .) independent given that N spikes were ob-served in [0, T ]?

2. Homogeneous Poisson process

We will consider a simulated neuron that has a cosine tuning curve described in equa-tion (1.15) in TN:

                             (1)

where λ is the firing rate (in spikes per second), s is the reaching angle of the arm, smax is the reaching angle associated with the maximum response rmax, and r0 is an offset that shifts the tuning curve up from the zero axis. Let r0 = 30, rmax = 50, and smax = π/2.

(a) (5 points) Spike trains

For each of the following reaching angles (s = k ∗ π/4, where k = 0, 1, . . . , 7), generate 100 spike trains according to a homogeneous Poisson process. Each spike train should have a duration of 1 second. Plot 5 spike trains for each reaching angle in the same format as shown in Figure 1.6(A) in TN.

(b) (5 points) Spike histogram

For each reaching angle, find the spike histogram by taking spike counts in non-overlapping 20 ms bins, then averaging across the 100 trials. Plot the 8 resulting spike histograms around a circle, as in part (a). The spike histograms should have firing rate (in spikes / second) as the vertical axis and time (in msec, not time bin index) as the horizontal axis. The bar command in Matlab can be used to plot histograms.

(c) (5 points) Tuning curve

For each trial, count the number of spikes across the entire trial. Plots these points on the axes shown in Figure 1.6(B) in TN. There should be 800 points in the plot (but some points may be on top of each other due to the discrete nature of spike counts). For each reaching angle, find the mean firing rate across the 100 trials, and plot the mean firing rate using a red point on the same plot. Now, plot the tuning curve (defined in (1)) of this neuron in green on the same plot. Do the mean firing rates lie near the tuning curve?

(d) (5 points) Count distribution

For each reaching angle, plot the normalized distribution (i.e., normalized so that the area under the distribution equals one) of spike counts (using the same counts from part (c)). Plot the 8 distributions around a circle, as in part (a). Fit a Poisson distribution to each empirical distribution and plot it on top of the corresponding empirical distribution. Are the empirical distributions well-fit by Poisson distributions?

(e) (5 points) Fano factor

For each reaching angle, find the mean and variance of the spike counts across the 100 trials (using the same spike counts from part (c)). Plot the obtained mean and variance on the axes shown in Figure 1.14(A) in TN. There should be 8 points in this plot – one per reaching angle. Do these points lie near the 45 deg diagonal, as would be expected of a Poisson distribution?

(f) (5 points) Interspike interval (ISI) distribution

For each reaching angle, plot the normalized distribution of ISIs. Plot the 8 distributions around a circle, as in part (a). Fit an exponential distribution to each empirical distribution and plot it on top of the corresponding empirical distribution. Are the empirical distributions well-fit by exponential distributions?

(g) (5 points) Coefficient of variation (CV)

For each reaching angle, find the average ISI and CV of the ISIs. Plot the resulting values on the axes shown in Figure 1.16 in TN. There should be 8 points in this plot. Do the CV values lie near unity, as would be expected of a Poisson process?

3. Inhomogeneous Poisson process

In this problem, we will use the same simulated neuron as in Problem 2, but now the reaching angle s will be time-dependent with the following form.

                          (2)

where t ranges between 0 and 1 second.

(a) (5 points) Spike trains

Generate 100 spike trains, each 1 second in duration, according to an inhomoge-neous Poisson process with a firing rate profile defined by (1) and (2). Plot 5 of the generated spike trains.

(b) (5 points) Spike histogram

Plot the spike histogram by taking spike counts in non-overlapping 20 ms bins, then averaging across the 100 trials. The spike histogram should have firing rate (in spikes / second) as the vertical axis and time (in msec, not time bin index) as the horizontal axis. Plot the expected firing rate profile defined by (1) and (2) on the same plot. Does the spike histogram agree with the expected firing rate profile?

(c) (5 points) Count distribution

For each trial, count the number of spikes across the entire trial. Plot the nor-malized distribution of spike counts. Fit a Poisson distribution to this empirical distribution and plot it on top of the empirical distribution. Should we expect the spike counts to be Poisson-distributed?

(d) (5 points) ISI distribution

Plot the normalized distribution of ISIs. Fit an exponential distribution to the empirical distribution and plot it on top of the empirical distribution. Should we expect the ISIs to be exponentially-distributed?

4. Real neural data

We will analyze real neural data recorded using a 100-electrode array in premotor cortex of a macaque monkey. The dataset can be found on Canvas under “Files → Data sets → ps2 data.mat”.

The following describes the data format. The .mat file has a single variable named trial, which is a structure of dimensions (182 trials) × (8 reaching angles). The structure contains spike trains recorded from a single neuron while the monkey reached 182 times along each of 8 different reaching angles (where the trials of different reaching angles were interleaved). The spike train for the nth trial of the kth reaching angle is contained in trial(n,k).spikes, where n = 1, . . . , 182 and k = 1, . . . , 8. The indices k = 1, . . . , 8 correspond to reaching angles respectively. The reaching angles are not evenly spaced around the circle due to experimental constraints that are beyond the scope of this problem set.

A spike train is represented as a sequence of zeros and ones, where time is discretized in 1 ms steps. A zero indicates that the neuron did not spike in the 1 ms bin, whereas a one indicates that the neuron spiked once in the 1 ms bin. Due to the refractory period, it is not possible for a neuron to spike more than once within a 1 ms bin. Each spike train is 500 ms long and is, thus, represented by a 1 × 500 vector.

(a) (5 points) Spike trains

Plot 5 spike trains for each reaching angle in the same format as shown in Fig-ure 1.6(A) in TN.

(b) (5 points) Spike histogram

For each reaching angle, find the spike histogram by taking spike counts in non-overlapping 20 ms bins, then averaging across the 182 trials. The spike histograms should have firing rate (in spikes / second) as the vertical axis and time (in msec, not time bin index) as the horizontal axis. Plot the 8 resulting spike histograms around a circle, as in part (a).

(c) (5 points) Tuning curve

For each trial, count the number of spikes across the entire trial. Plots these points on the axes shown in Figure 1.6(B) in TN. There should be 182 ∗ 8 points in the plot (but some points may be on top of each other due to the discrete nature of spike counts). For each reaching angle, find the mean firing rate across the 182 trials, and plot the mean firing rate using a red point on the same plot.

Then, fit the cosine tuning curve (1) to the 8 red points by minimizing the sum of squared errors

with respect to the parameters r0, rmax, and smax. (Hint: this can be done using linear regression.) Plot the resulting tuning curve of this neuron in green on the same plot.

(d) (5 points) Count distribution

For each reaching angle, plot the normalized distribution of spike counts (using the same counts from part (c)). Plot the 8 distributions around a circle, as in part (a). Fit a Poisson distribution to each empirical distribution and plot it on top of the corresponding empirical distribution. Why might the empirical distributions differ from the idealized Poisson distributions?

(e) (5 points) Fano factor

For each reaching angle, find the mean and variance of the spike counts across the 182 trials (using the same spike counts from part (c)). Plot the obtained mean and variance on the axes shown in Figure 1.14(A) in TN. There should be 8 points in this plot – one per reaching angle. Do these points lie near the 45 deg diagonal, as would be expected of a Poisson distribution?

(f) (5 points) Interspike interval (ISI) distribution

For each reaching angle, plot the normalized distribution of ISIs. Plot the 8 distributions around a circle, as in part (a). Fit an exponential distribution to each empirical distribution and plot it on top of the corresponding empirical distribution. Why might the empirical distributions differ from the idealized exponential distributions?





软件开发、广告设计客服
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 9951568
© 2021 www.rj363.com
软件定制开发网!