overlap theoretical density with empiric density

#1
I am a neophyte of R, and I am facing the problem to overlap theoretical density with empiric density. The data are extracted from

https://faculty.chicagobooth.edu/-/media/faculty/ruey-s-tsay/teaching/fts3/m-ibm3dx2608.txt

the script in R are:

#1) empiric density:

dim(ibmm)

ibmm[1,]

sibmm=ibmm[,2]

densityPlot(sibmm, bw="SJ", adjust=1, kernel="gaussian",
method="kernel", xlab="Rend. mens. sempl. IBM", ylab="densità", col="blue")

#2) theoretical density:
x<- seq(from=-0.261905, to=0.470588, 0.005)

curve(dnorm(x,m=0.0135,sd=0.0715),from=-0.261905,to=0.470588,
xlab="N(0.0135;0.0715^2)", ylab="Densità", main=paste("Normale -
freq. teorica rend. mens IBM: Media=0.0135, Dev.St.=0.0715"),
type="l",lty=2)

Can anyone help me? Thank you. Stefano
 

Attachments

hlsmith

Less is more. Stay pure. Stay poor.
#2
So you just want to overlay these? I think in R base plots you just add the word, "add", in the first piece of code.