楼主: qt51212
1787 1

[问答] 求助!!非参数模型问题代码或思路 [推广有奖]

  • 0关注
  • 0粉丝

初中生

23%

还不是VIP/贵宾

-

威望
0
论坛币
843 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
52 点
帖子
5
精华
0
在线时间
21 小时
注册时间
2016-7-4
最后登录
2018-3-28

楼主
qt51212 发表于 2017-2-3 08:51:12 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
先给大家拜个晚年!真心求教下面这个题的C和D问代码如何编写

数据库有5个变量:high.GPA, math.SAT, verb.SAT,univ.GPA
问题是:
(a) Plot histograms and KDEs for the four unique variables (high.GPA, math.SAT, verb.SAT,
univ.GPA) using a Gaussian kernel with the default bandwidth selection rule (bw="nrd0").
(b) Plot a histogram of the GPA difference (university minus high school) and overlay the KDE.
For the KDE use a Gaussian kernel with the default bandwidth selection rule (bw="nrd0").
(c) Use the ECDF to estimate P(U > 3,H < 3) where H and U are a student’s high school and
university GPA, respectively.
(d) Use the ECDF to estimate P(U > 3.5,H < 3.5) where H and U are a student’s high school
and university GPA, respectively.


前两个都容易出
attach(sat)
#a
  par(mfrow=c(1,2))
  hist(high.GPA,freq = F,xlim=c(2,4),ylim=c(0,1))
  kde = density(high.GPA,bw="nrd0",kernel = "gaussian")
  plot(kde,xlim=c(1,5),ylim=c(0,1))
  lines(kde,xlim = c(1,5),col="red")
#b  
  x=univ.GPA-high.GPA
  hist(x,xlim=c(-1,1),freq = F)
  kde = density(x,bw="nrd0",kernel = "gaussian")
  lines(kde,xlim=c(-2,2),col="red")


但是后两问要求用ecdf去估计概率,本以为有类似以mecdf这种函数却发现没有,发现毫无下手之处,恳请各位大佬指点一下。
最后上个数据截图 sat.png
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:非参数 respectively University difference Universit 模型 数据库 university difference default

沙发
qt51212 发表于 2017-2-3 08:52:15
人工顶帖

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-31 03:06