Hi R user,
I'm studying "Statistical Analysis of Financial Data in S-plus" by Carmona. 
In p.21, the author introduce ksmooth function to plot curve in Kernel estimate method.
For this case, using data set "DSPLR",S&P return, it want to know the distribution of these return on a given day.
There are two methods to do that. One is using density Function ; the other is using kernel estimate method.
Below is my working on R console.
> data(DSPLR)
> class(DSPLR)
[1] "numeric"
> str(DSPLR)
 num [1:10928] 0.00798 -0.00431 -0.00734 -0.00319 -0.01234 ...
> hist(DSPLR,probability=T)
DENS <- ksmooth(DSPLR, kernel="normal",bandwidth = .03)
************************************************
Error in ksmooth(DSPLR, kernel = "normal", bandwidth = 0.03) : 
  y must be supplied.
For density estimation use density()
*************************************************
>From error message above, lack in "y value" into argument.

But, I saw example on textbook. 
Author' version is " DENS <- ksmooth(DSPLR, kernel="normal",bandwidth = .03) "

how to figure out this error message ?

thanks a lot.

	[[alternative HTML version deleted]]

