Bivariate in R (mvtnorm package)

前端 未结 1 997
说谎
说谎 2021-01-24 01:24

I have two normal r.v.\'s that are independent of each other (so the correlation $\\rho= 0$). The two r.v.\'s come from the following two Normal distributions, i.e., $X\\sim N

相关标签:
1条回答
  • 2021-01-24 02:09

    You were forgetting to include the variance of your random variables. Instead of specifying the correlation matrix, just specify the covariance matrix. Here is the R code to do it:

    library(mvtnorm)
    
       mu = c(18,12.72)
       covariance = diag(c(5.7,30.38),2)
       X = c(10,-Inf)
       Y = c(Inf,10)
    
       pmvnorm(mean=mu,sigma=covariance,lower=X,upper=Y)
    
    0 讨论(0)
提交回复
热议问题