Redian新闻
>
求助 用eviews做cubic spline
avatar
求助 用eviews做cubic spline# Economics - 经济
j*k
1
想用stl sort来按string size排序。在relational function cmp里面
如果这样用就没问题
bool cmp(string &s1, string &s2)
{
return s1<=s2;
}
可是如果以下面的方式用,就会出现segment fault, 什么原因呢?
bool cmp(string &s1, string &s2)
{
return (s1.length()) <= (s2.length());
}
谢谢
avatar
y*z
2
用eviews做cubic spline怎么做呢?
我eviews太烂了,谢谢大家。
avatar
s*e
3
i do not know where the problem is
but it is more robust to write the cmp this way
bool cmp(const string & s1, const string s2){
return (s1.length())}


【在 j*****k 的大作中提到】
: 想用stl sort来按string size排序。在relational function cmp里面
: 如果这样用就没问题
: bool cmp(string &s1, string &s2)
: {
: return s1<=s2;
: }
: 可是如果以下面的方式用,就会出现segment fault, 什么原因呢?
: bool cmp(string &s1, string &s2)
: {
: return (s1.length()) <= (s2.length());

avatar
I*M
4
你用Matlab吗?那个做cubic spline很方便的。
avatar
j*k
5
能请教一下,为什么不能用<=么

【在 s***e 的大作中提到】
: i do not know where the problem is
: but it is more robust to write the cmp this way
: bool cmp(const string & s1, const string s2){
: return (s1.length()): }
:

avatar
y*z
6
我matlab会一点,不过更烂 T_T
avatar
p*o
7
It is required by the algorithm. Read 25.3 of the C++ standard.
3 For all algorithms that take Compare, there is a version that uses
operator< instead. That is, comp(*i, *j) != false defaults to
*i < *j != false. For the algorithms to work correctly, comp has
to induce a strict weak ordering on the values.
4 The term strict refers to the requirement of an irreflexive relation
(!comp(x, x) for all x), and the term weak to requirements that are
not as strong as those for a total ordering

【在 j*****k 的大作中提到】
: 能请教一下,为什么不能用<=么
avatar
I*M
8
那就在help里找spline,怎么用都写得很清楚的,good luck
avatar
y*z
9
是这样的, 我一作业要求estimate money deamnd function for Japan
time range: 1970Q1 2008Q1
regression: log(m/P) = c i^-1 i^-2 i^-3 i i^2 i^3 log(GDP/P) lags
m=M2+CD or MB
i=short term rate
目的在于i=0, money demand 是不是存在。
所有变量都assume I(1), 以上是老师要求的。extension 自己想。
作出来的结果存在以下问题:
1)用mb做,1993之前的interest rate elasticiy 都大于零。
2)用m2+cd做,完全跟 i 没关系。
我觉得可能是因为money demand的方程变了, 于是乎想到了spline。
不过就我观察, 好像现在用这个做money demand的很少。
莫非这个方法不可行???
那么有什么其他的方法呢?
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。