Reputation:
i try to plot the probability density function of a chi-Distribution with say 20 degrees of freedom. (NOT a CHI-Square distribution!!) As i found out so far there is the package Runuran in R providing this distribution. But i cannot get this work. Anybody familiar with the syntax of this?
My first try looked like this
library("Runuran")
zwanzig<-udchi(df=20)
f_zwanzig<-ud(zwanzig,0:10)
curve(from=0, to=10, f_zwanzig)
plot((0:10),f_zwanzig(0:10))
Thanks a lot!
Upvotes: 2
Views: 515
Reputation: 25628
Your f_zwanzig
is not defined as a function, whereas it should be.
f_zwanzig <- function(x) ud(zwanzig, x)
curve(from=0, to=10, f_zwanzig)
Upvotes: 1