R语言 计算经验累积分布函数的值 – ecdf()函数

R语言 计算经验累积分布函数的值 – ecdf()函数

R语言中的 ecdf() 函数用于计算和绘制数字向量的经验累积分布函数的值。

语法: ecdf(x)

参数:

x: 数值向量

例1 :

# R Program to compute the value of
# Empirical Cumulative Distribution Function
  
# Creating a Numeric Vector
x <- seq(1, 50, by = 2)
  
# Calling ecdf() Function
y <- ecdf(x)
y
R

输出

Empirical CDF 
Call: ecdf(x)
 x[1:25] =      1,      3,      5,  ...,     47,     49
R

例2 :

# R Program to compute the value of
# Empirical Cumulative Distribution Function
  
# Creating a random vector
x <- rnorm(30)
  
# Calling ecdf() Function
y <- ecdf(x)
  
# Plot a graph
plot(y)
R

输出:

在R语言编程中计算经验累积分布函数的值 - ecdf函数

Python教程

Java教程

Web教程

数据库教程

图形图像教程

大数据教程

开发工具教程

计算机教程

登录

注册