s*******o 发帖数: 392 | 1 做logistic regression回国前准备:
1. independent variable:国外金融论坛有关交易词汇的统计:比如“trader,
indicator, long, short, market, crazy”等有160个词汇的每日出现的相对频率,经
过normalization,比如trader 的出现的次数除以当天总的帖子数目。
2. 预测对象:binary variable: 明日的volatility是否是top 15%, 比如大于60%这
个值。 这样1 为大于,0 为小于。
用sas的logistic regression做回国,方法backward,因为不可能160个词汇都有预测
能力,所以希望削减variable数量。
模型stay的标准0.05,
结果如下:
问题,最后sas给我选出来的可预测的词汇有52个之多,如上图,df比较高,可是其结
论是这样的模型fit最好,这里是否有overfit的隐私存在呢,或者其他的一些明显的缺
点呢?谢谢大家了 |
n*****n 发帖数: 3123 | 2 一时错觉以为到了海归版
【在 s*******o 的大作中提到】 : 做logistic regression回国前准备: : 1. independent variable:国外金融论坛有关交易词汇的统计:比如“trader, : indicator, long, short, market, crazy”等有160个词汇的每日出现的相对频率,经 : 过normalization,比如trader 的出现的次数除以当天总的帖子数目。 : 2. 预测对象:binary variable: 明日的volatility是否是top 15%, 比如大于60%这 : 个值。 这样1 为大于,0 为小于。 : 用sas的logistic regression做回国,方法backward,因为不可能160个词汇都有预测 : 能力,所以希望削减variable数量。 : 模型stay的标准0.05, : 结果如下:
|
r********n 发帖数: 6979 | 3 52个感觉是多了一点
我不用sas
所以不知道这个logistic regression是怎么得到这些系数的
你可以试试用一些Bayesian methods
加上一些df的penalty
比方LASSO之类的
应该得到的df要小一些 |
s*******o 发帖数: 392 | 4
他是这样得到这些系数的,因为我搜集了很多大概160个字符的频率作为预测的对象,
所以我让sas做backward variable selection,大体意思就是一开始sas默认有160个
variable都可以用预测,但是下一步就会筛选,看哪个var去掉后对model的影响最小,
这样一轮一轮的下来,最终当任何一个余下的var被去掉后都会对model的预测好坏有影
响的时候,就停下了。
我还有一个类似的预测,不过最后只剩下22个var,不知道如何interpret它们的好坏。
【在 r********n 的大作中提到】 : 52个感觉是多了一点 : 我不用sas : 所以不知道这个logistic regression是怎么得到这些系数的 : 你可以试试用一些Bayesian methods : 加上一些df的penalty : 比方LASSO之类的 : 应该得到的df要小一些
|
a*z 发帖数: 294 | 5 you may try best subset method instead stepwise? |
s*******o 发帖数: 392 | 6
hi,man, thanks lot for your reply first.
you are right, subset is a nice way. Correct me if I am wrong:
Subset: if you have 160 variables, the sas would go to see what is best for
modeling with 1 variable, what is best with 2 vars, what is best.....what is
best for 159 vars. And overall, it compare to see which is best out of best
of 160 way with 1, 2, 3, 4....160 variables to predict or modeling. I would
try.
But here I did not use stepwise, I use backward which method I read
somewhere telling me that it is the best if you have lot of variable and not
sure about their significance then you ask sas to modeling at beginning
including all of them then we based on criteria to reduce the number of
variables. They say it is the best way to not neglect some important
variable and it is kind of better off of backward over stepwise and forward
in logisticregression.
Man, how do you think about the graph above and 52 significant variable to
be used with high degree of freedom 52?
Thanks again.
【在 a*z 的大作中提到】 : you may try best subset method instead stepwise?
|
a***g 发帖数: 2761 | 7 拿cross validation套一下,估计能看出个大概
【在 s*******o 的大作中提到】 : : hi,man, thanks lot for your reply first. : you are right, subset is a nice way. Correct me if I am wrong: : Subset: if you have 160 variables, the sas would go to see what is best for : modeling with 1 variable, what is best with 2 vars, what is best.....what is : best for 159 vars. And overall, it compare to see which is best out of best : of 160 way with 1, 2, 3, 4....160 variables to predict or modeling. I would : try. : But here I did not use stepwise, I use backward which method I read : somewhere telling me that it is the best if you have lot of variable and not
|
r********n 发帖数: 6979 | 8 backward selection我当然知道它是怎么做的
我是不大明白sas是怎么estimate regression coefficients
估计是用EM algorithm得到一个point estimate
如果用Bayesian的方法
可以加不同的prior
如果你想要少一点的predictor
那就可以加一些强一点的prior
这样大部分的系数都是接近与0
你试试LASSO
sas应该有LASSO的函数
【在 s*******o 的大作中提到】 : : hi,man, thanks lot for your reply first. : you are right, subset is a nice way. Correct me if I am wrong: : Subset: if you have 160 variables, the sas would go to see what is best for : modeling with 1 variable, what is best with 2 vars, what is best.....what is : best for 159 vars. And overall, it compare to see which is best out of best : of 160 way with 1, 2, 3, 4....160 variables to predict or modeling. I would : try. : But here I did not use stepwise, I use backward which method I read : somewhere telling me that it is the best if you have lot of variable and not
|
p*******r 发帖数: 1951 | 9 你有没有检测一下correlation between independent variables?高度相关的变量可
以考虑合并,或者用一些消减变量的方法。
你有没有计算pseudo r square? 如果这个值比较低,那你这个模型做预测的准确性估
计不太乐观。反之,就还不错。 |
s*******o 发帖数: 392 | 10
啥意思,不懂啊?我就是用的cross validation,你套一下啥意思?
【在 a***g 的大作中提到】 : 拿cross validation套一下,估计能看出个大概
|
|
|
s*******o 发帖数: 392 | 11
好的,我这就去尝试一下lasso,bayesian怎么搞,sas里边具体函数是什么名字呢?
【在 r********n 的大作中提到】 : backward selection我当然知道它是怎么做的 : 我是不大明白sas是怎么estimate regression coefficients : 估计是用EM algorithm得到一个point estimate : 如果用Bayesian的方法 : 可以加不同的prior : 如果你想要少一点的predictor : 那就可以加一些强一点的prior : 这样大部分的系数都是接近与0 : 你试试LASSO : sas应该有LASSO的函数
|
f*********y 发帖数: 376 | 12 do you know how to do backward variable selection in STATA?
【在 s*******o 的大作中提到】 : : 好的,我这就去尝试一下lasso,bayesian怎么搞,sas里边具体函数是什么名字呢?
|
a***d 发帖数: 336 | 13 it is maximum likelihood estimation for logistic regression.
【在 r********n 的大作中提到】 : backward selection我当然知道它是怎么做的 : 我是不大明白sas是怎么estimate regression coefficients : 估计是用EM algorithm得到一个point estimate : 如果用Bayesian的方法 : 可以加不同的prior : 如果你想要少一点的predictor : 那就可以加一些强一点的prior : 这样大部分的系数都是接近与0 : 你试试LASSO : sas应该有LASSO的函数
|
s*******o 发帖数: 392 | 14 没错,楼上的,就是靠maximum likelihood搞得,还有aic 以及-2log |
s*******o 发帖数: 392 | 15 没错,楼上的,就是靠maximum likelihood搞得,还有aic 以及-2log |
S*x 发帖数: 705 | 16 52个肯定多,有没有做proc corr来看variable之间的相关性? 有些时候很多variable是
成对成对出现的
你按照wald score排序来做一个cumulative wald score,肯定会发现最后
那些var都是用不到的
另外你这个图只显示model本身,logistic regression的somer's D呢? c score呢?
如果以上的数据都不错,你还得需要看validation来证明model是可用的
【在 s*******o 的大作中提到】 : 做logistic regression回国前准备: : 1. independent variable:国外金融论坛有关交易词汇的统计:比如“trader, : indicator, long, short, market, crazy”等有160个词汇的每日出现的相对频率,经 : 过normalization,比如trader 的出现的次数除以当天总的帖子数目。 : 2. 预测对象:binary variable: 明日的volatility是否是top 15%, 比如大于60%这 : 个值。 这样1 为大于,0 为小于。 : 用sas的logistic regression做回国,方法backward,因为不可能160个词汇都有预测 : 能力,所以希望削减variable数量。 : 模型stay的标准0.05, : 结果如下:
|
s*******o 发帖数: 392 | 17
variable是
这个预测volatility的不太对。我现在改预测下一天eurusd是上涨还是下跌,这个感觉
比较靠谱。最后的结果是22个,但是还是penalty很大,可是sas已经不肯继续降低维度
了。那个c score是0.649左右,一般般。不过你也知道,我考虑只采用预测predicted
probability最高的10%,预测的精度在78左右,而且用到策略上也可以盈利,至于
validate,这个不就是cross-validation么?还需要怎么样的validate?
【在 S*x 的大作中提到】 : 52个肯定多,有没有做proc corr来看variable之间的相关性? 有些时候很多variable是 : 成对成对出现的 : 你按照wald score排序来做一个cumulative wald score,肯定会发现最后 : 那些var都是用不到的 : 另外你这个图只显示model本身,logistic regression的somer's D呢? c score呢? : 如果以上的数据都不错,你还得需要看validation来证明model是可用的
|
s*******o 发帖数: 392 | 18 那些自变量的corr不高,最高23%,一般都在10%一下。 |