逻辑斯谛回归
此{{#if:|{{#ifeq:none|left|章节|条目或其章节}}}}{{#if:|具有{{{reason}}}的问题,}}需要精通或熟悉{{#if:|[[]]{{#if:|、[[]]{{#if:|、[[]]}}}}|相关主题}}的编者参与及协助编辑。 (2016年9月17日) |
[[Category:自2016年9月{{#if:|需要专家关注的页面|{{#if:2016-09-17T10:19:57+00:00|需要专业人士关注的页面|}}}}|㏰]][[Category:自2016年9月{{#if:|需要专家关注的页面|}}|㏰]][[Category:自2016年9月{{#if:|需要专家关注的页面|}}|㏰]]{{#ifeq:none|left|}}{{#if:
{{#ifeq: | true | dontcat }}{{#ifeq: | no | dontcat }}{{#switch: ¬ | yes | ¬ = | #default = dontcat }}{{#switch: | no = {{#switch: {{#if: | {{#if:{{#titleparts:|0|3}} | subsubpage | {{#if:{{#titleparts:|0|2}} | subpage | basepage }} }} | {{#if:{{#titleparts:邏輯斯諦迴歸|0|3}} | subsubpage | {{#if:{{#titleparts:邏輯斯諦迴歸|0|2}} | subpage | basepage }} }} }}
| basepage =
| subpage = dontcat
| subsubpage = dontcat
}}
| only = {{#switch: {{#if: | {{#if:{{#titleparts:|0|3}} | subsubpage | {{#if:{{#titleparts:|0|2}} | subpage | basepage }} }} | {{#if:{{#titleparts:邏輯斯諦迴歸|0|3}} | subsubpage | {{#if:{{#titleparts:邏輯斯諦迴歸|0|2}} | subpage | basepage }} }} }}
| basepage = dontcat
| subpage = | subsubpage = }}
}}
| |
{{#switch: {{#ifeq: | false | | {{#ifeq: | yes | | {{#ifeq: | yes | | {{#if:x
|
{{#if:{{#titleparts:{{#if:| | 邏輯斯諦迴歸 }}|0|2}} | | }}
}}
}} }} }} | hide = | #default = {{#ifeq: h0#384!5nea+w9 | {{#if:|{{#ifexist:Category:需要{{{1}}}专家关注的页面|[[Category:需要{{{1}}}专家关注的页面]]{{#if:|{{#ifexist:Category:需要{{{2}}}专家关注的页面|[[Category:需要{{{2}}}专家关注的页面]]{{#if:|{{#ifexist:Category:需要{{{3}}}专家关注的页面|[[Category:需要{{{3}}}专家关注的页面]]|}}}}|}}}}|}}|}} | {{#switch: {{#if: | {{{demospace}}} | {{#ifeq:| | main | {{#ifeq:|talk | talk | }} }} }}
| main = {{#switch:{{#ifexpr:({{#if:{{#expr:abs(−1)−1}}|{{#expr:abs(−1)−1}}|1}}=0) or (27=0)|
|{{#if:{{#if:|{{#if:{{#expr:abs(-1)-1}}|{{#if:|{{#ifexpr:((-+1)<>{{#expr:abs(-1)-1}}) and (*<>0)|Error using {{[[{{#switch: |#default = Str mid | = {{#ifeq: | | Template:Str mid | Str mid }}
}}|Str mid]]{{#if:||{{{arg}}}}}}}: indexes i= and j= do not match requested substring length {{ safesubst:#if:1|{{#expr:abs(-1)-1}}}}}}|}}}}}}|Template:Error
|逻辑斯谛回归}}}}{{safesubst:#switch: no |no |n |false |f |否 |0 = | = |¬ = |yes |y |true |t |是 |1 = _IN:_i2=_sublen3={{#expr:abs(-1)-1}}_j4=u_min=Template:Min_CORE:slen:27_i={{#if:}||{{#ifexpr:({{#if:{{#expr:abs(-1)-1}}|1|0}} and {{#if:|1|0}})|{{#expr:Template:Min-{{#expr:abs(-1)-1}}+{{#ifexpr:{{#expr:abs(-1)-1}}<0|-1|1}}}}|1}}}}_j=Template:Min_inv={{#ifexpr:{{#ifeq:{{#expr:abs(−1)−1}}||0|{{#expr:abs(−1)−1}}}}<0|yes|no}}_tchk={{#if:{{#if:|{{#if:{{#expr:abs(-1)-1}}|{{#if:|{{#ifexpr:((-+1)<>{{#expr:abs(-1)-1}}) and (*<>0)|Error using {{[[{{#switch: |#default = Str mid | = {{#ifeq: | | Template:Str mid | Str mid }}
}}|Str mid]]{{#if:||{{{arg}}}}}}}: indexes i= and j= do not match requested substring length {{ safesubst:#if:1|{{#expr:abs(-1)-1}}}}}}|}}}}}}|TCHK|-}}_blankexpr:{{#expr:({{#if:{{#expr:abs(−1)−1}}|{{#expr:abs(−1)−1}}|1}}=0) or (27=0)}}
|#default = _IN:_i2=_sublen3={{#expr:abs(-1)-1}}_j4=u_min=Template:Min_CORE:slen:27_i={{#if:}||{{#ifexpr:({{#if:{{#expr:abs(-1)-1}}|1|0}} and {{#if:|1|0}})|{{#expr:Template:Min-{{#expr:abs(-1)-1}}+{{#ifexpr:{{#expr:abs(-1)-1}}<0|-1|1}}}}|1}}}}_j=Template:Min_inv={{#ifexpr:{{#ifeq:{{#expr:abs(−1)−1}}||0|{{#expr:abs(−1)−1}}}}<0|yes|no}}_tchk={{#if:{{#if:|{{#if:{{#expr:abs(-1)-1}}|{{#if:|{{#ifexpr:((-+1)<>{{#expr:abs(-1)-1}}) and (*<>0)|Error using {{[[{{#switch: |#default = Str mid | = {{#ifeq: | | Template:Str mid | Str mid }}
}}|Str mid]]{{#if:||{{{arg}}}}}}}: indexes i= and j= do not match requested substring length {{ safesubst:#if:1|{{#expr:abs(-1)-1}}}}}}|}}}}}}|TCHK|-}}_blankexpr:{{#expr:({{#if:{{#expr:abs(−1)−1}}|{{#expr:abs(−1)−1}}|1}}=0) or (27=0)}} }}| MOS = | LTA = | NT = | NC = | #default = }} | talk = | user = | wikipedia = | image = | mediawiki = | template = | help = | category = | portal = | wikiproject = | other | #default = }}
| {{#iferror: {{#expr: 1 + {{#switch: {{#if: | {{{demospace}}} | {{#ifeq:| | main | {{#ifeq:|talk | talk | }} }} }}
| main = {{#switch:{{#ifexpr:({{#if:{{#expr:abs(−1)−1}}|{{#expr:abs(−1)−1}}|1}}=0) or (27=0)|
|{{#if:{{#if:|{{#if:{{#expr:abs(-1)-1}}|{{#if:|{{#ifexpr:((-+1)<>{{#expr:abs(-1)-1}}) and (*<>0)|Error using {{[[{{#switch: |#default = Str mid | = {{#ifeq: | | Template:Str mid | Str mid }}
}}|Str mid]]{{#if:||{{{arg}}}}}}}: indexes i= and j= do not match requested substring length {{ safesubst:#if:1|{{#expr:abs(-1)-1}}}}}}|}}}}}}|Template:Error
|邏輯斯諦迴歸}}}}{{safesubst:#switch: no |no |n |false |f |否 |0 = | = |¬ = |yes |y |true |t |是 |1 = _IN:_i2=_sublen3={{#expr:abs(-1)-1}}_j4=u_min=Template:Min_CORE:slen:27_i={{#if:}||{{#ifexpr:({{#if:{{#expr:abs(-1)-1}}|1|0}} and {{#if:|1|0}})|{{#expr:Template:Min-{{#expr:abs(-1)-1}}+{{#ifexpr:{{#expr:abs(-1)-1}}<0|-1|1}}}}|1}}}}_j=Template:Min_inv={{#ifexpr:{{#ifeq:{{#expr:abs(−1)−1}}||0|{{#expr:abs(−1)−1}}}}<0|yes|no}}_tchk={{#if:{{#if:|{{#if:{{#expr:abs(-1)-1}}|{{#if:|{{#ifexpr:((-+1)<>{{#expr:abs(-1)-1}}) and (*<>0)|Error using {{[[{{#switch: |#default = Str mid | = {{#ifeq: | | Template:Str mid | Str mid }}
}}|Str mid]]{{#if:||{{{arg}}}}}}}: indexes i= and j= do not match requested substring length {{ safesubst:#if:1|{{#expr:abs(-1)-1}}}}}}|}}}}}}|TCHK|-}}_blankexpr:{{#expr:({{#if:{{#expr:abs(−1)−1}}|{{#expr:abs(−1)−1}}|1}}=0) or (27=0)}}
|#default = _IN:_i2=_sublen3={{#expr:abs(-1)-1}}_j4=u_min=Template:Min_CORE:slen:27_i={{#if:}||{{#ifexpr:({{#if:{{#expr:abs(-1)-1}}|1|0}} and {{#if:|1|0}})|{{#expr:Template:Min-{{#expr:abs(-1)-1}}+{{#ifexpr:{{#expr:abs(-1)-1}}<0|-1|1}}}}|1}}}}_j=Template:Min_inv={{#ifexpr:{{#ifeq:{{#expr:abs(−1)−1}}||0|{{#expr:abs(−1)−1}}}}<0|yes|no}}_tchk={{#if:{{#if:|{{#if:{{#expr:abs(-1)-1}}|{{#if:|{{#ifexpr:((-+1)<>{{#expr:abs(-1)-1}}) and (*<>0)|Error using {{[[{{#switch: |#default = Str mid | = {{#ifeq: | | Template:Str mid | Str mid }}
}}|Str mid]]{{#if:||{{{arg}}}}}}}: indexes i= and j= do not match requested substring length {{ safesubst:#if:1|{{#expr:abs(-1)-1}}}}}}|}}}}}}|TCHK|-}}_blankexpr:{{#expr:({{#if:{{#expr:abs(−1)−1}}|{{#expr:abs(−1)−1}}|1}}=0) or (27=0)}} }}| MOS = | LTA = | NT = | NC = | #default = {{#if:|{{#ifexist:Category:需要{{{1}}}专家关注的页面|[[Category:需要{{{1}}}专家关注的页面]]{{#if:|{{#ifexist:Category:需要{{{2}}}专家关注的页面|[[Category:需要{{{2}}}专家关注的页面]]{{#if:|{{#ifexist:Category:需要{{{3}}}专家关注的页面|[[Category:需要{{{3}}}专家关注的页面]]|}}}}|}}}}|}}|}}}} | talk = | user = | wikipedia = | image = | mediawiki = | template = | help = | category = | portal = | wikiproject = | other | #default = }} }} | {{#switch:
{{#if: | {{{demospace}}} | {{#ifeq:| | main | {{#ifeq:|talk | talk | }} }} }}
| main = {{#switch:{{#ifexpr:({{#if:{{#expr:abs(−1)−1}}|{{#expr:abs(−1)−1}}|1}}=0) or (27=0)|
|{{#if:{{#if:|{{#if:{{#expr:abs(-1)-1}}|{{#if:|{{#ifexpr:((-+1)<>{{#expr:abs(-1)-1}}) and (*<>0)|Error using {{[[{{#switch: |#default = Str mid | = {{#ifeq: | | Template:Str mid | Str mid }}
}}|Str mid]]{{#if:||{{{arg}}}}}}}: indexes i= and j= do not match requested substring length {{ safesubst:#if:1|{{#expr:abs(-1)-1}}}}}}|}}}}}}|Template:Error
|邏輯斯諦迴歸}}}}{{safesubst:#switch: no |no |n |false |f |否 |0 = | = |¬ = |yes |y |true |t |是 |1 = _IN:_i2=_sublen3={{#expr:abs(-1)-1}}_j4=u_min=Template:Min_CORE:slen:27_i={{#if:}||{{#ifexpr:({{#if:{{#expr:abs(-1)-1}}|1|0}} and {{#if:|1|0}})|{{#expr:Template:Min-{{#expr:abs(-1)-1}}+{{#ifexpr:{{#expr:abs(-1)-1}}<0|-1|1}}}}|1}}}}_j=Template:Min_inv={{#ifexpr:{{#ifeq:{{#expr:abs(−1)−1}}||0|{{#expr:abs(−1)−1}}}}<0|yes|no}}_tchk={{#if:{{#if:|{{#if:{{#expr:abs(-1)-1}}|{{#if:|{{#ifexpr:((-+1)<>{{#expr:abs(-1)-1}}) and (*<>0)|Error using {{[[{{#switch: |#default = Str mid | = {{#ifeq: | | Template:Str mid | Str mid }}
}}|Str mid]]{{#if:||{{{arg}}}}}}}: indexes i= and j= do not match requested substring length {{ safesubst:#if:1|{{#expr:abs(-1)-1}}}}}}|}}}}}}|TCHK|-}}_blankexpr:{{#expr:({{#if:{{#expr:abs(−1)−1}}|{{#expr:abs(−1)−1}}|1}}=0) or (27=0)}}
|#default = _IN:_i2=_sublen3={{#expr:abs(-1)-1}}_j4=u_min=Template:Min_CORE:slen:27_i={{#if:}||{{#ifexpr:({{#if:{{#expr:abs(-1)-1}}|1|0}} and {{#if:|1|0}})|{{#expr:Template:Min-{{#expr:abs(-1)-1}}+{{#ifexpr:{{#expr:abs(-1)-1}}<0|-1|1}}}}|1}}}}_j=Template:Min_inv={{#ifexpr:{{#ifeq:{{#expr:abs(−1)−1}}||0|{{#expr:abs(−1)−1}}}}<0|yes|no}}_tchk={{#if:{{#if:|{{#if:{{#expr:abs(-1)-1}}|{{#if:|{{#ifexpr:((-+1)<>{{#expr:abs(-1)-1}}) and (*<>0)|Error using {{[[{{#switch: |#default = Str mid | = {{#ifeq: | | Template:Str mid | Str mid }}
}}|Str mid]]{{#if:||{{{arg}}}}}}}: indexes i= and j= do not match requested substring length {{ safesubst:#if:1|{{#expr:abs(-1)-1}}}}}}|}}}}}}|TCHK|-}}_blankexpr:{{#expr:({{#if:{{#expr:abs(−1)−1}}|{{#expr:abs(−1)−1}}|1}}=0) or (27=0)}} }}| MOS = | LTA = | NT = | NC = | #default = {{#if:|{{#ifexist:Category:需要{{{1}}}专家关注的页面|[[Category:需要{{{1}}}专家关注的页面]]{{#if:|{{#ifexist:Category:需要{{{2}}}专家关注的页面|[[Category:需要{{{2}}}专家关注的页面]]{{#if:|{{#ifexist:Category:需要{{{3}}}专家关注的页面|[[Category:需要{{{3}}}专家关注的页面]]|}}}}|}}}}|}}|}}}} | talk = | user = | wikipedia = | image = | mediawiki = | template = | help = | category = | portal = | wikiproject = | other | #default = }} | }}
}} }}
}}
逻辑斯谛回归(英语:Logistic regression,又译作逻辑斯谛斯回归、罗吉斯回归、逻辑斯谛斯谛回归、对数几率回归),在统计学中是一种对数几率模型(英语:Logit model,又译作逻辑斯谛模型、评定模型、分类评定模型),是离散选择法模型之一,属于多元变量分析范畴,是社会学、生物统计学、临床、数量心理学、计量经济学、市场营销等统计实证分析的常用方法。
通过使事件的对数发生率(log-odd)成为一个或多个自变量的线性组合,对事件发生的概率进行建模。形式上,在二元逻辑回归中,有一个二元因变量,由指示变量编码,其中两个值标记为“0”和“1”,而自变量每个都可以是二元变量(两个类,由指示变量)或连续变量(任何实值)。标记为“1”的值的相应概率可以在0和1之间变化;将对数发生率转换为概率的函数就是逻辑斯谛函数,因此得名。对数发生率单位称为logit,来自logistic unit。<ref>Hosmer, David W.; Lemeshow, Stanley. Applied logistic regression. Wiley series in probability and statistics 2. ed., [Nachdr.] New York: Wiley. 200. ISBN 978-0-471-35632-5. 缺少或|title=
为空 (帮助)</ref>
二元变量在统计学中广泛用于对某一类别或事件发生概率的建模,例如团队获胜概率、患者健康概率等,而其中,逻辑模型则自大约 1970年以来最常用的二元回归模型。<ref>Cramer, J.S. The Origins of Logistic Regression. SSRN Electronic Journal. 2003. ISSN 1556-5068. doi:10.2139/ssrn.360300 (English).</ref>当存在两个以上可能值(例如图像是否是猫、狗、狮子等)时,二元变量可以推广为分类变量,并且二元逻辑回归推广为多项逻辑回归。如果多个类别是有序的,则可以使用序数逻辑回归。逻辑回归模型本身只是简单地根据输入对输出概率进行建模,并不执行统计分类。<ref>Walker, Strother H.; Duncan, David B. Estimation of the Probability of an Event as a Function of Several Independent Variables. Biometrika. 1967-06, 54 (1/2). doi:10.2307/2333860.</ref>
例子[编辑 | 编辑源代码]
以一个例子说明逻辑回归如何解决实际问题:
一个小组20名学生,各自花费0~6小时准备考试,他们不同的学习时数如何影响通过考试的概率?
问题中的因变量是考试“通过”或者“挂科”,这是用逻辑回归的原因,虽然分别用“1”和“0”表示,但这两个数字不代表基数。如果问题发生变化,用0-100的成绩(基数)代替通过、挂科,则可以使用回归分析。
下表显示每个学生花费在学习上的小时数,以及他们通过(1)或挂科(0)。
小时(xk) | 0.50 | 0.75 | 1.00 | 1.25 | 1.50 | 1.75 | 1.75 | 2.00 | 2.25 | 2.50 | 2.75 | 3.00 | 3.25 | 3.50 | 4.00 | 4.25 | 4.50 | 4.75 | 5.00 | 5.50 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
通过(yk) | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 |
对学习时间(xk)和测试结果(yk = 1 表示通过,0 表示挂科)组成的数据进行拟合。数据点由下标k索引,该下标从1到20。x变量称为“自变量”,y变量称为“分类变量”,由“通过”或“失败”两个类别组成,分别对应于分类值1和0。
模型[编辑 | 编辑源代码]
统计学系列条目 |
回归分析 |
---|
File:Linear regression.svg |
模型 |
估计 |
背景 |
逻辑函数形式为:
- <math>p(x)=\frac{1}{1+e^{-(x-\mu)/s}}</math>
其中μ是位置参数(曲线的中点,其中<math>p(\mu)=1/2</math>),s是尺度参数。该式可重写为:
- <math>p(x)=\frac{1}{1+e^{-(\beta_0+\beta_1 x)}}</math>
<math>\beta_0 = -\mu/s</math>称为截距,是直线<math>y = \beta_0+\beta_1 x</math>的y截距。<math>\beta_1= 1/s</math>是反比例参数或速率参数,是作为"x"函数的对数发生率的"y"截距和斜率。反之,<math>\mu=-\beta_0/\beta_1</math>,并且<math>s=1/\beta_1</math>。
逻辑斯谛分布公式[编辑 | 编辑源代码]
- <math> P(Y=1 | X=x) = \frac{ e^{x'\beta} }{1+ e^{x'\beta}}.</math>
其中参数<math>\beta</math>常用最大似然估计。
IIA假设[编辑 | 编辑源代码]
全名为Independent and irrelevant alternatives假设,也称作IIA效应,指Logit模型中的各个可选项是独立的。
IIA假设示例[编辑 | 编辑源代码]
市场上有A,B,C三个商品相互竞争,分别占有市场份额:60%,30%和10%,三者比例为:6:3:1
一个新产品D引入市场,有能力占有20%的市场——
如果满足IIA假设,各个产品独立作用,互不关联:新产品D占有20%的市场份额,剩下的80%在A、B、C之间按照6:3:1的比例瓜分,分别占有48%,24%和8%。
如果不满足IIA假设,比如新产品D跟产品B相似度高,则新产品D的CP值高而夺去产品B的部分市场(总份额的20%),则产品B剩余10%,而产品A和C的市场份额保持60%和10%不变。
满足IIA假设的优点[编辑 | 编辑源代码]
IIA假设的检验[编辑 | 编辑源代码]
Hausman检验[编辑 | 编辑源代码]
一般化模型的检验[编辑 | 编辑源代码]
IIA问题的解决方法[编辑 | 编辑源代码]
机器学习与数据挖掘 |
---|
File:Multi-Layer Neural Network-Vector-Blank.svg |
多项式Probit模型[编辑 | 编辑源代码]
一般化极值模型[编辑 | 编辑源代码]
可以将可选项间的相关性建模
巢式Logit模型[编辑 | 编辑源代码]
巢式(Nested)表示可选项被分作不同的组,组与组之间不相关,组内的可选项相关,相关程度用1-λg来表示(1-λg越大,相关程度越高)
对偶组合Logit模型[编辑 | 编辑源代码]
一般化分簇Logit模型[编辑 | 编辑源代码]
混合Logit模型[编辑 | 编辑源代码]
应用[编辑 | 编辑源代码]
配体结合分析[编辑 | 编辑源代码]
配体结合分析的典型校准曲线是S形的,下边界(渐近线)靠近背景信号(非特异性结合),而上渐近线靠近最大的饱和响应。 四参数逻辑模型通常是拟合这种形状校准曲线的首选,可以准确描述测量信号值与分析物浓度之间的S形关系。当不对称性明显时会添加第五个参数,但可能会导致拟合算法变得不稳定。<ref>Findlay, John W. A.; Dillard, Robert F. Appropriate calibration curve fitting in ligand binding assays. The AAPS Journal. 2007-06, 9 (2). ISSN 1550-7416. doi:10.1208/aapsj0902029.</ref>
二类评定模型(Binary Logit Model)[编辑 | 编辑源代码]
- 仅有两个可选项:V1n,V2n
变量类型 | 统计量 | 组别比较 | 回归模型 |
---|---|---|---|
numerical | mean | t-test/ANOVA | 线性回归 |
categorical | percentage | Chi-square test | 逻辑斯谛回归 |
persontime | KM estimates (survival curves) |
Log-rank test | 比例风险回归 |
参考书目[编辑 | 编辑源代码]
| references-column-width | references-column-count references-column-count-{{#if:1|{{{1}}}}} }} | {{#if: | references-column-width }} }}" style="{{#if: | {{#iferror: {{#ifexpr: 1 > 1 }} | -moz-column-width: {{#if:1|{{{1}}}}}; -webkit-column-width: {{#if:1|{{{1}}}}}; column-width: {{#if:1|{{{1}}}}}; | -moz-column-count: {{#if:1|{{{1}}}}}; -webkit-column-count: {{#if:1|{{{1}}}}}; column-count: {{#if:1|{{{1}}}}}; }} | {{#if: | -moz-column-width: {{{colwidth}}}; -webkit-column-width: {{{colwidth}}}; column-width: {{{colwidth}}}; }} }}">{{#if:|
- }}{{#if:
|
- Agresti, Alan: Categorical Data Analysis. New York: Wiley, 1990.
- Amemiya, T., 1985, Advanced Econometrics,Harvard University Press.
- Hosmer, D. W. and S. Lemeshow: Applied logistic regression. New York; Chichester, Wiley, 2000.
参见[编辑 | 编辑源代码]
外部链接[编辑 | 编辑源代码]
- UFLDL:Logistic回归 {{#if:||(}}页面存档备份,存于互联网档案馆{{#if:||)}}
- 南佛罗里达大学Logistic回归课程
- 线上计算Logistic回归 {{#if:||(}}页面存档备份,存于互联网档案馆{{#if:||)}}
|