Skip to content

Instantly share code, notes, and snippets.

@DavidMStraub
Created November 26, 2021 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidMStraub/813bd0c4296837936a188a29c8d8b981 to your computer and use it in GitHub Desktop.
Save DavidMStraub/813bd0c4296837936a188a29c8d8b981 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# $f_\\pi$-$f_K$\n",
"\n",
"The idea is to use $f_\\pi$ from FLAG without using data and then the $f_\\pi/f_K$ average to determine the $f_\\pi$-$f_K$ correlation\n",
"\n",
"FLAG 19:\n",
"\n",
"$$f_\\pi^\\pm=130.2(0.8)$$\n",
"$$f_K^\\pm/f_\\pi^\\pm=1.1932(19)$$"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(array([130.1994679 , 155.35374008]),\n",
" array([0.800003 , 0.98593355]),\n",
" 0.9680247482084436)"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"N = 10000000\n",
"\n",
"fpi = np.random.normal(130.2, 0.8, N)\n",
"rpiK = np.random.normal(1.1932, 0.0019, N)\n",
"fK = fpi * rpiK\n",
"\n",
"mn = np.mean([fpi, fK], axis=1)\n",
"cov = np.cov([fpi, fK])\n",
"err = np.sqrt(np.diag(cov))\n",
"corr = cov[0, 1] / err[0] / err[1]\n",
"\n",
"mn, err, corr"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[1. , 0.96802475],\n",
" [0.96802475, 1. ]])"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cov / np.outer(err, err)"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
"r_check = np.random.multivariate_normal(mn, cov, N)"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(array([130.19955211, 155.35393757]), array([0.80014574, 0.98598111]))"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.mean(r_check, axis=0), np.std(r_check, axis=0)"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(1.1931987232851002, 0.0019000841634458055)"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"_x = r_check[:, 1] / r_check[:, 0]\n",
"np.mean(_x), np.std(_x)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Check in flavio"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"import flavio\n",
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"par_r = flavio.default_parameters.get_random_all(size=100000)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(1.1935458482977104, 0.0019292902546725911)"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"r = par_r['f_K+'] / par_r['f_pi+']\n",
"np.mean(r), np.std(r)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(1.1935424579239557, 0.0019221587127443874)"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"r = par_r['f_K0'] / par_r['f_pi0']\n",
"np.mean(r), np.std(r)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"1.1935483870967742"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"0.1554/0.1302"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment