0

我想知道如何计算P ≥ -0.0001。我在数学、统计学和 R 方面都是新手。

我目前正在 R 中对一些传播数据进行建模。我已经能够将数据建模为特定分布(在下面的示例中,这是双曲线)并执行似然比测试以确认使用指定分布的可行性。

在我的脑海中,一旦我获得了分布,我现在能够更可靠地计算我的概率,因为我更准确地了解了曲线下方的区域?

我曾假设一旦分布匹配,我就可以对 t 统计量进行类似的测试,但是我不知道如何做到这一点。

我已经看到了这些pnorm(x)函数,也看到phyper了但是无法弄清楚如何简单地计算P ≥ -0.0001.

以下是我的代码,非常感谢您的帮助;

`# 库 (ghyp) 库 (timeSeries)

# Coverting to Time Series 
E <- timeSeries(A[,"Spread"])

# Fitting
ef <- (density(E))
ghdfit <- fit.ghypuv(E,symmetric = FALSE, control = list(maxit = 1000))
hypfit <- fit.hypuv(E,symmetric = FALSE, control = list(maxit = 1000))
nigfit <- fit.NIGuv(E,symmetric = FALSE, control = list(maxit = 1000))

# Density
ghddens <- dghyp(ef$x, ghdfit)
    hypdens <- dghyp(ef$x, hypfit)
nigdens <- dghyp(ef$x, nigfit)
    nordens <- dnorm(ef$x, mean = mean(E),sd = sd(c(E[,1])))
col.def <- c("black","red","green","orange")
plot(ef, xlab = " Spread ", ylab = expression(f(x)),ylim = c(0,50), main ='CABLE - 3 Day Comparison across 28 Years')
lines(ef$x, ghddens, col = "red")
    lines(ef$x, hypdens, col = "blue")
lines(ef$x, nigdens, col = "green")
    lines(ef$x, nordens, col = "orange")
legend("topleft", legend = c("Empirical","GHD","HYP","NIG","NORM"), col = col.def, lty = 1)



# QQ Plot
        qqghyp(ghdfit, line = TRUE, ghyp.col = "red", plot.legend = FALSE, gaussian = FALSE, main = " ", cex = 0.8)
        qqghyp(hypfit, add = TRUE, ghyp.pch = 2, ghyp.col = "green", gaussian = FALSE, line = FALSE, cex = 0.8)
        qqghyp(nigfit,add = TRUE, ghyp.pch = 3, ghyp.col = "orange", gaussian = FALSE, line = FALSE, cex = 0.8)
        legend("topleft", legend = c("GHD","HYP","NIG"), col = col.def[-c(1,5)], pch = 1:3)

       # Diagnostic
        options(scipen=999)
        AIC <- stepAIC.ghyp(E, dist = c("ghyp","hyp","NIG"), symmetric = FALSE, control = list(maxit=1000))
        LRghdnig <- lik.ratio.test(ghdfit,nigfit)
        LRghdhyp <- lik.ratio.test(ghdfit,hypfit)

LRghdhyp $statistic L 0.07005745

$p.value 1 0.0211198

$df 1 1

$H0 1 假

所以,我知道正确的分布以及如何适应它。如何确定> - 0.0001发生的概率?

hypfit

4

1 回答 1

0

答案张贴在这里并涉及pghyp功能@fg nu

于 2015-01-31T19:57:03.447 回答