I have a function $J(X;t)=int_t^infty frac{f(x)}{bar{F(t)}dx$, where $f$ is the probability density function and $bar{F(t)}$ is the survival function. Assuming $X$ follows any distribution I want to do kernel density estimation of $J(X;t)$ and find MSE and Bias. I am using R programming for this. I am trying for a long time but still couldn’t figure it out. Kindly help me! Thanks in advance!
#generate random variable for normal distribution
random_values=rnorm(size,4,2)
#actual density
actual_density=dnorm(random_values,4,2)
#estimated density
est_dens=density(random_values,bw="ucv",adjust=1,kernel="gaussian",n=length(random_values))
#plot(random_values,est_dens)
bias=est_dens$y[1]-actual_density[1]
bias
MSE=((est_dens$y[1]-actual_density[1])^2)
MSE```
I want to use estimate $J(X;t)$. I don't know how to plugin my function here.
New contributor
Aman Pandey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.