简体   繁体   English

如何为 r 中的指数分布生成估计参数(标准差和均值)?

[英]How to generate the estimate parameters (Standard deviation and mean) for an exponential distribution in r?

For example:例如:

#Using QQ-plots to decide which of the Normal, Gumbel and Exponential distribution best fits Qc
qqplot(x=qexp(ppoints(length(data$Qc))), y=data$Qc, main="Exponential Q-Q Plot",
       xlab="Theoretical Quantiles", ylab= "Data Quantiles")
qqplot(x=qnorm(ppoints(length(data$Qc))), y=data$Qc, main="Normal Q-Q Plot",
       xlab="Theoretical Quantiles", ylab= "Data Quantiles")
qqplot(x=qgumbel(ppoints(length(data$Qc))), y=data$Qc, main="Gumbel Q-Q Plot",
       xlab="Theoretical Quantiles", ylab= "Data Quantiles"

How can I generate the estimate parameters (ie the standard deviation and the mean) for normal distribution or the exponential distribution after suppose that I think a normal/exponential distribution is a good model to fit my variable?在假设我认为正态/指数分布是适合我的变量的好模型之后,如何生成正态分布或指数分布的估计参数(即标准偏差和平均值)?

exponential指数的

MASS::fitdistr(Qc, dexp, start = list(rate = 0.1))
## 0.0338
## however, the maximum likelihood estimate of the exponential rate parameter
##  is just 1/mean(x):
(r <- 1/mean(Qc))
## 0.0338
pexp(30, rate = r, lower.tail = FALSE)  ## 0.362

normal普通的

The sample mean and sample standard deviation give good estimates of the mean and SD parameters of the Normal (although we could use fitdistr if we really want to):样本均值和样本标准差可以很好地估计 Normal 的均值和 SD 参数(尽管如果我们真的想使用fitdistr可以使用):

MASS::fitdistr(Qc, dnorm, start = list(mean = 25, sd = 7))
pnorm(30, mean = mean(Qc), sd = sd(Qc), lower.tail = FALSE)  ## 0.473

Gumbel贡贝尔

library(fitdistrplus)
library(VGAM)
fitdist(Qc, "gumbel", start = list(location = 25, scale = 1)) 
pgumbel(30, location = 27.03, scale = 7.56, lower.tail = FALSE) ## 0.491

empirical经验

We could just compute the observed probability of values > 30:我们可以计算观察到的值 > 30 的概率:

mean(Qc>30)  ## 0.469

暂无
暂无

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

相关问题 如何用 R 估计指数 function 的参数? - How to estimate parameters of exponential function with R? 使用 R 中的伽马分布估计均值和置信区间的标准差 - Estimating the standard deviation from mean and confidence intervals with a gamma distribution in R 如何在 R 中生成负指数分布 - How to generate a negative exponential distribution in R 如何计算R中多个标准差的平均值 - How to calculate mean of multiple standard deviation in R 在R中定义指数分布以估计概率 - Defining exponential distribution in R to estimate probabilities 如何编码加权二项式分布的均值和标准差? - How can I code the mean and standard deviation for a weighted binomial distribution? 在 R 中生成具有均值、标准差和特定自相关的随机序列 - Generate random sequence with mean, standard deviation and a specific autocorrelation in R 如何生成均值,标准偏差相同但R中形状或分布完全不同的数据? - How do I generate data that have the same mean, standard deviation but very different shapes or distributions in R? 如何通过在 R 中创建额外的列(均值和标准差)来获得相同数据帧的均值和标准差的结果 - How to get the results of a mean and standard deviation to the same data frame by creating extra columns (mean and standard deviation) in R 如何计算 r 中任意分布的标准偏差? - How do I calculate the standard deviation of an arbitrary distribution in r?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM