Self -informationIn information theory and statistics, “surprise” is quantified by self-information. For an event x with probability p(x), the amount of surprise (also called information content) is defined as
This definition has several nice properties:
Rarity gives more surprise: If p(x) is small, then I(x) is large — rare events are more surprising.
Certainty gives no surprise: If p(x)=1, then I(x)=0. Something guaranteed to happen is not surprising at all.
Additivity for independence...
Definition
Mutiplication - Recursion
Mutiplication - iteration
Observation
类比思路
TOWERS OF HANOI1234567891011121314151617def tower(n,fro,to,spare): if n==1: print("from %c to %c" % (fro,to)) else: tower(n-1,fro,spare,to) tower(1,fro,to,spare) tower(n-1,spare,to,fro)# 测试汉诺塔函数tower(3, 'A', 'B', 'C')
fro:起点to:终点spare:空闲的柱子
123456789101112131415161718192021222324252627def permuation(num): res=[] def backtrack(start): if start==len(num): re...
O-notation注意:计算机教材的写法 是一个元素, 代表属于,是一个集合
定义回顾
例子 1:
这里
要检查是否成立:
化简:
当,,所以总能找到 c。
比如选 c=1,那么只要 ,。
所以
例子 2:
这里
检查是否成立:
化简:
这要求:
但随着 n 越来越大,不可能存在一个有限常数 c 让不等式一直成立。
所以 。
Macro substitution第一条:左边元素,右边集合,左边元素一定存在于右边。第二条:两边都是集合,左边整体是右边的子集,左边任意元素都能在右边被找到。
Operations of 𝑶-notation
,
-notation
-notation and -notation
Transitivity
卖出以及何时卖出费雪认为,卖出股票的三个理由:①、当初买进行为犯下错误,某特定公司的实际状况显著不如原先设想那么美好。在某种程度上,要看投资者能否坦诚面对自己。②、当成长股成长潜力消耗殆尽,股票与持有原则严重脱节时,就应该卖出。③、有更加前景远大的成长股可以选择。
费雪认为投资者不应该因为空头市场的担忧而卖出股票(恐惧熊市的到来)。他认为这样做无异于要求投资者知道空头市场何时出现,以及何时结束(在空头市场底部买回股票)。但通常情况是投资者卖出后,空头市场并未出现,市场继续上扬。等到空头市场真的来临时,却从来没有见过比卖出价格更低的位置买回相同股票的投资者。通常的情况是,股价并没有跌回卖出价,但投资者仍苦苦等待,或者股价真的一路下挫跌过卖出价,他们却又忧虑别的事情而不敢买回。
费雪提醒:投资者不应该因为手上的股票涨幅过大就卖出股票。因为,“涨幅过大”、“估值过高”,都是非常模糊的概念。没有证据表明多高的估值或者涨幅才是最高。
投资者的“五不原则”原则一:不买处于创业阶段的公司。(注:中国式创业板其实不属于创业阶段的公司)
费雪认为创业阶段的公司,投资者只能看到它的运作蓝图,并猜测它...
多元回归
以 multiple linear regression with two predictors 为例
$$\tilde{y}i = y_i - \bar{y},\quad \tilde{x}{i2} = x_{i2} - \bar{x}2,\quad \tilde{x}{i3} = x_{i3} - \bar{x}_3 .$$
important point: In this model, as in many others, it is important to recognize that the model is an approximation to reality in the region for which we have data; including an intercept improves this approximation even when it is not directly interpretable
• Estimated regression models describe the relationship between the ...
Hypothesis testing on a single parametert-test(查表)
补充说明:
significant leve = Prob(type I error)In hypothesis testing, the significance level is defined as the probability of committing a Type I error, i.e., rejecting the null hypothesiswhen it is in fact true. In other words, represents the maximum risk of a false positive that the researcher is willing to tolerate.
Rejection region(拒绝域)
拒绝域 = 在原假设为真时,观测到的检验统计量落入极端区域(尾部)的区间。
“极端”是相对于 备择假设所描述的方向 来定义的。
In short, the sign and form of the alter...
Coefficient of determination and sample correlation coefficient
推导:推导 1: (一元线性回归)在简单线性回归模型中:
$$\hat{y}{i}=b{1}+b_{2}x_{i}\hat{y_{i}}=\bar{y}-b_{2}\bar{x}+b_{2}x_{i}\hat{y_{i}}=\bar{y}+\frac{S_{xy}}{S_{xx}}(x_{i}-\bar{x})$$定义相关系数:
推导 2: (一般线性回归)考虑一般线性回归(可能是多元):
相关系数定义为:
在 OLS 回归中,残差与预测值正交:
因此:
代入得:
Estimating the variance of the error term样本方差无偏性推导
Estimators are not normally distributed
1. 两种情况
情况 A:假设误差 那么 都是 的线性组合,而正态分布的线性组合仍然是正态。 所以此时可以直接得出:
情况 B:不假设 正态,只要求它们 i.i.d.,有...