The wild broccoli 🥦
Current mood: feeling
A mountain of homework fell upon me
Mood: 😖 squished written under the waning crescent 🌘
Somehow, my midterm exams have already crept up on me! I really should try to share some of the stuff I’ve learned in my studies here, but I’m barely keeping up with the torrent of information that hits me like a firehose every lecture. In order to regain a sense of happiness and sanity in my life, I made lots of little changes to my website and then spent a long time tweaking and commenting everything instead of uploading to Neocities.
For example, I’ve implemented SmilesDrawer for my site (which I know is something I’ll probably only use once, but it’s fun anyway to add it to the Hugo rendering pipeline, yay!)
This is the colchicine molecule, which to my dismay, has been chronically poisoning me and causing early-stage liver injury. Upon my doctor’s recommendation, I’ve reduced the dose by a third and will continue monitoring to see if my bloodwork stabilizes. I’m trying to sound clinical here or at least impartial, but this is a really frightening and scary experience. I don’t want to die…! I don’t want to die!
Can you believe a molecule like this could poison me? It looks so benign here on the screen. But it’s secretly an evil plant alkaloid (notice the N atom in the diagram, that’s how you know it’s an alkaloid) that kills my small intestine cells on contact1, gets absorbed into my bloodstream, stops my white blood cells from working the way they normally would2, and then obliterates my liver cells upon being metabolized3. After reading a lot of papers on the topic of systemic colchicine poisoning, specifically in the range of chronic low-level high dosing (rather than acute overdose that you find a lot of case reports), it doesn’t seem like colchicine is actually associated with fulminant liver failure unless all your other organs are also failing outrageously, which I would have noticed by now. However, it does seem like even low doses can cause very abnormal liver enzyme activity, but the long-term outcome of that isn’t known because the general medical advice when you find that is to immediately lower the dose or stop taking colchicine completely.
Oh, it’s so scary… It’s really so scary… I hate having this disease. I’ll be getting back the genetic testing results from my family soon and find out if there’s some other reason that I get sick like this all the time. Maybe there is a secret inside our shared genome that will lead to me getting to take a different, safer medication. Let’s see what will happen next month.
For a more whimsical topic, here’s a funny little guy people like to synthesize for classrooms.
There is no use for this molecule yet, but it looks very happy.
Maybe I will try to write more about various chemicals from here on out. In a past life, I studied organic chemistry quite voraciously actually, so I have a fondness for all sorts of silly molecules.
Tomorrow I have two assignments due and have barely started on either of them! Alas! Well, at least I finished the fiendishly difficult Machine Learning with Biomedical Data homework on time and was able to turn it in. This is the sort of evil problem that I have to answer:
- The ridge-regression solution \(\hat\beta(\lambda)\) can computationally easily be determined by using the SVD of the data matrix \(\mathbf{X}\). Show that the computational complexity of \(\beta(\lambda)\) is \(O(np)\), if the SVD is already computed. Suppose \(p \gg n\), using the SVD of \(\mathbf{X}\), write a closed form expression for the limiting ridge solution as \(\lambda \downarrow 0\). What can you say about this limiting solution?
Let
\[\mathbf{X} = \mathbf{U}\mathbf{D}\mathbf{V}^T, \;r = \text{rank}(\mathbf{X})\le\min(n,p),\;\\\mathbf{D}=\text{diag}(d_1,\dots,d_r),\;\mathbf{U}\in\mathbb{R}^{n\times r},\;\mathbf{V}\in\mathbb{R}^{p\times r}.\]Then
\[\begin{align*} \mathbf{X}^T\mathbf{X} &= (\mathbf{U}\mathbf{D}\mathbf{V}^T)\mathbf{U}\mathbf{D}\mathbf{V}^T \\&= \mathbf{VDU}^T\mathbf{UDV}^T\\&= \mathbf{V}\mathbf{D}^2\mathbf{V}^T,\\ \mathbf{X^T}\mathbf{Y} &= \mathbf{V}\mathbf{D}\mathbf{U}^T\mathbf{Y},\\ \hat\beta(\lambda) &= (\mathbf{VD}^2\mathbf{V}^T + \lambda\mathbf{I})^{-1}\mathbf{VDU}^T\mathbf{Y}\\ &=\mathbf{V}(\mathbf{D}^2 + \lambda\mathbf{I})^{-1}\mathbf{DU}^T\mathbf{Y}\\ &= \sum_{i=1}^r \mathbf{V}_i \frac{d_i}{d_i^2 + \lambda}(\mathbf{U}_i^T\mathbf{Y}). \end{align*}\]\(\mathbf{U}^T\mathbf{Y}\) is \((r \times n) (n\times 1)\) and costs \(O(nr)\). Multiplying each entry by the \((r\times r)\) diagonal \((\mathbf{D}^2 + \lambda\mathbf{I})^{-1}\mathbf{D}\) costs \(O(r)\). Multiplying this \((r \times 1)\) matrix by the \((p\times r)\) \(\mathbf{V}\) costs \(O(pr)\). So the total is \(O(r(n + p))\) and since \(r\le\min(n,p)\) and \(p\gg n\), this is \(O(np)\). As \(\lambda \downarrow 0\),
\[\begin{align*} \frac{d_i}{d_i^2+\lambda}&\to\frac{1}{d_i},\\ \lim_{\lambda\downarrow0}\hat\beta(\lambda) &= \sum_{i=1}^r \mathbf{V}_i \frac{1}{d_i}(\mathbf{U}_i^T\mathbf{Y})\\ &= \mathbf{V}\mathbf{D}^{+}\mathbf{U}^T\mathbf{Y} = \mathbf{X}^+\mathbf{Y}, \end{align*} \]which is the Moore-Penrose pseudoinverse solution. When \(p\gg n\), \(\mathbf{X}\hat\beta = \mathbf{UU}^T\mathbf{Y} = \mathbf{Y}\) so there is zero training error and exact interpolation of the data. This also has the smallest \(\ell_2\) norm among all \(\beta\) with \(\mathbf{X}\beta = \mathbf{Y}\) (of which there are infinitely many since \(p>n\).
Ahh… Ah… A problem that took me 5 million years to answer. If you somehow came across this site when googling the question text for your own homework, please don’t use my solution, since I don’t know if it’s any good 😅
But in happy news, I’ve been procrastinating by prettifying the math rendering on my site as well. I’ll see if this is OK, and hopefully I’ll remember all this evil matrix stuff during the final exam. I haven’t taken a linear algebra class in several years now, so remembering SVD was a little painful. If only my old community college didn’t have rental-only textbooks, then I could have gone back into the chapter about this topic so easily.
Today’s to-do:
- Bayesian Statistics homework
- Probability Theory homework
- Upload the updated Neocities site after a month of fiddling
- Eat dinner
In the future:
- Review WGS results
- Download and process this year’s new Decor Pikmin images from the Pikmin wiki
- Make a fun and proper credits page for site assets
- Make placeholder 88x31 images for my net neighbors
- Dye my hair a fun color