2013-01-11 60 views
2

我與核估計的工作,我申請從R中的density功能,我的數據文件(二元),一對夫婦的統計處理,我需要改變這個數據後,在這裏我來問題:非參數反演(累積)分佈函數

有非參數方法的逆累積分佈函數嗎?

我已經嘗試谷歌,ethz論壇,R的幫助,但它似乎失蹤。

回答

3

這聽起來像你想的quantile功能:

# simulate some data 
mydata = rnorm(1000) 

# print the quantiles at a few points 
# (it's the inverse of the cumulative distribution function): 
print(quantile(mydata, .5)) 
print(quantile(mydata, .75)) 

# show the curve from 0 to 1 
curve(quantile(mydata, x)) 
+0

只是爲了澄清:「位數」是「密度」的(在非參數化的意義上)的反函數? – Michelle

+0

你的意思是累積密度?好的。嘗試'曲線(ecdf(mydata)(x),從= -3到= 3)',你會發現它是相反的。 –

+0

我試圖實施你的建議,但似乎我暴露自己錯了。 'Estimated_data = density(原始值,bw = sj,kernel =「epanechnikov」)分位數(Estimated_data,.95)' 這會給我Estimated_data中累計95%的值,而不是「原始」 – Michelle