當前位置: 首頁>>代碼示例 >>用法及示例精選 >>正文


R語言 pweibull()用法及代碼示例


pweibull()R語言中的函數用於計算威布爾分布的累積分布函數的值。它還繪製了累積威布爾函數的密度圖。

用法: pweibull(x, shape)

參數:
x:數字向量
shape:形狀參數

範例1:


# R Program to compute
# Cumulative Weibull Density
  
# Creating a sequence of x-values
x <- seq(-5, 15, by = 1)
  
# Calling pweibull() Function
y <- pweibull(x, shape = 0.2)
y

輸出:

 [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.6321206
 [8] 0.6829508 0.7122695 0.7327332 0.7483534 0.7609229 0.7713981 0.7803493
[15] 0.7881434 0.7950303 0.8011877 0.8067464 0.8118052 0.8164408 0.8207138

範例2:


# R Program to compute
# Cumulative Weibull Density
  
# Creating a sequence of x-values
x <- seq(-5, 15, by = 0.2)
  
# Calling pweibull() Function
y <- pweibull(x, shape = 0.5)
  
# Plot a graph
plot(y)

輸出:

相關用法


注:本文由純淨天空篩選整理自nidhi_biet大神的英文原創作品 Compute the Value of Cumulative Weibull Density in R Programming – pweibull() Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。