1. Statistical Thinking in Python (Part 2)

    Parameter estimation by optimization

    nohitter_times is an array with length of 251. array([ 843, 1613, 1101, 215, 684, 814,..])

    # Seed random number generator
    np.random.seed(42)
    
    # Compute mean no-hitter time: tau
    tau = np.mean(nohitter_times)
    
    # Draw out of an exponential distribution with parame*ter tau: inter_nohitter_time
    inter_nohitter_time = np.random …
    Tagged as : Statistics Python
  2. Statistical Thinking in Python (Part 1)

    Graphical exploratory data analysis

    Histogram
    # Import plotting modules
    import matplotlib.pyplot as plt
    import seaborn as sns
    
    # Set default Seaborn style
    sns.set()
    
    # Compute number of data points: n_data
    n_data = len(versicolor_petal_length)
    
    # Number of bins is the square root of number of data points: n_bins
    n_bins = np.sqrt(n_data)
    
    # Convert …
    Tagged as : Statistics Python

Pages