Calculus

主成分分析 - 0

Principle component analysis - 0 1. 一維資料的統計學 假設我們有 $n$ 筆資料, 每筆資料都是一個數字 (例如 $n$ 個學生的成績). 這 $n$ 筆資料我們設為 $x_1, \cdots, x_n$, 並且定義一個矩陣 $$ \tag{1} X = \begin{bmatrix} x_1 & \cdots & x_n \end{bmatrix}\in M_{1\times n}. $$

主成分分析 - code

Click here to view this notebook in full screen

主成分分析 - 2

這裡我們補充一下主成分分析裡的證明部分. 假設我們有 $n$ 筆 $p$ 維的資料, 記成 $$ \{x_1, x_2, \cdots, x_n\} \in R^p. $$ 假設想要投影到 $k$ 維, $k\le p$, 數學上來說就是想要找到 $\mu$, $U$ 以及 $\beta_i$ 使得下式 $E$ 有最小值 $$ E = \sum_{i=1}^n \|x_i - (\mu + U\beta_i)\|^2, $$ 其中有兩個條件, $U^TU=I_k$, 以及 $\sum^n_{i=1} \beta_i=\vec{0}$.

Multidimensional scaling

Multidimensional scaling, 簡稱 MDS, 是個資料分析或是資料降維的工具. 這裡我們要談一下從數學角度來說 MDS 的原理及做法, 更精確的說, 這裡講的是 classical MDS. 假設我們有 $n$ 筆 $p$ 維的資料, 記成 $$ \{x_1, x_2, \cdots, x_n\} \in \mathbb{R}^p $$ 那我們可以據此構造出一個距離平方矩陣 $D$, Euclidian distance matrix, 簡稱 EDM, 其中 $D_{ij} = \|x_i-x_j\|^2$, 也就是 $(x_i)$ 及 $x_j$ 這兩個點距離的平方.

主成分分析

主成分分析, Principal component analysis, 簡稱 PCA, 是個資料分析或是資料降維的工具. 資料降維簡單來說, 假設我們有一些資料, 這資料中的每一筆維度都很高, 導致我們很難 “看出” 或 “分析” 這資料集的特性, 這時候我們就會想要在低維度空間裡(通常三維以下)建構一組點資料, 並且想辦法使新的這組點資料在某些程度上能表示出原本高維度的點資料, 或保有某種特性. 這種將高維度資料在低維度表現出來的方式就稱為資料降維. 而 PCA 就是其中一種線性降維的方式.

Sec.10.3 - 極座標曲線家族

Laboratory Project in Sec.10.3, Calculus by Stewart English version: Families of Polar Curves 在這個研究中,你將發現極座標曲線家族有趣又漂亮的形狀。同時,當常數改變時,你也會觀察到曲線形狀的變化。 問題 1: (a) 探討以下列極座標方程式: $r=\sin(n\theta)$ 定義的曲線家族,其中 $n$ 為正整數。請問圖形中的環的數量與 $n$ 有何關係?

Sec.14.7 - Designing a dumpster

Applied Project in Sec.14.7, Calculus by Stewart Chinese version 設計垃圾桶 For this project we locate a rectangular trash Dumpster in order to study and describe all its shape and construction. We then attempt to determine the dimensions of a container of similar design that minimize construction cost. Question 1 : First locate a trash dumpster in your area. Carefully study and describe all details of its construction, and determine its volume. Include a sketch of the container.

Sec.14.7 - 設計垃圾桶

Applied Project in Sec.14.7, Calculus by Stewart English version Designing a dumpster 在這個專題中,我們先測量出一個長方體垃圾桶出他的外型和結構。希望設計出一個和它一樣大的容器,並將所需的花費最小化。 問題 1 :

Clenshaw–Curtis quadrature

前情提要: 數值積分初探 前情提要: 以內插多項式來做數值積分 前情提要: 高斯積分 我們想要利用 Chebyshev polynomial 來算積分 Goal: 任意給定一可積分函數 $f(x)$, $x\in[-1, 1]$, 我們想要算 $\int^1_{-1} f(x) dx$. Idea: 我們簡單做個變數變換 $x = \cos\theta$ 可以得到 $$ \int^1_{-1} f(x) dx = \int^{\pi}0 f(\cos\theta)\sin\theta d\theta. $$ 所以如果我能將 $f(x)$ 這個函數以 first kind Chebyshev polynomial 來做展開, i.e., $$ f(x) = \sum^N{k=0} a_k T_k(x) = \sum^N_{k=0} a_k \cos(k\cos^{-1}x). $$ 那代入後我們就有 $$ \int^1_{-1} f(x) dx = \int^{\pi}0 \sum^N{k=0} a_k \cos(k\theta)\sin\theta d\theta = \sum^{N/2}{k=0}\frac{2 a{2k}}{1-(2k)^2}. $$

Sec.3.5 - Families of Implicit Curves

Applied Project in Sec.3.5, Calculus by Stewart Chinese version 隱式曲線集合 In this project you will explore the changing shapes of implicitly defined curves as you vary the constants in a family, and determine which features are common to all members of the family. Question 1 Consider the family of curves $$ y^2-2x^2(x+8)=c[(y+1)^2(y+9)-x^2] $$ (a) By graphing the curves with $c=0$ and $c=2$ , determine how many points of intersection there are. (You might have to zoom in to find all of them.)