adydio
文章27
标签8
分类1
复分析资料

复分析资料

数理统计

数理统计

随机过程

随机过程

托福写作练笔

托福写作练笔

In many places, students must arrive very early in the morning to attend school. Some people believe that starting the school day early is the best approach to support learning, but others believe that starting the school day at a later time in the morning would be better for students. Which view do you agree with and why?

观点:I believe starting the school day early is the best approach to support learning.

First thing first, starting the school day early enables students to have more time to study. To be more specific, noting is more precious than time especially for students. Early morning is the period when studens are most energetic. Therefore, if the studying time in the morning is extended, the students' efficiency of learning can be improved accordingly. A typical example to the point might be my high school. During the first year, the first class in the moring began at 8:00 late in the morning, I could not to anything except listening to teachers because I could spare no time do something else. The next year our school started to make changes. We were supposed to take an extra self-study class that starts from 6:30 early in the morning. I started to make use of the time in the early morning, and I found that I could recite two more passages than before each day. Moreover, during the self-study class, I could even get prepared for the coming classes and have a better understanding of the knowledge I learned. As a result, my grades became better and better due to the new approach to start the school early. In the light of this example, we can see that starting the school day early is a effective way to support learning.

TPO 62 模考我的答案

Scaled score 22

Integration Writing

raw score 3.0

Both the lecture and the passage discessed about the use of artificial reefs. However, their viewpoints are strongly contradictory for several reasons.

Firstly, the reading points out that artificial reefs may increase the populations of seveal species of fish, but the lecturer supposes that this do not mean the overall increasement of the fish. This is because the artifial reef is more likely to attract fish that live distant from the reef, so the fish have to move to the reef. When people catch the fish around the reef, the population of the kind of fish being caught will decrease beacause they cannot maintain more polulations.

Moreover, the author holds that artificial reefs can alse improve the economical competitiveness of small-scale fishers. The lecturer, however, believes that it is fatal to remain the reef positions secret. He gives us with the example of the use of large net. This approach would definitely destroy the reef and the only safe way is to make the position of the reef known by people, thus this would do no help to improve the economical competitiveness of small-scale fishers.

Besides, the professor also refutes the idea that the use of artificial reefs can recycle useless materials. He states that the implementation of artificial reefs is sure to cause environmental damage. He provides us with the example of osborne reef to illustrate the point. This kind of reef is made of car tyres. When a storm occurs, the reef will get loose and became loose parts which will couse environmental damage, and make many sea creatures leaving dead on the sea floor.

In sum, according to the discussion above, the speaker totally disagrees with the conclusions revealed in the reading passage.

Independent Writing

raw score 4.0

Nowadays, there are thousands of students graduating from high scholl every year. Accordingly, the graduate shtdents are facing a choice of whether to take at least a year off to work or travel before studying at a university. The problem is causing polarized debate among those graduates and their parents. I, given the chance, would like to state it is necessary for students gratudated from high school to take at least a year off to work or travel before entering college.

First of all, sparing one's time to work before entering university helps him to gain work experience. To be specific, the working experience and skills acquired through the process helps oneself to quickly adapt to college life. A good example in case might be myself. After I graduated from high school, I decided to take a year off to do seveal part-time jobs. I worked as a waiter in a restaurant and I learned to be concentrated on what I am doing. Besides, I also served as a programmer doing data analysis in an IT company, from which I learned a lot techniques to deal with large amounts of data. As a result, everything seemed to be easy for me when I entered college. The working experience I gained helped me do get straight A in my first semester. In the light of this, I suppose it is crutial to take at least one year off to work after high school.

Moreover, I believe that spending a year or more travelling before becoming a college student is of geat significance. That is to say, through travelling, one can get familiar with the characteristics of the city he gets by, which will help him to decide which place to work or stay after graduating from college. To exemplify that, I would like to take myself as an example again. During the one year off, I also travelled to some popular city in China like Beijing or Shanghai. I discovered from my travelling experience that Beijing is an energetic city but it is too cold to stay at during winter. Besides, I found that Shanghai is full of opportunities especially chances for IT engineers like me. I finally decided to stay in Shanghai after college and thanks to my one year off travelling experience, I think I have made the right choice because I have just got a decent job in Shanghai. Therefore, spending a year travelling is important as well.

In a word, I certainly agree with the idea that students gratudated from high school should take at least a year off to work or travel before entering college, for it helps to make oneself more adaptive to the college and can also let the student make the relatively correct choice of working place after graduation.

A university has money in its budget to do ONE thing to improve its facilities for students: it can either improve the quality of the technology (for example, computers and printers that it provides for students, OR it can redesign spaces where students hold club meetings and gather with friends in their spare time to make these areas more comfortable and appealing. Which idea do you prefer, and why?

Universities are trying their best to promote its facilities for students, while the budget is usually limited. It seems unpractical for universities to spend money on every aspects of the school. Some people believe that improving the quality of the technology should be put in the first place. While others, in contrast, insist that it is better for school to redesign the leisure areas to make these areas more comfortable and appealing. I, given the chance, would like to state that it is better to spend money to improve the technology standard of the school.

First thing first, the student will have a better working efficiency with higher quality technological devices. To be more specific, technological devices is being used nearly everywhere inside the campus. There are printers inside the office, computers in the IT center, and online teaching system placed in every dormitory. Therefore, with the promotion of these technological devices, students' quality of life and study will be improved accordingly. A good example in case might be my college. When I was in the last semester of school, I was busy doing a machine learning project to finish my thesis. The time-consuming trainig process usually takes about two days to run. However, our school used their fundings and provided our laboratory with better computer CPUs and GPUs, hence my programming project could be done within 4 hours, which profoundly improved my research effeciency. From this case we can conclude that it is worth investing on the technology inside the school.

Moreover, funding on the quality of the technology can save students' money. That is to say, oceans of internet resources and technological tools are being used by college students especially those who major in science. Only a small part of those resources are free of charge, which means it is common for students to pay for these resources. For instance, a student major in data science usually use calculating tools like MATLAB and Mathematica. Those tools charges about 100 dollars for individual each year which is too expensive for a student. Consider if the school pay for those fees, it will certainly lighten students' financial burden. Some people may think that the school should fund in entertainment first, this opinion does make sense to some extent, for students need to relax themselves. However, there are already enough entertainment like cafeteria or shopping mall outside the campus, there is no need to pay extra money to redesign the leisure areas. Therefore, I firmly hold the opinion that it is better to spend money improving the technology standard of the school first.

In a word, I believe that universities should improve the quality of the technology first, for it can both technically and financially benefit the students.

(To exemplify that, I would like to take my college as an example again. Being a student major in statistics and data science, I usually use calculating tools like MATLAB and Mathematica. Those tools charges about 100 dollars for individual each year which is too expensive for a student like me. Luckily, my college had signed a contract with MATLAB and all the students can use the product for free. Thanks to the school's policy, I could save roughly over a thousand dollars throughout my college life. In the light of this, )

数学分析复习

数学分析复习

数学分析复习(已完结,最后更新2/24)

Chapter 16.1:度量空间与连续函数

内积空间,满足对称性,双线性性与正定性.

赋范空间,满足正定性,齐性和三角不等式.

定义内积诱导的范数.有极化恒等式.

定义范数诱导的度量,满足正定性,对称性和三角不等式.

完备度量空间:每个柯西列都收敛.

上的范数:.

连续函数的范数:对于.

矩阵范数:对于.

命题.

常见的完备度量空间:.

注意:有限维赋范线性空间都是完备的,赋范线性空间里,完备等价于闭。

Chapter 16.2:度量空间的拓扑

紧致:度量空间的子集是紧致的,是指的任一点列的所有极限点均属于.

结论

  1. 非空开集是开球的并集,反之也成立.
  2. 是度量空间的一个度量子空间.子集的开集存在的开集使得.若的开集,那么子集的开集的开集.
  3. 度量空间的一个子集是闭集当且仅当它的余集是开集.
  4. 完备度量空间的一个子集是完备的当且仅当它是的闭子集.
  5. 紧致性完备性.反之不一定成立,如.
  6. 紧致性每一个开覆盖有有限子覆盖有界闭.
  7. 任意紧致度量空间存在至多可数稠密子集.

Chapter 16.3:度量空间上的连续函数

定义(连续函数) 以下是连续的三个等价形式:

  1. ,对任意,存在,当时,.
  2. 中任意收敛点列 ,中点列收敛.
  3. 中任意开子集的原像的开子集.

压缩映射是压缩映射,指存在常数使得.

是压缩映射,则存在唯一的满足.

定义(一致连续) 是一致连续的,是指对任意,存在,对任意,当时,.

定义(连通):度量空间连通是指,不存在两个不交的非空开集满足.

定义(弧连通):度量空间弧连通是指,存在连接其中任意两点的曲线.即,存在连续映射(曲线).

定理

  1. 定义在紧度量空间上的连续函数一致连续.(证明:Heine-Borel性质,在每个小开球里面误差小于,这样的开球形成的开覆盖是有限的)
  2. 紧致集合在连续函数下的像是紧致集合.(考察点列)
  3. 的子集连通当且仅当它是一个区间.
  4. 是连续满射,连通(弧连通)连通(弧连通).
  5. 弧连通空间是连通空间.
  6. 的开子集,若它是连通集合,则它是弧连通集合.
  7. 的非空开集,,则为闭集.(考察上的点列,可以证明点列的极限也属于

Chapter 17:映射的微分

Chapter 18:积分

MAB3Ch17.pdf

线性代数复习

线性代数复习

线性代数复习(已完结,最后更新2/23)

Chapter 6:线性变换

定理 线性变换可对角化存在的一组特征向量构成的一组基.

定理 复方阵可对角化的最小多项式没有重根.

主要思路,首先是由各个特征子空间的和是直和,构造多项式之间是互素的,因此可以写出裴蜀定理,在裴蜀等式中代入线性变换同时作用于,然后说明.

定理 矩阵为任意正整数,有: 思路:取子空间.定义线性映射.而的核空间维数分别为不等式的左边和右边,而即得证.

定理 复数域上的任何阶方阵相似于上三角形矩阵,且的对角元为的全体特征值.

定理 任意矩阵的特征多项式都是的零化多项式.

思路均为归纳法.

定理(牛顿公式)和整数其中,中取个相乘后累加,.

Chapter 7:标准形

定理(根子空间分解)维复线性空间的线性变换个不同特征值为,特征多项式为.则属于特征值的全体根向量和共同组成,且维数为,称为属于特征值的根子空间,记为.且有关系.

思路:设,令作用于上得到.再由互素,利用裴蜀定理代入即可.

此外,设属于特征值次根向量,那么线性无关,并且构成的一组基.

定义(循环子空间) 是数域上的线性空间上的线性变换,且.则中包含的全体不变子空间的交仍然是包含不变子空间,因此是包含的最小 不变子空间.由中一个向量生成的不变子空间称为循环子空间,,且的一组基,其中相对于的最小多项式的次数.

下的矩阵是:

且有. 特征多项式等于最小多项式,这是这类矩阵的特征.

定理(多项式矩阵相关)

  1. 复数域上的矩阵相抵具有相同的秩和初等因子组.
  2. 是对角元不全为零的对角阵,则的初等因子组是的初等因子组共同组成的集合.
  3. 上相似特征方阵上相抵.
  4. 上的循环变换在任意一组基下的矩阵为单纯方阵(特征多项式等于最小多项式的方阵).
  5. 是数域且,那么上相似上相似.

Chapter 8:二次型

定理

  1. 是数域上的阶对称方阵,则 上存在阶可逆方阵使得是对角矩阵.
  2. 实对称方阵正定存在阶实可逆方阵使得.
  3. 与正定(或半正定)实矩阵相合的矩阵仍然正定(或半正定).

定理(不等式)

阶实可逆方阵,有: 等号成立的充要条件是的列向量两两正交.

Chapter 9:内积

定义(有限维实线性空间的内积) 任取的一组基,任取阶实对称方阵下的坐标为,则定义.

定理(柯西不等式) .

定理(三角不等式) 为欧式空间,,有.

定理 同一个内积在两组基下的度量矩阵相合,即:的过渡矩阵.

定理 任意实方阵都可以正交相似为准上三角阵,对角元为所有实特征值和成对复特征值构成的正交方阵.

例子 可以相似成正交方阵可以相似成正交方阵.

右推左,

推论 对任意实对称方阵,存在可逆上三角矩阵,使得.

思路:将原来的基做正交化,即正交矩阵.

定理(QR分解) 阶实可逆方阵,则存在正交矩阵和对角元都大于零的上三角矩阵,使得.

欧式空间的内积 满足双线性,对称性和正定性.

酉空间的内积 满足共轭双线性,共轭对称性和正定性.

定理

  1. 类似于欧式空间,对任意共轭对称方阵,存在可逆上三角矩阵,使得.
  2. 类似于欧式空间,酉空间两组标准正交基之间的过渡矩阵满足.这种称为酉方阵.
  3. 任一复方阵酉相似于上三角形矩阵.
  4. 与规范方阵酉相似的方阵仍然是规范方阵.
  5. 复方阵是规范方阵酉相似于对角矩阵.
  6. 酉方阵的逆,乘积和与其酉相似的方阵仍是酉方阵.
  7. 与Hermite方阵酉相似、共轭相合的矩阵仍为Hermite方阵.
  8. 是酉方阵酉相似于,且.
  9. 是Hermite方阵酉相似于,且.正定的全部特征值为正实数.
  10. 酉方阵、Hermite方阵和复规范方阵属于不同特征值的特征向量互相正交.

定理(不等式) 阶复方阵,有,等号成立当且仅当是规范方阵.

思路:将酉相似于上三角阵.

定理(奇异值分解) 阶复矩阵,存在阶酉方阵阶酉方阵使得,其中的全部非零特征值的算术平方根.

定理(矩阵的极分解) 阶复方阵,可以分解为半正定Hermite方阵 和一个酉方阵 的乘积,且唯一确定.

其他结论(期中考试以前)

证明利用初等变换即可。

2021数院概率论期末考试

2021数院概率论期末考试

2021数院概率论期末考试(选)

给出几道有价值的题目和我的做法。

3.设是独立均匀地取自维超立方体上的两点,表示两点的欧氏距离.证明

是第个维度坐标差,其密度函数容易求出为我们有,立即求得的密度函数的均值为.这里令,那么.

remark 对于有二阶导数的函数具有有限均值和有限方差,则将处展开,利用前三项并且忽略余项,得到.

在这里,取.这里为一有限常数,与的方差有关.得证.

6.对某概率空间上的随机变量.若独立,证明:

分别为的分布函数,事件.由于,对于给定的,存在整数,使得时就有.

计算.在足够大时,显然可以做到,那么必然有,由引理,,这表明使得仅存有限个,而又有,再由的任意性,推得对于给定的,即.

极限定理

极限定理

概率论:极限定理与数字特征(已完结,最后一次更新2/12)

Review:数字特征与特征函数

部分笔记:Prob.pdf

引理 设随机变量,则有,等号成立当且仅当存在.

引理 对一切和非负整数,都有:

定义(弱大数定律)

为独立的随机变量序列,,如果存在常数序列使得,那么说序列服从弱大数定律.

定义(中心极限定理)

,若成立,则称序列服从中心极限定理.

马尔可夫不等式

为取非负值的随机变量,则对于任何常数,有: .

取事件的示性变量,则有,两边取期望,得到 从而得证.

切比雪夫不等式

为随机变量,均值和方差有限,则对任何,有: .

.上述证明用到了马尔可夫不等式.

推广:我们有为定义在上的非降的非负值函数,对随机变量,如果有则对于任意使,都有:

马尔可夫弱大数律

如果满足(此即马尔可夫条件),那么.

利用切比雪夫不等式的推广,取注意这里没有任何独立性假定.事实上,在独立和场合,若独立事件序列满足中心极限定理,那么马尔可夫条件自然成立.

稍弱一点的推论(泊松大数定律)

对于独立试验序列,事件在第次试验中发生的概率为,设在前次试验中出现的次数,那么.设为第次试验成功的次数,那么满足马尔可夫条件,得证.

辛钦弱大数律

,有.

极限定理

为以概率次伯努利试验成功次数.则.

林德伯格-莱维中心极限定理

,则有:

引理

  1. 若随机事件序列满足,那么.
  2. 若随机事件序列相互独立,那么,即.

公式

单调收敛定理

.

引理

,则.

引理

如果,则

第一定理

任意一致有界的非降函数列必有一子序列弱收敛于一非降函数

第二定理

上的连续函数,又上弱收敛于函数的一致有界的非降函数列,且的连续点,则:

定义 (几乎处处收敛)

设随机变量和随机变量序列定义在同一个概率空间上,若,那么说其等价形式为

几乎处处收敛的若干性质

  1. .

控制收敛定理

,若存在随机变量,使得对一切,都有,则.

科尔莫格罗夫强大数定律

引理

为实数列,为单调趋于正无穷的正数列,则:

不等式

,取,如果随机变量则有:

不等式

为定义在上的凸函数,若存在,则有:

条件

随机变量序列具有有限的期望和方差,若对任何,都有: 则称该随机变量序列满足条件.如果条件对成立,那么成立中心极限定理.

定理

为随机变量序列,若存在使得 则有下式成立:

逻辑斯蒂回归

逻辑斯蒂回归

Logistic Regression

In this ungraded lab, you will - explore the sigmoid function (also known as the logistic function) - explore logistic regression; which uses the sigmoid function

import numpy as np
%matplotlib widget
import matplotlib.pyplot as plt
from plt_one_addpt_onclick import plt_one_addpt_onclick
from lab_utils_common import draw_vthresh
plt.style.use('./deeplearning.mplstyle')

Sigmoid or Logistic Function

As discussed in the lecture videos, for a classification task, we can start by using our linear regression model, , to predict given .

  • However, we would like the predictions of our classification model to be between 0 and 1 since our output variable is either 0 or 1.
  • This can be accomplished by using a "sigmoid function" which maps all input values to values between 0 and 1.

Let's implement the sigmoid function and see this for ourselves.

Formula for Sigmoid function

The formula for a sigmoid function is as follows -

In the case of logistic regression, z (the input to the sigmoid function), is the output of a linear regression model. - In the case of a single example, is scalar. - in the case of multiple examples, may be a vector consisting of values, one for each example. - The implementation of the sigmoid function should cover both of these potential input formats. Let's implement this in Python.

NumPy has a function called exp(), which offers a convenient way to calculate the exponential ( ) of all elements in the input array (z).

It also works with a single number as an input, as shown below.

# Input is an array. 
input_array = np.array([1,2,3])
exp_array = np.exp(input_array)

print("Input to exp:", input_array)
print("Output of exp:", exp_array)

# Input is a single number
input_val = 1  
exp_val = np.exp(input_val)

print("Input to exp:", input_val)
print("Output of exp:", exp_val)
Input to exp: [1 2 3]
Output of exp: [ 2.72  7.39 20.09]
Input to exp: 1
Output of exp: 2.718281828459045

The sigmoid function is implemented in python as shown in the cell below.

def sigmoid(z):
    """
    Compute the sigmoid of z

    Args:
        z (ndarray): A scalar, numpy array of any size.

    Returns:
        g (ndarray): sigmoid(z), with the same shape as z
         
    """

    g = 1/(1+np.exp(-z))
   
    return g

Let's see what the output of this function is for various value of z

# Generate an array of evenly spaced values between -10 and 10
z_tmp = np.arange(-10,11)

# Use the function implemented above to get the sigmoid values
y = sigmoid(z_tmp)

# Code for pretty printing the two arrays next to each other
np.set_printoptions(precision=3) 
print("Input (z), Output (sigmoid(z))")
print(np.c_[z_tmp, y])
Input (z), Output (sigmoid(z))
[[-1.000e+01  4.540e-05]
 [-9.000e+00  1.234e-04]
 [-8.000e+00  3.354e-04]
 [-7.000e+00  9.111e-04]
 [-6.000e+00  2.473e-03]
 [-5.000e+00  6.693e-03]
 [-4.000e+00  1.799e-02]
 [-3.000e+00  4.743e-02]
 [-2.000e+00  1.192e-01]
 [-1.000e+00  2.689e-01]
 [ 0.000e+00  5.000e-01]
 [ 1.000e+00  7.311e-01]
 [ 2.000e+00  8.808e-01]
 [ 3.000e+00  9.526e-01]
 [ 4.000e+00  9.820e-01]
 [ 5.000e+00  9.933e-01]
 [ 6.000e+00  9.975e-01]
 [ 7.000e+00  9.991e-01]
 [ 8.000e+00  9.997e-01]
 [ 9.000e+00  9.999e-01]
 [ 1.000e+01  1.000e+00]]

The values in the left column are z, and the values in the right column are sigmoid(z). As you can see, the input values to the sigmoid range from -10 to 10, and the output values range from 0 to 1.

Now, let's try to plot this function using the matplotlib library.

# Plot z vs sigmoid(z)
fig,ax = plt.subplots(1,1,figsize=(5,3))
ax.plot(z_tmp, y, c="b")

ax.set_title("Sigmoid function")
ax.set_ylabel('sigmoid(z)')
ax.set_xlabel('z')
draw_vthresh(ax,0)
Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …

As you can see, the sigmoid function approaches 0 as z goes to large negative values and approaches 1 as z goes to large positive values.

Logistic Regression

A logistic regression model applies the sigmoid to the familiar linear regression model as shown below:

where

Let's apply logistic regression to the categorical data example of tumor classification.
First, load the examples and initial values for the parameters.

x_train = np.array([0., 1, 2, 3, 4, 5])
y_train = np.array([0,  0, 0, 1, 1, 1])

w_in = np.zeros((1))
b_in = 0

Try the following steps: - Click on 'Run Logistic Regression' to find the best logistic regression model for the given training data - Note the resulting model fits the data quite well. - Note, the orange line is '' or above. It does not match the line in a linear regression model. Further improve these results by applying a threshold. - Tick the box on the 'Toggle 0.5 threshold' to show the predictions if a threshold is applied. - These predictions look good. The predictions match the data - Now, add further data points in the large tumor size range (near 10), and re-run logistic regression. - unlike the linear regression model, this model continues to make correct predictions

plt.close('all') 
addpt = plt_one_addpt_onclick( x_train,y_train, w_in, b_in, logistic=True)
Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …
线性回归与梯度下降

线性回归与梯度下降

线性回归与梯度下降

Linear regression

  • The model function for linear regression, which is a function that maps from x to y is represented as .

  • To train a linear regression model, you want to find the best parameters that fit your dataset.

    • To compare how one choice of is better or worse than another choice, you can evaluate it with a cost function
      • is a function of . That is, the value of the cost depends on the value of .
    • The choice of that fits your data the best is the one that has the smallest cost .
  • To find the values that gets the smallest possible cost , you can use a method called gradient descent.

    • With each step of gradient descent, your parameters come closer to the optimal values that will achieve the lowest cost .
  • The trained linear regression model can then take the input feature and output a prediction .

Gradient Descent

Gradient descent involves repeated steps to adjust the value of your parameter to gradually get a smaller and smaller cost .

  • At each step of gradient descent, it will be helpful for you to monitor your progress by computing the cost as gets updated.
  • In this section, you will implement a function to calculate so that you can check the progress of your gradient descent implementation.
Cost function

As you may recall from the lecture, for one variable, the cost function for linear regression is defined as

  • is the model's prediction through the mapping, as opposed to , which is the actual value from the dataset.
  • is the number of training examples in the dataset.
Model prediction
  • For linear regression with one variable, the prediction of the model for an example is represented as .

This is the equation for a line, with an intercept and a slope .

Algorithm

The gradient descent algorithm is:

where, parameters are both updated simultaniously and where
* m is the number of training examples in the dataset.

  • is the model's prediction, while , is the target value.