Question: D = 1 # microns - ( 2 ) / ( s ) ; lengths are measured in microns T = 5 #s dt =

D=1# microns -(2)/(s); lengths are measured in microns
T=5#s
dt=0.02#s (same as 20ms)
[4]: # three random walks
for _() in range(3):
xs, ys = rw_(2)d(D,T,dt)
plt.plot(xs,ys)
plt.gca().set_(a)spect(1) #sets the aspect ratio
plt.xlabel('x (microns)')
plt.ylabel('y (microns)')1. From trajectories to diffusion coefficients, part I: linear fit (4 points)
Let's call a set of 10 independent trajectories with the parameters above one "experiment". From each experiment, we can calculate the MSD of the ten trajectories \(\left\langle r^{2}(t)\right\rangle \), where \( r^{2}=x^{2}+y^{2}\) as before. Since the MSD, for an extremely large number of trajectories, would approach \(4 D t \), a sensible estimate of D is \(\hat{D}=\) best-fit slope of \( r^{2}\) vs \( t \), divided by 4.("Best-fit" = linear regression; in Python you can use scipy. stats.linregress. (The 'hat' on the variable defined above signifies that it is an estimate of the true underlying \( D \) and in general will differ from \( D \).) Write a program that uses this approach to estimate D.
i. Suppose we only have resources to generate one experiment in the real world, with 10 independent tracks measured in that experiment. We want to know how well the estimate from the linear fit above, applied to a single experiment, might match the true value of \( D \). To do so, simulate 400 independent experiments (each with 10 independent trajectories) and collect the estimate \(\hat{D}\) from each experiment. Generate and submit a histogram of the \(\hat{D}\) values (you could use e.g. matplotlib. pyplot . hist; you can choose the number of bins to make sure most bins have a few hits atleast). Also calculate and report the mean and standard deviation of the estimates across the 400 experiments. How does the average \(\hat{D}\) from the 400 experiments compare to the true value of \( D \)? If you only ran one experiment, your estimate would fall within one standard deviation of the estimated mean about \(68\%\) of the time, so the standard deviation provides an estimation of how accurate your linear fit procedure would be. ii. A friend argues, "why don't you perform a linear fit of \( r^{2}(t)\) against \( t \) for each of your ten trajectories, and then average the resulting ten estimates to get \(\hat{D}\) for the experiment? You're averaging over more fits within each experiment, so you would get better statistics." What is the flaw in this argument? Repeat part i., but now generate a \( D \) estimate from each experiment by perform ten fits for the individual trajectories and averaging over the 10 resulting \(\hat{D}\) values. Is the spread of \( D \) estimates over the 400 experiments better, worse, or the same as in i.?
D = 1 # microns - ( 2 ) / ( s ) ; lengths are

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!