简体   繁体   English

R在Mathematica中有类似于TransformedDistribution的东西吗?

[英]Does R have something similar to TransformedDistribution in Mathematica?

I have a random variable X and a transformation f and I would like to know the probability distribution function of f(X) , at least approximately. 我有一个随机变量X和一个变换f ,我想知道f(X)的概率分布函数,至少近似。 In Mathematica there is TransformedDistribution, but I could not find something similar in R. As I said, some kind of approximative solution would be fine, too. 在Mathematica中有TransformedDistribution,但我在R中找不到类似的东西。正如我所说,某种近似解决方案也可以。

You can check the distr package. 你可以检查一下distr包。 For instance, say that y = x^2+2x+1 , where x is normally distributed with mean 2 and standard deviation 5. You can: 例如,假设y = x^2+2x+1 ,其中x通常以均值2和标准差5分布。您可以:

require(distr)
x<-Norm(2,5)
y<-x^2+2*x+1
#y@r gives random samples. We make an histogram.
hist(y@r(10000))
#y@d and y@p are the density and the cumulative functions
y@d(80)
#[1] 0.002452403
y@p(80)
#[1] 0.8891796

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 R是否具有与python,C中的main函数类似的东西? - Does R have something similar to main function as in python, C? R在Python中是否具有与reduce()相同的东西? - Does R have something equivalent to reduce() in Python? Python中是否有类似于R中的quantstrat的东西? - Is there something in Python similar to quantstrat in R? 获取R中的第一个非零数字类似于Mathematica - Get the first non zero digit in R similar to Mathematica 在R 3.0.1中使用pdflatex或类似的东西 - Using pdflatex or something similar in R 3.0.1 R 中是否有类似于 Rust 模式语法的东西? - Is there something similar to Rust pattern syntax in R? 如何使用类似于矩阵索引的东西在R中对列表进行子集化? - How to subset lists in R using something similar to matrix indexation? R Shiny 盒子中的可移动多个项目 - 类似于附加的屏幕截图 - Moveable multiple Items in R Shiny boxes - something similar to attached screenshot 突破Java呼叫或回调或R中的类似内容 - Break out of a Java call or Callbacks or something similar in R 是否有使用R的shapefile与pdf dev.off()类似的东西 - Is there something similar to pdf dev.off() for shapefiles using R
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM