In [1]:
%matplotlib inline

In [16]:
import scipy.io as sio
import numpy as np
import boltons.statsutils as bs
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-16-b93e81db01c4> in <module>()
      5 import seaborn as sns
      6 import pandas as pd
----> 7 import statsmodels

ImportError: No module named statsmodels

In [3]:
mean3307 = np.load('/home/taylorm/mcli/DJF/96z_mslp_meanPa.npy')

In [5]:
c=0

In [6]:
for x in range(0,3307):
    if mean3307[x,18,55] < 100000: #If 40,70 val < 1000 hPa
       c+=1
mu = c/30 #Occurence rate

In [21]:
from scipy.stats import poisson

a = range(0,10)
prob = poisson.cdf(a, mu)
plt.plot(prob)

#CDF of likelihood of 0-10 events of < 1000hPa each DJF season


Out[21]:
[<matplotlib.lines.Line2D at 0x7f6e35d3ef50>]

In [37]:
p1 = 0
p2 = 0
for x in range(0,3307):
    if mean3307[x,18,55] < 100000: #If 40,70 val < 1000 hPa
        p1+=1
    if mean3307[x,18,55] > 100000:
        p2+=1
prob1 = float(float(p1)/3307)
prob2 = float(float(p2)/3307)
#Binomial distribution of events < and > 1000hPa

from scipy.stats import binom

ran = range(0,3307)
pmf = binom.pmf(ran,3307,prob1) #Prob < 1000 hPa
pmf2 = binom.pmf(ran,3307,prob2) #Prob > 1000 hPa
plt.plot(pmf)
plt.plot(pmf2)


Out[37]:
[<matplotlib.lines.Line2D at 0x7f6e360cabd0>]

In [ ]:


In [ ]: