未知累积函数的反函数

编程入门 行业动态 更新时间:2024-10-10 11:22:39
本文介绍了未知累积函数的反函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在处理一个数据文件,里面的观察值是随机值.在这种情况下,我不知道x的分布(我的观察).我使用函数密度来估计密度,因为必须应用内核估计.

I'm working with a data file, the observations inside are random values. In this case I don't know the distribution of x (my observations). I'm using the function density in order to estimate the density, because I must apply a kernel estimation.

T=density(datafile[,1],bw=sj,kernel="epanechnikov")

在此之后,我必须将其整合,因为我正在寻找分位数(类似于95%的VaR). 为此,我有2个选择:

After this I must integrate this because I'm looking for a quantile (similar to VaR, 95%). For this I have 2 options:

ecdf() quantile()

现在我有分位数95的值,但这是内核估计的数据.

Now I have the value of the quantile 95, but this is the data estimated by kernel.

是否可以使用一个函数来了解原始数据的分位数95的值?

我指出这是一个未知的分布,为此,我想将一种非参数方法想象为Newton,就像SAS solve()

I remark that this is a distribution unknown, for this I would like to imagine a non parametric method as Newton, like the one that is in SAS solve()

推荐答案

您可以使用 quantile() .这是一个使用随机数据的示例:

You can use quantile() for this. Here is an example using random data:

> data<-runif(1000) > q<-quantile(data, .95) > q 95% 0.9450324

这里,数据均匀地分布在0和1之间,因此第95个百分位数接近0.95.

Here, the data is uniformly distributed between 0 and 1, so the 95th percentile is close to 0.95.

要执行逆变换:

> ecdf(data)(q) [1] 0.95

更多推荐

未知累积函数的反函数

本文发布于:2023-10-26 06:58:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1529408.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:反函数   函数

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!