Get startedGet started for free

Parameter estimation: active bout length

Compute the mean active bout length for wild type and mutant, with 95% bootstrap confidence interval. The datasets are again available in the numpy arrays bout_lengths_wt and bout_lengths_mut. The dc_stat_think module has been imported as dcst.

This exercise is part of the course

Case Studies in Statistical Thinking

View Course

Exercise instructions

  • Compute the mean active bout length for wild type and mutant using np.mean(). Store the results as mean_wt and mean_mut.
  • Draw 10,000 bootstrap replicates for each using dcst.draw_bs_reps(), storing the results as bs_reps_wt and bs_reps_mut.
  • Compute a 95% confidence interval from the bootstrap replicates using np.percentile(), storing the results as conf_int_wt and conf_int_mut.
  • Print the mean and confidence intervals to the screen.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Compute mean active bout length
mean_wt = ____
mean_mut = ____

# Draw bootstrap replicates
bs_reps_wt = ____(____, ____, size=____)
bs_reps_mut = ____

# Compute 95% confidence intervals
conf_int_wt = ____(____, [____, ____])
conf_int_mut = ____

# Print the results
print("""
wt:  mean = {0:.3f} min., conf. int. = [{1:.1f}, {2:.1f}] min.
mut: mean = {3:.3f} min., conf. int. = [{4:.1f}, {5:.1f}] min.
""".format(mean_wt, *conf_int_wt, mean_mut, *conf_int_mut))
Edit and Run Code