English 中文(简体)
统计:回归不能产生不可逆转的倒退?
原标题:Statistics::Regression cannot run univariate regression?

使用<代码>的每个模块 统计:回归。 它对多变回归者处以罚款。 然而,如果我只向建筑商提供一名回归者的话。

my $reg = Statistics::Regression->new("Sample Regression", [ X ]);

它对这一信息提出申诉:

Statistics::Regression:new: Cannot run a regression without at least two variables.

是否有同样的问题? 错误信息没有明确表述,因此我的理解是,如果我不提供答复变量。 但是,这并不是基于其理论和我测试的一些样本文字,而建筑商中的清单参考资料只应包括回归者。

不管怎样,你如何利用这个模块进行单一变式回归(没有固定期限)? (我知道<代码>Statistics:OLS可做到这一点,但就简而言之,我希望这一模块发挥作用。 不管怎样,如果它真正无法处理,就认为这种疏忽是一种 st。 Thx!

最佳回答

The module s description reads:

回归.pm是一种多变的线性回归一揽子计划。

有鉴于此,似乎不可能让你能够避免倒退。

http://search.cpan.org/~iawelch/“rel=“nofollow”>,作者。 自<代码>Statistics:Regression 发布至阿根廷国家计算机研究院已有四年时间,因此他可能停止支持这一系统(或者说,它不需要更多的释放),但值得一枪声地征求他的意见。 他可能会有某种想法,可以将其派起来,处理无休止的倒退。

问题回答

To make this work for univariate, specify a constant, like this: (include s first argument is y, second is [ constant, x ]). You can also specify 0 as the constant if you don t want the intercept

my $reg=Statistics::Regression->new("Title", ["Intercept", "Slope"]);
 
$reg->include(1.3, [1.0, 1.0]);
$reg->include(2.9, [1.0, 2.0]);
$reg->include(4.2, [1.0, 3.0]);
$reg->include(5.4, [1.0, 4.0]);

http://perlgems.blogspot.com/07/performing-linear-regression-in-perl.html





相关问题
Why does my chdir to a filehandle not work in Perl?

When I try a "chdir" with a filehandle as argument, "chdir" returns 0 and a pwd returns still the same directory. Should that be so? I tried this, because in the documentation to chdir I found: "...

How do I use GetOptions to get the default argument?

I ve read the doc for GetOptions but I can t seem to find what I need... (maybe I am blind) What I want to do is to parse command line like this myperlscript.pl -mode [sth] [inputfile] I can use ...

Object-Oriented Perl constructor syntax and named parameters

I m a little confused about what is going on in Perl constructors. I found these two examples perldoc perlbot. package Foo; #In Perl, the constructor is just a subroutine called new. sub new { #I ...

Where can I find object-oriented Perl tutorials? [closed]

A Google search yields a number of results - but which ones are the best? The Perl site appears to contain two - perlboot and perltoot. I m reading these now, but what else is out there? Note: I ve ...

热门标签