I have the following piece of code in R:
w=rbeta(365,1,3,ncp=0)
hist(10*w,breaks=25,freq=TRUE,xlim=c(0,10), ylim=c(0,60))
h=seq(0,1,0.05)
So far so good.
What I want to do now is to add a line representing the beta function having parameters alpha=1, beta=3
(as in the rbeta
function I used), which takes into account the frequency and not the density. The total number of elements in the rbeta
is 365 (the days in a year) and the reason why I multiply w
by 10 is because the variable I am studying can assume value [0,10]
each day, following the beta distribution described above.
What do I have to do to represent this line?
Summarizing, the histogram is based on simulated values, and I want to show how the theoretical beta function would had behaved in comparison to the simulation.