简体   繁体   English

如何绘制常数函数概率密度函数

[英]How to plot a constant function Probability Density Function

I have a function like this: 我有这样的功能:

f(X) = 1/b-a  where a = 5% and b =15% and X = rate of return.

I would like to plot the probability density function of this. 我想绘制这个概率密度函数。

What I have tried: 我尝试过的:

I know I need to use dname() for density or probability function but I do not know the name to pass to this. 我知道我需要使用dname()来表示密度或概率函数,但我不知道要传递给它的名称。

罗马建议,以下内容如何:

curve(dunif(x, min = 5, max = 15),0,20,n=101,xlab='Expected Return',ylab='Density')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM