daviddalpiaz / appliedstats Goto Github PK
View Code? Open in Web Editor NEW:bar_chart: Methods of Applied Statistics Course Textbook Repository
Home Page: https://book.stat420.org/
:bar_chart: Methods of Applied Statistics Course Textbook Repository
Home Page: https://book.stat420.org/
Some steps to be taken:
.travis.yaml
by deleting itdeployment/
folder.github/workflows/bookdown.yaml
Notes:
bookdown
action to avoid reliance on Netlify.gh-pages
branch as it contains old artifacts.It's time to update this over to using quarto...
Put calculated values into traditional table to bridge gap between R and the usual table.
On 8.7 "We modify our notation slightly to make it clear that the the predicted value is a function of", there is double words "the", I tested on IE and Chrome, both displayed double "the".
When you perform a clean build from index.Rmd the file data/example-data.csv shows up as an untracked file.
I would expect things to be clean after a book build.
It looks like there is a very similar and possibly unused file called data/example_data.csv The only difference is between an underbar and a minus.
Show sample mean, standard deviation, finding minimum as matrix operations. Inspiration: http://genomicsclass.github.io/book/pages/matrix_algebra_examples.html
If you click on the hyperlink RStudio “cheatsheets”in section 6.5, it redirects to an old page which is not present anymore.
The old page URL is:
https://www.rstudio.com/wp-content/uploads/2016/01/rstudio-IDE-cheatsheet.pdf
However, Rstudio seems to have updated this cheatsheet to a new URL, which is as follows:
https://www.rstudio.com/wp-content/uploads/2019/01/Cheatsheets_2019.pdf
This can be easily updated in the r-resources.Rmd file.
Absent are the justification behind the MLR matrix calculations. Within the above deck, I've written out the derivation for an MLR function.
Add reference for numeric MLE solving.
Bold Greek characters with MathJax: http://www.onemathematicalcat.org/MathJaxDocumentation/TeXSyntax.htm
Use
Make links to outside domains have target = "_blank"
http://stackoverflow.com/questions/4425198/markdown-target-blank
The file applied_statistics.rds shows up with version control status when you do a build. Should this file be git ignored?
Add guide in #79 (comment) to the front matter with a link in the lower left for "spot a typo?"
Potentially, might want to add in hypothes.is (e.g. a "suggest"/annotation layer.)
Interactive vs. stagnate plots requires use of rgl
To use with rmarkdown, might need to enable hook_webgl()
? Need fallback for pdf version. (JS Error)
open3d()
x = rnorm(100)
y = rnorm(100)
z = 0.2*x - 0.3*y + rnorm(100, sd = 0.3)
fit = lm(z ~ x + y)
plot3d(x, y, z, type = "s", col = "red", size = 1)
coefs = coef(fit)
a = coefs["x"]
b = coefs["y"]
c = -1
d = coefs["(Intercept)"]
planes3d(a, b, c, d, alpha = 0.5)
Better version in car::scatter3d
:
http://www.inside-r.org/packages/cran/car/docs/identify3d
See:
http://www.ats.ucla.edu/stat/r/dae/intreg.htm
For anova plot
Add Example, Discussion
Change \[ \] to $$ $$ where it still exists.
Seemingly random permissions error when creating .R file. (Quits at random line.)
TODO: coercion
seems to be left unresolved.
appliedstats/data-and-programming.Rmd
Line 210 in 53b7a49
However, I think there is an explanation for coercion as follows.
appliedstats/data-and-programming.Rmd
Lines 212 to 217 in 53b7a49
Should we delete the TODO line or fix something more?
Looks like some equations do not use valid latex for epub.
I think \bf
needs to be switched to \boldsymbol{}
. Not a show-stopper.
[WARNING] Could not convert TeX math '
(\alpha \beta)_{1j} + (\alpha \beta)_{2j} + (\alpha \beta)_{3j} = 0 \\
(\alpha \beta)_{i1} + (\alpha \beta)_{i2} + (\alpha \beta)_{i3} + (\alpha \beta)_{i4} = 0
', rendering as TeX:
(\alpha \beta)_{1j} + (\alpha \beta)_{2j
^
unexpected "("
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
Y \mid {\bf X} = {\bf x} \sim N(\beta_0 + \beta_1x_1 + \ldots + \beta_{p - 1}x_{p - 1}, \ \sigma^2)
', rendering as TeX:
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x})', rendering as TeX:
\eta({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x}) = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \ldots + \beta_{p - 1} x_{p - 1}', rendering as TeX:
\eta({\bf x}) = \beta_0 + \beta_1 x_1 +
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x})', rendering as TeX:
\eta({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\text{E}[Y \mid {\bf X} = {\bf x}]', rendering as TeX:
ext{E}[Y \mid {\bf X} = {\bf x}]
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\eta({\bf x}) = g\left(\text{E}[Y \mid {\bf X} = {\bf x}]\right).
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'Y \mid {\bf X} = {\bf x}', rendering as TeX:
Y \mid {\bf X} = {\bf x}
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'N(\mu({\bf x}), \sigma^2)', rendering as TeX:
N(\mu({\bf x}), \sigma^2)
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\text{Pois}(\lambda({\bf x}))', rendering as TeX:
Pois}(\lambda({\bf x}))
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\text{Bern}(p({\bf x}))', rendering as TeX:
\text{Bern}(p({\bf x}))
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\text{E}[Y \mid {\bf X} = {\bf x}]', rendering as TeX:
ext{E}[Y \mid {\bf X} = {\bf x}]
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\mu({\bf x})', rendering as TeX:
\mu({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\lambda({\bf x})', rendering as TeX:
\lambda({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'p({\bf x})', rendering as TeX:
p({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x}) = \mu({\bf x})', rendering as TeX:
\eta({\bf x}) = \mu({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x}) = \log(\lambda({\bf x}))', rendering as TeX:
\eta({\bf x}) = \log(\lambda({\bf x}))
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x}) = \log \left(\frac{p({\bf x})}{1 - p({\bf x})} \right)', rendering as TeX:
\eta({\bf x}) = \log \left(\frac{p({\bf
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\mu({\bf x}) = \eta({\bf x})', rendering as TeX:
\mu({\bf x}) = \eta({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\lambda({\bf x}) = e^{\eta({\bf x})}', rendering as TeX:
\lambda({\bf x}) = e^{\eta({\bf x})}
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'p({\bf x}) = \frac{e^{\eta({\bf x})}}{1 + e^{\eta({\bf x})}} = \frac{1}{1 + e^{-\eta({\bf x})}}', rendering as TeX:
p({\bf x}) = \frac{e^{\eta({\bf x})}}{1
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x})', rendering as TeX:
\eta({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\eta({\bf x}) = g\left(\text{E}[Y \mid {\bf X} = {\bf x}]\right).
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\text{E}[Y \mid {\bf X} = {\bf x}] = g^{-1}(\eta({\bf x})).
', rendering as TeX:
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
p({\bf x}) = P[Y = 1 \mid {\bf X} = {\bf x}]
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
P[Y = 0 \mid {\bf X} = {\bf x}] + P[Y = 1 \mid {\bf X} = {\bf x}] = 1
', rendering as TeX:
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
P[Y = 0 \mid {\bf X} = {\bf x}] = 1 - p({\bf x})
', rendering as TeX:
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\log\left(\frac{p({\bf x})}{1 - p({\bf x})}\right) = \beta_0 + \beta_1 x_1 + \ldots + \beta_{p - 1} x_{p - 1}
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\frac{p({\bf x})}{1 - p({\bf x})} = \frac{P[Y = 1 \mid {\bf X} = {\bf x}]}{P[Y = 0 \mid {\bf X} = {\bf x}]}
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'p({\bf x})', rendering as TeX:
p({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
Y \mid {\bf X} = {\bf x} \sim N(\beta_0 + \beta_1x_1 + \ldots + \beta_qx_q, \ \sigma^2).
', rendering as TeX:
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'p({\bf x})', rendering as TeX:
p({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\log\left(\frac{p({\bf x})}{1 - p({\bf x})}\right) = \beta_0 + \beta_1 x_1 + \ldots + \beta_{q} x_{q}
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'p({\bf x})', rendering as TeX:
p({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
p({\bf x}) = P[Y = 1 \mid {\bf X} = {\bf x}] = \frac{e^{\beta_0 + \beta_1 x_{1} + \cdots + \beta_{p-1} x_{(p-1)}}}{1 + e^{\beta_0 + \beta_1 x_{1} + \cdots + \beta_{p-1} x_{(p-1)}}}
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\log\left(\frac{p({\bf x_i})}{1 - p({\bf x_i)})}\right) = \beta_0 + \beta_1 x_{i1} + \cdots + \beta_{p-1} x_{i(p-1)}
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'P[Y_i = 1 \mid {\bf X_i} = {\bf x_i}]', rendering as TeX:
[Y_i = 1 \mid {\bf X_i} = {\bf x_i}]
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
p({\bf x_i}) = P[Y_i = 1 \mid {\bf X_i} = {\bf x_i}] = \frac{e^{\beta_0 + \beta_1 x_{i1} + \cdots + \beta_{p-1} x_{i(p-1)}}}{1 + e^{\beta_0 + \beta_1 x_{i1} + \cdots + \beta_{p-1} x_{i(p-1)}}}
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
1 - p({\bf x_i}) = P[Y_i = 0 \mid {\bf X} = {\bf x_i}] = \frac{1}{1 + e^{\beta_0 + \beta_1 x_{i1} + \cdots + \beta_{p-1} x_{i(p-1)}}}
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
L(\boldsymbol{{\beta}}) = \prod_{i = 1}^{n} P[Y_i = y_i \mid {\bf X_i} = {\bf x_i}]
', rendering as TeX:
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
L(\boldsymbol{{\beta}}) = \prod_{i = 1}^{n} p({\bf x_i})^{y_i} (1 - p({\bf x_i}))^{(1 - y_i)}
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
L(\boldsymbol{{\beta}}) = \prod_{i : y_i = 1}^{n} p({\bf x_i}) \prod_{j : y_j = 0}^{n} (1 - p({\bf x_j}))
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
{\bf x_i}^{\top} \boldsymbol{{\beta}^*} > 0 \implies y_i = 1
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
{\bf x_i}^{\top} \boldsymbol{{\beta}^*} < 0 \implies y_i = 0
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\text{E}[Y \mid {\bf X} = {\bf x}]', rendering as TeX:
ext{E}[Y \mid {\bf X} = {\bf x}]
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\text{E}[Y \mid {\bf X} = {\bf x}] = P[Y = 1 \mid {\bf X} = {\bf x}]', rendering as TeX:
ext{E}[Y \mid {\bf X} = {\bf x}] = P[Y =
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\begin{aligned}
\text{E}[Y \mid {\bf X} = {\bf x}] &= 1 \cdot P[Y = 1 \mid {\bf X} = {\bf x}] + 0 \cdot P[Y = 0 \mid {\bf X} = {\bf x}] \\
&= P[Y = 1 \mid {\bf X} = {\bf x}]
\end{aligned}
', rendering as TeX:
egin{aligned}
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\text{E}[Y \mid {\bf X} = {\bf x}]', rendering as TeX:
ext{E}[Y \mid {\bf X} = {\bf x}]
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'P[Y = 1 \mid {\bf X} = {\bf x}]', rendering as TeX:
P[Y = 1 \mid {\bf X} = {\bf x}]
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\log\left(\frac{p({\bf x})}{1 - p({\bf x})}\right) = -2 + 3 x
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\begin{aligned}
Y_i \mid {\bf X_i} = {\bf x_i} &\sim \text{Bern}(p_i) \\
p_i &= p({\bf x_i}) = \frac{1}{1 + e^{-\eta({\bf x_i})}} \\
\eta({\bf x_i}) &= -2 + 3 x_i
\end{aligned}
', rendering as TeX:
\begin{aligned}
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\hat{\eta}({\bf x}) = \log\left(\frac{\hat{p}({\bf x})}{1 - \hat{p}({\bf x})}\right)', rendering as TeX:
\hat{\eta}({\bf x}) = \log\left(\frac{\h
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\hat{p}({\bf x}) = \frac{e^{\hat{\eta}({\bf x})}}{1 + e^{\hat{\eta}({\bf x})}} = \frac{1}{1 + e^{-\hat{\eta}({\bf x})}}', rendering as TeX:
\hat{p}({\bf x}) = \frac{e^{\hat{\eta}({
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'P[Y = 1 \mid {\bf X} = {\bf x}]', rendering as TeX:
P[Y = 1 \mid {\bf X} = {\bf x}]
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\hat{\text{E}}[Y \mid {\bf X} = {\bf x}]', rendering as TeX:
xt{E}}[Y \mid {\bf X} = {\bf x}]
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'P[Y = 1 \mid {\bf X} = {\bf x}]', rendering as TeX:
P[Y = 1 \mid {\bf X} = {\bf x}]
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\log\left(\frac{\hat{p}({\bf x})}{1 - \hat{p}({\bf x})}\right) = -2.3 + 3.7 x
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\hat{p}({\bf x})', rendering as TeX:
\hat{p}({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\log\left(\frac{p({\bf x})}{1 - p({\bf x})}\right) = 1 + -4 x.
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\begin{aligned}
Y_i \mid {\bf X_i} = {\bf x_i} &\sim \text{Bern}(p_i) \\
p_i &= p({\bf x_i}) = \frac{1}{1 + e^{-\eta({\bf x_i})}} \\
\eta({\bf x_i}) &= 1 + -4 x_i
\end{aligned}
', rendering as TeX:
\begin{aligned}
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\hat{p}({\bf x})', rendering as TeX:
\hat{p}({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\log\left(\frac{p({\bf x})}{1 - p({\bf x})}\right) = -1.5 + 0.5x + x^2.
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\begin{aligned}
Y_i \mid {\bf X_i} = {\bf x_i} &\sim \text{Bern}(p_i) \\
p_i &= p({\bf x_i}) = \frac{1}{1 + e^{-\eta({\bf x_i})}} \\
\eta({\bf x_i}) &= -1.5 + 0.5x_i + x_i^2
\end{aligned}
', rendering as TeX:
\begin{aligned}
^
unexpected "X"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\eta({\bf x}) = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \ldots + \beta_{p - 1} x_{p - 1}
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\log\left(\frac{p({\bf x})}{1 - p({\bf x})}\right) = \beta_0 + \beta_1 x_1 + \ldots + \beta_{p - 1} x_{p - 1}
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\log\left(\frac{p({\bf x_i})}{1 - p({\bf x_i})}\right) = \beta_0 + \beta_1 x_{i1} + \beta_2 x_{i2} + \cdots + \beta_{(p-1)} x_{i(p-1)} + \epsilon_i
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\log\left(\frac{p({\bf x_i})}{1 - p({\bf x_i})}\right) = \beta_0 + \beta_1 x_{i1} + \beta_2 x_{i2} + \cdots + \beta_{(q-1)} x_{i(q-1)} + \epsilon_i
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\frac{\hat{\eta}({\bf x}) - \eta({\bf x})}{\text{SE}[\hat{\eta}({\bf x})]} \overset{\text{approx}}{\sim} N(0, 1)
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x})', rendering as TeX:
\eta({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\hat{\eta}({\bf x}) \pm z_{\alpha/2} \cdot \text{SE}[\hat{\eta}({\bf x})]
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'p({\bf x})', rendering as TeX:
p({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'p({\bf x})', rendering as TeX:
p({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\left(\text{logit}^{-1}(\hat{\eta}({\bf x}) - z_{\alpha/2} \cdot \text{SE}[\hat{\eta}({\bf x})] ), \ \text{logit}^{-1}(\hat{\eta}({\bf x}) + z_{\alpha/2} \cdot \text{SE}[\hat{\eta}({\bf x})])\right)
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\hat{\eta}({\bf x})', rendering as TeX:
\hat{\eta}({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\text{SE}[\hat{\eta}({\bf x})]', rendering as TeX:
E}[\hat{\eta}({\bf x})]
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x})', rendering as TeX:
\eta({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'p({\bf x})', rendering as TeX:
p({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x})', rendering as TeX:
\eta({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'p({\bf x})', rendering as TeX:
p({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x})', rendering as TeX:
\eta({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\log\left(\frac{p({\bf x})}{1 - p({\bf x})}\right) =
\beta_0 +
\beta_{1}x_{\texttt{alcohol}} +
\beta_{2}x_{\texttt{ldl}} +
\beta_{3}x_{\texttt{famhist}} +
\beta_{4}x_{\texttt{typea}} +
\beta_{5}x_{\texttt{age}} +
\beta_{6}x_{\texttt{ldl}}x_{\texttt{famhist}} +
\beta_{7}x_{\texttt{ldl}}^2
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
p({\bf x}) = P[Y = 1 \mid {\bf X} = {\bf x}]
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
1 - p({\bf x}) = P[Y = 0 \mid {\bf X} = {\bf x}].
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
C^B({\bf x}) = \underset{k}{\mathrm{argmax}} \ P[Y = k \mid {\bf X = x}].
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\hat{C}(\bf x) =
\begin{cases}
1 & p({\bf x}) > 0.5 \\
0 & p({\bf x}) \leq 0.5
\end{cases}
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\hat{C}({\bf x}) = \underset{k}{\mathrm{argmax}} \ \hat{P}[Y = k \mid {\bf X = x}].
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\hat{p}({\bf x}) = 1 - \hat{p}({\bf x})', rendering as TeX:
\hat{p}({\bf x}) = 1 - \hat{p}({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\hat{C}(\bf x) =
\begin{cases}
1 & \hat{p}({\bf x}) > 0.5 \\
0 & \hat{p}({\bf x}) \leq 0.5
\end{cases}
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\hat{p}({\bf x})', rendering as TeX:
\hat{p}({\bf x})
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\text{Misclass}(\hat{C}, \text{Data}) = \frac{1}{n}\sum_{i = 1}^{n}I(y_i \neq \hat{C}({\bf x_i}))
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
I(y_i \neq \hat{C}({\bf x_i})) =
\begin{cases}
0 & y_i = \hat{C}({\bf x_i}) \\
1 & y_i \neq \hat{C}({\bf x_i}) \\
\end{cases}
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\eta({\bf x}) = 0 \iff p({\bf x}) = 0.5
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
\hat{C}(\bf x) =
\begin{cases}
1 & \hat{p}({\bf x}) > c \\
0 & \hat{p}({\bf x}) \leq c
\end{cases}
', rendering as TeX:
^
unexpected "x"
expecting "%", "\\label", "\\nonumber" or whitespace
I am reading through the chapter and found some typos/inconsistencies - sorry for not making a pull request (and thanks for making this great book available!)
When introducing the sigmoid function you have
\text{logit}^{-1}(\xi) = \frac{e^\xi}{1 + e^{\xi}} = \frac{1}{1 + e^{-\xi}}
it should be
\text{logit}^{-1}(\xi) = \frac{e^\xi}{1 + e^{\xi}} = \frac{1}{1 + e^{-\xi}}-1
I believe.
Some lines above you have
(Note, many more machine learning focused texts will use p as the number of parameters. This is an arbitrary choice, but you should be aware of it.)
but you are also using p as the number of parameters, so I was confused by the sentence.
par(bg = NA)
Also, make plot text grey, to allow for dark and light backgrounds?
Fix rounding and scientific notation. Remove as much rounding as possible.
DD
: Proof
DU
: Proof
DD
: Edit
DD
: Merge
Collinearity.
Consider notation that makes conditioning explicit.
Instead of doing the download.files()
and read.csv()
route, how about just embedding the necessary data sets within an R package ala ucidata
. From here, the information could downloaded via CRAN or a GH only release.
I think the only data you needed was: autompg?
In the future, these different packages or routines can be made into "virtual" or self-contained STAT 420 package that includes all the relevant material (c.f. msos
)
autompg
Test?
How Sampled?
It would be nice to come up with an indexing scheme for all graphics (figures, plots, tables, etc) so they can be easily and unambiguously referenced from either HTML or PDF text.
For example:
In 7.1.1, after the words"However, its variance remains constant for each xi
", there is a following wording to reference a picture with a graph: "This is visually displayed in the image below". I see you guys have fixed it a bit, since I first noticed it, where the picture was actually above the wording, not below. However, still the picture is way down, not even on the same page, but on the next one. It would be better to have a numerical reference, not relative one.
Create smaller chapters.
Group into sections.
Extract lambda which maximizes.
Doing a quick performance benchmark, I see two code chunks eating up a crazy amount of time (> 4 minutes of execution):
Lines 411 to 414 in cc73a82
Lines 520 to 530 in cc73a82
Maybe save result and manually reload?
```{r sim-anova-function, echo = FALSE}
library(broom)
sim_anova = function(n = 10, mu_a = 0, mu_b = 0, mu_c = 0, mu_d = 0, sigma = 1, stat = TRUE) {
# create data from one-way ANOVA model with four groups of equal size
# response simulated from normal with group mean, shared variance
# group variable indicates group A, B, C or D
sim_data = data.frame(
response = c(rnorm(n = n, mean = mu_a, sd = sigma),
rnorm(n = n, mean = mu_b, sd = sigma),
rnorm(n = n, mean = mu_c, sd = sigma),
rnorm(n = n, mean = mu_d, sd = sigma)),
group = c(rep("A", times = n), rep("B", times = n),
rep("C", times = n), rep("D", times = n))
)
# obtain F-statistic and p-value for testing difference of means
# use lm instead of aov for better result formatting with glance
aov_results = lm(response ~ group, data = sim_data)
f_stat = glance(aov_results)$statistic
p_val = glance(aov_results)$p.value
# return f_stat if stat = TRUE, otherwise, p-value
ifelse(stat, f_stat, p_val)
}
```
```{r sample-sim-anova-simulation, eval = FALSE}
f_stats = replicate(n = 5000, sim_anova(stat = TRUE))
```
```{r cache-simulation, eval = FALSE, echo = FALSE}
<<sample-sim-anova-simulation>>
saveRDS("cache/f_statistics_simulation.rds", version = 2)
```
```{r load-cached-fstats, echo = FALSE}
f_stats = readRDS("cache/f_statistics_simulation.rds")
```
```{r sim-anova-graphs}
hist(f_stats, breaks = 100, prob = TRUE, border = "dodgerblue", main = "Empirical Distribution of F")
curve(df(x, df1 = 4 - 1, df2 = 40 - 4), col = "darkorange", add = TRUE, lwd = 2)
```
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.