r - 将 R 中每个分量的方差加倍
问题描述
当我“将每个组件的方差加倍”时,我试图查看我的散点图如何变化。我知道如何找到我的样本的方差,但我对如何将它们加倍感到困惑。
library(MASS)
library(ggplot2)
x<-mvrnorm(n=100, mu=c(0,0),Sigma=diag(2)) # 100 samples from a 2D normal variable with identity covariance matrix
print(x)
colnames(x)<-c('x1','x2')
x<-data.frame(x)
ggplot(x,aes(x=x1,y=x2))+geom_point()
通常我会取 2 个变量,找出每个变量的方差,计算协方差,然后在上面的等式中使用它,但我认为这种方法是错误的。
解决方案
推荐阅读
- docker - Firefox headless 不能在 Docker 中以非 root 用户身份工作
- javascript - InvalidStateError:无法在“IDBDatabase”上执行“事务”:数据库连接正在使用 ios safari 关闭
- ios - 等效于 iOS AVPlayer 的 exoplayer 中的 getBufferedPosition()
- django - Django 权限:基于逻辑的自定义检查
- reactjs - 使用 cookie 在 2 个反应 Web 应用程序之间共享身份验证
- javascript - 是否有一种 javascript 方法可以告诉我们输入范围滑块值是上升还是下降?
- python - 如何通过将它们相乘来修复整数(python pandas)
- git - github上的隐藏文件?
- r - 如何按间隔对元素求和?
- python - 使用python只读excel中的可见行