楼主: oliyiyi
1941 20

S4 Classes and Methods [推广有奖]

11
edmcheng 发表于 2019-1-24 06:19:46 |只看作者 |坛友微信交流群
Thanks a lot!

使用道具

12
oliyiyi 发表于 2019-1-24 07:34:48 |只看作者 |坛友微信交流群
R has three object oriented (OO) systems: [[S3]], [[S4]] and [[R5]]. This page describes S4.

Compared to S3, the S4 object system is much stricter, and much closer to other OO systems. I recommend you familiarise yourself with the way that [[S3]] works before reading this document - many of underlying ideas are the same, but the implementation is much stricter. There are two major differences from S3:

formal class definitions: unlike S3, S4 formally defines the representation and inheritance for each class

multiple dispatch: the generic function can be dispatched to a method based on the class of any number of argument, not just one

Here we introduce the basics of S4, trying to stay away from the esoterica and focussing on the ideas that you need to understand and write the majority of S4 code.

使用道具

13
晏几道 发表于 2019-1-24 10:49:55 |只看作者 |坛友微信交流群
感谢楼主分享

使用道具

14
xyxjcj 发表于 2019-1-24 11:13:09 |只看作者 |坛友微信交流群
学习学习,提高水平

使用道具

15
tmdxyz 发表于 2019-1-24 12:38:50 |只看作者 |坛友微信交流群
S4 Classes and Methods

使用道具

16
oliyiyi 发表于 2019-1-24 15:14:49 |只看作者 |坛友微信交流群
y ~ normal(x * beta, sigma);

使用道具

17
oliyiyi 发表于 2019-1-24 15:15:09 |只看作者 |坛友微信交流群
there is no longer an intercept coefficient alpha. Instead, we have assumed that the first column of the input matrix x is a column of 1 values. This way, beta[1] plays the role of the intercept. If the intercept gets a different prior than the slope terms, then it would be clearer to break it out. It is also slightly more efficient in its explicit form with the intercept variable singled out because there’s one fewer multiplications; it should not make that much of a difference to speed, though, so the choice should be based on clarity.

使用道具

18
bingyang1008 发表于 2019-1-24 16:03:31 |只看作者 |坛友微信交流群
感谢分享!

使用道具

19
xxiaolihong 发表于 2019-1-24 21:28:06 |只看作者 |坛友微信交流群

使用道具

20
piiroja 发表于 2020-4-14 05:24:01 |只看作者 |坛友微信交流群
thx for sharing~

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-19 16:04