diff --git a/doc/pub/DimRed/html/._DimRed-bs018.html b/doc/pub/DimRed/html/._DimRed-bs018.html index da98177dc..99819576f 100644 --- a/doc/pub/DimRed/html/._DimRed-bs018.html +++ b/doc/pub/DimRed/html/._DimRed-bs018.html @@ -228,6 +228,7 @@ Note that the function multivariate returns also the covariance discussed
import numpy as np
import pandas as pd
+import matplotlib as plt
from IPython.display import display
n = 10000
mean = (-1, 2)
@@ -298,8 +299,8 @@ Our own code here is not very elegant and asks for improvements.
-
# extract the relevant columns from the centered design matrix of dim n x 2 x = X_centered[:,[0]]
-y = X_centered[:,[1]]
+# extract the relevant columns from the centered design matrix of dim n x 2 x = X_centered[:,0]
+y = X_centered[:,1]
Cov = np.zeros((2,2))
Cov[0,1] = np.sum(x.T@y)/(n-1.0)
Cov[0,0] = np.sum(x.T@x)/(n-1.0)
diff --git a/doc/pub/DimRed/html/DimRed-reveal.html b/doc/pub/DimRed/html/DimRed-reveal.html
index 570cd0c98..081966b55 100644
--- a/doc/pub/DimRed/html/DimRed-reveal.html
+++ b/doc/pub/DimRed/html/DimRed-reveal.html
@@ -1034,6 +1034,7 @@ Note that the function multivariate returns also the covariance discussed
import numpy as np
import pandas as pd
+import matplotlib as plt
from IPython.display import display
n = 10000
mean = (-1, 2)
@@ -1110,8 +1111,8 @@ Our own code here is not very elegant and asks for improvements.
-
# extract the relevant columns from the centered design matrix of dim n x 2 x = X_centered[:,[0]]
-y = X_centered[:,[1]]
+# extract the relevant columns from the centered design matrix of dim n x 2 x = X_centered[:,0]
+y = X_centered[:,1]
Cov = np.zeros((2,2))
Cov[0,1] = np.sum(x.T@y)/(n-1.0)
Cov[0,0] = np.sum(x.T@x)/(n-1.0)
diff --git a/doc/pub/DimRed/html/DimRed-solarized.html b/doc/pub/DimRed/html/DimRed-solarized.html
index 3fd9e4333..20dd9cedb 100644
--- a/doc/pub/DimRed/html/DimRed-solarized.html
+++ b/doc/pub/DimRed/html/DimRed-solarized.html
@@ -1014,6 +1014,7 @@ Note that the function multivariate returns also the covariance discussed
import numpy as np
import pandas as pd
+import matplotlib as plt
from IPython.display import display
n = 10000
mean = (-1, 2)
@@ -1084,8 +1085,8 @@ Our own code here is not very elegant and asks for improvements.
-
# extract the relevant columns from the centered design matrix of dim n x 2 x = X_centered[:,[0]]
-y = X_centered[:,[1]]
+# extract the relevant columns from the centered design matrix of dim n x 2 x = X_centered[:,0]
+y = X_centered[:,1]
Cov = np.zeros((2,2))
Cov[0,1] = np.sum(x.T@y)/(n-1.0)
Cov[0,0] = np.sum(x.T@x)/(n-1.0)
diff --git a/doc/pub/DimRed/html/DimRed.html b/doc/pub/DimRed/html/DimRed.html
index 728373253..25557ca0c 100644
--- a/doc/pub/DimRed/html/DimRed.html
+++ b/doc/pub/DimRed/html/DimRed.html
@@ -1019,6 +1019,7 @@ Note that the function multivariate returns also the covariance discussed
import numpy as np
import pandas as pd
+import matplotlib as plt
from IPython.display import display
n = 10000
mean = (-1, 2)
@@ -1089,8 +1090,8 @@ Our own code here is not very elegant and asks for improvements.
-
# extract the relevant columns from the centered design matrix of dim n x 2 x = X_centered[:,[0]]
-y = X_centered[:,[1]]
+# extract the relevant columns from the centered design matrix of dim n x 2 x = X_centered[:,0]
+y = X_centered[:,1]
Cov = np.zeros((2,2))
Cov[0,1] = np.sum(x.T@y)/(n-1.0)
Cov[0,0] = np.sum(x.T@x)/(n-1.0)
diff --git a/doc/pub/DimRed/ipynb/DimRed.ipynb b/doc/pub/DimRed/ipynb/DimRed.ipynb
index ae921523d..8dd93a16a 100644
--- a/doc/pub/DimRed/ipynb/DimRed.ipynb
+++ b/doc/pub/DimRed/ipynb/DimRed.ipynb
@@ -1107,6 +1107,7 @@
"source": [
"import numpy as np\n",
"import pandas as pd\n",
+ "import matplotlib as plt\n",
"from IPython.display import display\n",
"n = 10000\n",
"mean = (-1, 2)\n",
@@ -1239,8 +1240,8 @@
},
"outputs": [],
"source": [
- "# extract the relevant columns from the centered design matrix of dim n x 2 x = X_centered[:,[0]]\n",
- "y = X_centered[:,[1]]\n",
+ "# extract the relevant columns from the centered design matrix of dim n x 2 x = X_centered[:,0]\n",
+ "y = X_centered[:,1]\n",
"Cov = np.zeros((2,2))\n",
"Cov[0,1] = np.sum(x.T@y)/(n-1.0)\n",
"Cov[0,0] = np.sum(x.T@x)/(n-1.0)\n",
diff --git a/doc/pub/DimRed/ipynb/ipynb-DimRed-src.tar.gz b/doc/pub/DimRed/ipynb/ipynb-DimRed-src.tar.gz
index 2b31e7165..3f28ba9d7 100644
Binary files a/doc/pub/DimRed/ipynb/ipynb-DimRed-src.tar.gz and b/doc/pub/DimRed/ipynb/ipynb-DimRed-src.tar.gz differ
diff --git a/doc/pub/DimRed/pdf/DimRed-minted.pdf b/doc/pub/DimRed/pdf/DimRed-minted.pdf
index 99b0277f7..5b575e4c2 100644
Binary files a/doc/pub/DimRed/pdf/DimRed-minted.pdf and b/doc/pub/DimRed/pdf/DimRed-minted.pdf differ
diff --git a/doc/src/DimRed/DimRed.do.txt b/doc/src/DimRed/DimRed.do.txt
index 4f92f64ff..e5d74688d 100644
--- a/doc/src/DimRed/DimRed.do.txt
+++ b/doc/src/DimRed/DimRed.do.txt
@@ -781,6 +781,7 @@ Note that the function _multivariate_ returns also the covariance discussed abov
!bc pycod
import numpy as np
import pandas as pd
+import matplotlib as plt
from IPython.display import display
n = 10000
mean = (-1, 2)
@@ -843,8 +844,8 @@ print(np.cov(X_centered.T))
Note that the way we define the covariance matrix here has a factor $n-1$ instead of $n$.
Our own code here is not very elegant and asks for improvements.
!bc pycod
-# extract the relevant columns from the centered design matrix of dim n x 2 x = X_centered[:,[0]]
-y = X_centered[:,[1]]
+# extract the relevant columns from the centered design matrix of dim n x 2 x = X_centered[:,0]
+y = X_centered[:,1]
Cov = np.zeros((2,2))
Cov[0,1] = np.sum(x.T@y)/(n-1.0)
Cov[0,0] = np.sum(x.T@x)/(n-1.0)