• R语言绘制瑞利分布和指数分布,并为瑞利分布着不同色


    概率论和统计学角度看,Weibull Distribution是连续性的概率分布,其概率密度为:
    在这里插入图片描述

    其中,x是随机变量,λ>0是比例参数(scale parameter),k>0是形状参数(shape parameter)。显然,它的累积分布函数是扩展的指数分布函数,而且,Weibull distribution与很多分布都有关系。如,当k=1,它是指数分布;k=2且时,是Rayleigh distribution(瑞利分布)

    library(gcookbook) # For the data set
    library(tidyverse)
    
    #基础绘图
    # 这里的h没有大小顺序
    h <- rweibull(100000, shape=2, scale=0.3)
    ggplot(NULL,aes(x=h))+
      geom_histogram(binwidth = 0.01,fill="sienna",colour="black")+
      ggtitle("瑞利分布 \n 直方图")
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    在这里插入图片描述

    ggplot(NULL,aes(x=h))+
      geom_histogram(binwidth = 0.01,fill="sienna",colour="white")+
      ggtitle("瑞利分布 \n 直方图")
      
    
    • 1
    • 2
    • 3
    • 4

    在这里插入图片描述

    ggplot(NULL,aes(x=h))+
      geom_histogram(binwidth = 0.01,fill="skyblue",colour="white")+
      ggtitle("瑞利分布 \n 直方图")
    
    • 1
    • 2
    • 3

    在这里插入图片描述

    ggplot(NULL,aes(x=h))+
      geom_histogram(binwidth = 0.01,fill="slateblue",colour="white")+
      ggtitle("瑞利分布 \n 直方图")
    
    • 1
    • 2
    • 3

    在这里插入图片描述

    ggplot(NULL,aes(x=h))+
      geom_histogram(binwidth = 0.01,fill="slategray",colour="white")+
      ggtitle("瑞利分布 \n 直方图")
    
    • 1
    • 2
    • 3

    在这里插入图片描述

    ggplot(NULL,aes(x=h))+
      geom_histogram(binwidth = 0.01,fill="snow",colour="black")+
      ggtitle("瑞利分布 \n 直方图")
    
    • 1
    • 2
    • 3

    在这里插入图片描述

    ggplot(NULL,aes(x=h))+
      geom_histogram(binwidth = 0.01,fill="springgreen",colour="black")+
      ggtitle("瑞利分布 \n 直方图")
    
    • 1
    • 2
    • 3

    在这里插入图片描述

    ggplot(NULL,aes(x=h))+
      geom_histogram(binwidth = 0.01,fill="steelblue",colour="black")+
      ggtitle("瑞利分布 \n 直方图")
    
    • 1
    • 2
    • 3

    在这里插入图片描述

    ggplot(NULL,aes(x=h))+
      geom_histogram(binwidth = 0.01,fill="steelblue",colour="white")+
      ggtitle("瑞利分布 \n 直方图")
    
    • 1
    • 2
    • 3

    在这里插入图片描述

    ggplot(NULL,aes(x=h))+
      geom_histogram(binwidth = 0.01,fill="tan",colour="white")+
      ggtitle("瑞利分布 \n 直方图")
    
    • 1
    • 2
    • 3

    在这里插入图片描述

    ggplot(NULL,aes(x=h))+
      geom_histogram(binwidth = 0.01,fill="thistle",colour="white")+
      ggtitle("瑞利分布 \n 直方图")
    
    • 1
    • 2
    • 3

    在这里插入图片描述

    ggplot(NULL,aes(x=h))+
      geom_histogram(binwidth = 0.01,fill="tomato",colour="white")+
      ggtitle("瑞利分布 \n 直方图")
    
    • 1
    • 2
    • 3

    在这里插入图片描述

    ggplot(NULL,aes(x=h))+
      geom_histogram(binwidth = 0.01,fill="turquoise",colour="white")+
      ggtitle("瑞利分布 \n 直方图")
    
    • 1
    • 2
    • 3

    在这里插入图片描述

    ggplot(NULL,aes(x=h))+
      geom_histogram(binwidth = 0.01,fill="violet",colour="white")+
      ggtitle("瑞利分布 \n 直方图")
    
    • 1
    • 2
    • 3

    在这里插入图片描述

    ggplot(NULL,aes(x=h))+
    geom_histogram(binwidth = 0.01,fill=“wheat”,colour=“black”)+
    ggtitle(“瑞利分布 \n 直方图”)
    在这里插入图片描述
    ggplot(NULL,aes(x=h))+
    geom_histogram(binwidth = 0.01,fill=“white”,colour=“black”)+
    ggtitle(“瑞利分布 \n 直方图”)
    在这里插入图片描述
    ggplot(NULL,aes(x=h))+
    geom_histogram(binwidth = 0.01,fill=“yellow”,colour=“black”)+
    ggtitle(“瑞利分布 \n 直方图”)
    在这里插入图片描述

    ggplot(NULL,aes(x=h))+
    geom_histogram(binwidth = 0.01,fill=“yellowgreen”,colour=“black”)+
    ggtitle(“瑞利分布 \n 直方图”)
    在这里插入图片描述
    参考文献:ggplot2绘制概率密度图

                 百度文库---颜色大全:含中英文对照及色值
    
    • 1

    温布尔分布介绍

    开发环境:RStudio和微信截屏工具

  • 相关阅读:
    《论文阅读》MOJITALK: Generating Emotional Responses at Scale
    将本地文件夹添加到 Git 仓库
    保健用品行业B2B电子商务系统:供采交易全链路数字化,助推企业管理精细化
    使用svnsync sync方法同步
    一些移动端开发技巧
    嵌入式学习笔记(41)SD卡启动详解
    行为型设计模式 - C++实现
    【自然语言处理】【实体匹配】用于实体匹配中blocking环节的深度学习:一个设计空间的探索
    day008--mysql中的字符串函数
    网络安全(黑客)自学笔记
  • 原文地址:https://blog.csdn.net/m0_38127487/article/details/127785120