Skip to content

Instantly share code, notes, and snippets.

@hagino3000
Created April 25, 2016 08:17
Show Gist options
  • Save hagino3000/82a4d7cf73ea81c8c20cc44427087288 to your computer and use it in GitHub Desktop.
Save hagino3000/82a4d7cf73ea81c8c20cc44427087288 to your computer and use it in GitHub Desktop.
Probability density of CVR 4%
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 67,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import scipy.stats\n",
"from __future__ import division"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 250人でテストしてコンバージョン率が4%のCVR分布\n",
"\n",
"4%と表記されているので250人中の10人がコンバージョンしたとする \n",
"ベルヌーイ分布のパラメータpの分布をベータ分布で求める"
]
},
{
"cell_type": "code",
"execution_count": 79,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"0.04"
]
},
"execution_count": 79,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"10/250"
]
},
{
"cell_type": "code",
"execution_count": 68,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"X = np.linspace(0, 1, 500)"
]
},
{
"cell_type": "code",
"execution_count": 83,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# beta分布\n",
"Y_CDF = scipy.stats.beta.cdf(X, 10, 240)\n",
"Y_PDF = scipy.stats.beta.pdf(X, 10, 240)"
]
},
{
"cell_type": "code",
"execution_count": 92,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.text.Text at 0x10ffc4c10>"
]
},
"execution_count": 92,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbsAAAE7CAYAAABE2S/GAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAMTQAADE0B0s6tTgAAIABJREFUeJzt3Xl8VdW9///XOklOBkOAQCCBDCQgg1ASHCooUZyr1grq\nF9uoWHHAqb/23v5wqG0daAut0vZ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+YP39+1725rKwsUlNTmTFjRtC6\nR0Wcpp3KReQr7dy5kzvuuIOHH36YYcOGuV2OSL/oyk5EetTU1ERtbS1PPvkkZ555poJOwprCTkR6\n9OCDD1JSUkJubi7f/e533S5H5JioG1NERCKeRmOKiEjEU9iJiEjEU9iJiEjEU9iJiEjEU9iJiEjE\nU9iJiEjEU9iJiEjE+/8BykHV1KKDYeUAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x10ffcea50>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.plot(X, Y_PDF)\n",
"plt.xlim(0, 0.2)\n",
"plt.ylabel(u'尤度')\n",
"plt.xlabel('Probability')"
]
},
{
"cell_type": "code",
"execution_count": 86,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"df = pd.DataFrame({'x':X, 'pdf':Y_PDF, 'cdf':Y_CDF})"
]
},
{
"cell_type": "code",
"execution_count": 91,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.0200400801603\n",
"0.0661322645291\n"
]
}
],
"source": [
"# 95%信頼区間\n",
"print(df.query('0.025 <= cdf <= 0.975').x.min())\n",
"print(df.query('0.025 <= cdf <= 0.975').x.max())"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment