需要 R 包进行分段线性回归吗?

发布于 2024-09-02 02:43:33 字数 1539 浏览 2 评论 0 原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

戈亓 2024-09-09 02:43:33

查看分段包

Check out the segmented package

北斗星光 2024-09-09 02:43:33

SiZer 包

对于此类您想知道某些内容是否存在的情况,搜索 RSeek.org 通常是一个不错的起点已经。

there's a function called piecewise.linear in the SiZer package.

Searching RSeek.org is often a good place to start for instances like this where you want to know if something exists already.

飞烟轻若梦 2024-09-09 02:43:33

您可能还想查看 strucchange 包中的断点函数。
当我有未知数量的断点时,我使用了它。
它易于使用并且有良好的文档。

You might also want to check out the breakpoints function in the strucchange package.
I've used it when I've had an unknown number of breakpoints.
It's easy to use and has good documentation.

硬不硬你别怂 2024-09-09 02:43:33

RWeka包中有一个M5P方法。这是一棵叶子中带有线性方程的回归树。示例代码

library("RWeka")
MT_model <- M5P(DEP ~ ., data = my_data)

有一些参数需要调整...

  MT_model <- M5P(DEP ~ ., data = my_data, control = Weka_control(M = 4, N =  FALSE, U = TRUE, R = FALSE))

查看调整参数的说明:

WOW('M5P')

但是还有 caret 包可以自动调整您的参数。

library(caret)
train(DEP ~ ., data = my_data, method = 'M5')

There is a M5P method in RWeka package. This is a regression tree with linear equations in leaves. Example code

library("RWeka")
MT_model <- M5P(DEP ~ ., data = my_data)

There are some parameters to be tuned…

  MT_model <- M5P(DEP ~ ., data = my_data, control = Weka_control(M = 4, N =  FALSE, U = TRUE, R = FALSE))

To see the description of tunning parameters:

WOW('M5P')

But there is also caret package that can tune your parameters automatically.

library(caret)
train(DEP ~ ., data = my_data, method = 'M5')
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文