You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Assume we are given SNP matrix $G \\in \\mathbb{R}^{N,D}$. Standardizing it, will set the mean $\\mu$ to zero and the variance to one for each SNP $j$.\n",
15
-
"\n",
16
-
"The sample variance for SNP $j$ ($\\text{var}_j$) is defined as:\n",
"# this may not hold true for other standardizers (e.g. beta)...\n",
72
-
"\n",
73
-
"import numpy as np\n",
74
-
"from pysnptools.standardizer import Beta\n",
75
-
"\n",
76
-
"N = 10\n",
77
-
"D = 100\n",
78
-
"\n",
79
-
"np.random.seed(42)\n",
80
-
"m = np.random.random((N,D))\n",
81
-
"\n",
82
-
"mu = Beta().standardize(m.copy())\n",
83
-
"\n",
84
-
"# get factor\n",
85
-
"d2 = np.sum(mu**2) / float(N)\n",
86
-
"\n",
87
-
"print \"factor: \", d2, \"!= D\"\n"
88
-
],
89
-
"language": "python",
90
-
"metadata": {},
91
-
"outputs": [
92
-
{
93
-
"output_type": "stream",
94
-
"stream": "stdout",
95
-
"text": [
96
-
"factor: 0.0624957032658 != D\n"
97
-
]
98
-
}
99
-
],
100
-
"prompt_number": 29
101
-
},
102
-
{
103
-
"cell_type": "code",
104
-
"collapsed": false,
105
-
"input": [],
106
-
"language": "python",
107
-
"metadata": {},
108
-
"outputs": []
109
-
}
110
-
],
111
-
"metadata": {}
112
-
}
113
-
]
114
-
}
1
+
{
2
+
"cells": [
3
+
{
4
+
"cell_type": "markdown",
5
+
"metadata": {},
6
+
"source": [
7
+
"Assume we are given SNP matrix $G \\in \\mathbb{R}^{N,D}$. Standardizing it, will set the mean $\\mu$ to zero and the variance to one for each SNP $j$.\n",
8
+
"\n",
9
+
"The sample variance for SNP $j$ ($\\text{var}_j$) is defined as:\n",
0 commit comments