海森矩阵 What is the Hessian matrix? What is it used for and for what reason?




您可以将Hessian用于其他答案中描述的各种事物。一种基本用法是作为第二阶导数测试。

一阶微积分的二阶导数检验

The second derivative test In calculus of one variable
Do you remember first semester calculus when you learned the second derivative test? It went like this. You've got a function f, and you want to optimize it;find where it takes its maxunum value and its minimum value.
当您学习二阶导数测验时,您还记得第一学期的微积分吗? 像这样您已经有了一个函数f:R->R,并且想要对其进行优化;找到它取最大值和最小值的位置。
For a differentiable function on an open interval that can only occur where the first derivative f' is 0, at places called critical point. So you computed the first derivative. set it to 0, and solved the equation f ' (x) = 0. That told you where you might find the extreme values of f .
对于开放区间上的微分函数,该区间只能在第一阶导数f'为0的情况下发生在临界点处。 因此,您计算了一阶导数。 将其设置为0,并求解方程f'(x)=0。这告诉您在哪里可以找到f的极值。
Then you took the second derivative f'' , and evaluated it at each of the critical points in turn. If the second derivative was negative. then you had a local maximum; if the second derivative was positive. then you had a local minimum; if the second derivative was zero. then the test was inconclusive and you had to try something else:
然后,您取二阶导数f'',并依次在每个关键点对其进行评估。 如果二阶导数为负。那么你有一个局部最大值 如果二阶导数为正。 那么你有一个局部最小值 如果二阶导数为零。 那么测试是不确定的,您必须尝试其他方法:
The second derivative test when there's more than one varlable
Now you've got a function of n variables. Let's make it three variables to make it complicated enough to see what's going on. f : R3-->R
You find the critical points. Those will be where the three partial derivatives are simultaneously 0. So you solve the three equations

一个变量以上时的二阶导数测试

现在,您有了n个变量的函数。 让我们将其设为三个变量,使其足够复杂以查看正在发生的情况。 f:R3-> R
您找到了关键点。 这些将是三个偏导数同时为0的地方。因此,您可以求解三个方程



and that will tell you where the extreme values of f could occrur
Next you take all the second partial derivatives of them. There are nine of them,but the mixed partial derivatives are going to be the same since the functions we're looking at are all nice. You put them in a matrix called the Hessian Hf.
这将告诉您f的极值可能会出现在哪里
接下来,您将使用它们的所有第二个偏导数。 它们有九个,但是混合的偏导数将是相同的,因为我们要查看的函数都很好。 您将它们放在称为Hessian Hf的矩阵中。



Evaluate this Hessian at each of your critical points. and the resulting matrix will tell you what kind of critical point it is.
Like the second derivative test for functions of one variable,sometimes it’s inconclusive.That will happen when the determinant of the Hessian is 0. If that determinant is not 0 ,you can tell. In order to tell, you have to compute the sequence of principle minors d1, d2, d3. (There are more of them if n > 3. )
The first principle minor d1 is just the upper left entry of the matrix. The second d2 is the determinant of the upper left 2 by 2 submatrix of the matrix.And so forth. (So when n = 3, d3 is the determinant of the entire matrix)

在您的每个关键点上评估此粗麻布。 然后得出的矩阵将告诉您这是哪种临界点。
就像对一个变量的函数进行二阶导数检验一样,它有时是不确定的。当Hessian的行列式为0时,就会发生这种情况。 为了说明这一点,您必须计算主辅音d1,d2,d3的顺序。 (如果n> 3,则更多。)
第一个基本次要d1只是矩阵的左上角条目。 第二个d2是矩阵左上角2×2子矩阵的行列式,依此类推。 (因此,当n = 3时,d3是整个矩阵的行列式)
If all of them, d1, d2, d3, are positive, then you've got a minimum. If they alternate_negative. positive, negative, etc.-then you've got a maximum.Othenwise you've got a saddlle point.
Saddle points can occur with n > 2. A function with a saddle is illustrated below.
So, that's one reason for a Hessian. It's used in a second derivative test to find extreme values of functions of more than one variable.
如果所有d1,d2,d3均为正数,则您有一个最小值。 如果它们为alter_negative。 正数,负数等-然后得到最大值,然后得到鞍点。
当n> 2时,可能会出现鞍点。带有鞍的功能如下所示。
因此,这就是使用海森矩阵的原因之一。 在二阶导数测试中使用它来查找多个变量的极值。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 158,117评论 4 360
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 66,963评论 1 290
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 107,897评论 0 240
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 43,805评论 0 203
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,208评论 3 286
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,535评论 1 216
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,797评论 2 311
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,493评论 0 197
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,215评论 1 241
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,477评论 2 244
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 31,988评论 1 258
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,325评论 2 252
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 32,971评论 3 235
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,055评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,807评论 0 194
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,544评论 2 271
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,455评论 2 266

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,099评论 0 10
  • The Inner Game of Tennis W Timothy Gallwey Jonathan Cape ...
    网事_79a3阅读 10,997评论 2 18
  • 周末往返深圳长沙两地的高铁,将弗兰克上次送的《越孤独 越自由》塞进了行李箱。 坦白来说,我对本书的作者傅踢踢一无所...
    旦卉阅读 332评论 0 0
  • 近一段时间,我的精神状态恢复得不错,甚至变得比以前更加自信,大方和开朗了。有一些体会,借此记录下来。 一天晚上自我...
    幸噗噗阅读 501评论 3 3
  • 当你见过最深邃的大海 那所有的湖泊河流在你面前都不值一提 当你爬过最危耸的喜马拉雅 那任何一座山峰在你脚下都毫无压...
    乙卉阅读 165评论 0 4