楼主: kizgel
19602 2

[问答] 关于画PDF和CDF的一些问题 [推广有奖]

  • 0关注
  • 0粉丝

本科生

37%

还不是VIP/贵宾

-

威望
0
论坛币
2 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
1059 点
帖子
68
精华
0
在线时间
60 小时
注册时间
2012-11-1
最后登录
2017-8-21

楼主
kizgel 发表于 2015-4-21 22:52:36 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
t <- seq(from=-3,to=3,by=0.01)
plot(t,dnorm(t),ylab="PDF")
plot(t,pnorm(t),ylab="PDF")
这个是画简单的PDF和CDF图,现在又如下要求:
plotthe probability density function and cumulative distribution function(Prob(T)<t) for the t-distribution with infinity, 10 and 1 degree offreedom.Make the y-limit of the first and second figure rangefrom 0 to 0.5 and 0 to 1 respectively. Make sure the main title is in a fonttwice the default size, the y-axes are labeled as shown, and the line types 1,2and 3 correspond to the t-distribution with Inf, 10 and 1 degree of freedomrespectively.
标题和两个坐标轴有一些要求,这个较好实现,但是在一张图上实现3个不同的自由度的绘图,然后要怎么实现呢,效果图如下所示: QQ截图20150421224913.jpg
前辈们,在具体的函数中要用到哪些参数,能指教一下吗,谢谢
二维码

扫码加我 拉你入群

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

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

关键词:cdf PDF

QQ截图20150421224913.jpg (32.23 KB)

QQ截图20150421224913.jpg

沙发
hugebear 发表于 2015-4-22 00:44:49
The basic idea is to use "lines" function to add pdf lines one by one, take "pdf" assignment for example:
  1. pts <- seq(-3, 3, length = 1000)
  2. plot(pts, dnorm(pts), type = "n", xlim = c(-3, 3), ylim = c(0, 0.5), main =
  3. "PDF", xlab = "x", ylab = "f(x)")
  4. lines(pts, dnorm(pts), lty = 1)
  5. lines(pts, dt(pts, df = 10), lty = 2)
  6. lines(pts, dt(pts, df = 1), lty = 3)
  7. legend("topright", c(expression(paste("df = ", infinity)), "df = 10", "df = 1"), lty = 1:3)
复制代码
已有 1 人评分论坛币 收起 理由
admin_kefu + 25 热心帮助其他会员

总评分: 论坛币 + 25   查看全部评分

藤椅
kizgel 发表于 2015-4-23 08:30:09
hugebear 发表于 2015-4-22 00:44
The basic idea is to use "lines" function to add pdf lines one by one, take "pdf" assignment for exa ...
谢谢哥们,昨天在网上查找的过程中,已经大概掌握了思路,就是卡在了自由度这里

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

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