User Tools

Site Tools


normal_distribution

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
normal_distribution [2019/09/24 13:34] hkimscilnormal_distribution [2024/03/13 08:28] (current) hkimscil
Line 18: Line 18:
 randomdeviates<-rnorm(1000,0,1) randomdeviates<-rnorm(1000,0,1)
    
-par(mfrow=c(1,3), mar=c(3,4,4,2))+par(mfrow=c(2,2), mar=c(3,4,4,2))
  
 plot(xseq, densities, col="darkgreen", plot(xseq, densities, col="darkgreen",
Line 30: Line 30:
 hist(randomdeviates, main="Random draws from Std Normal",  hist(randomdeviates, main="Random draws from Std Normal", 
    cex.axis=.8, xlim=c(-4,4))    cex.axis=.8, xlim=c(-4,4))
-</code> 
  
-<code> 
 xseq<-seq(-4,4,.01) xseq<-seq(-4,4,.01)
 y<-2*xseq + rnorm(length(xseq),0,5.5) y<-2*xseq + rnorm(length(xseq),0,5.5)
 hist(y, prob=TRUE, ylim=c(0,.06), breaks=20) hist(y, prob=TRUE, ylim=c(0,.06), breaks=20)
 curve(dnorm(x, mean(y), sd(y)), add=TRUE, col="darkblue", lwd=2) curve(dnorm(x, mean(y), sd(y)), add=TRUE, col="darkblue", lwd=2)
 +
 +par(mfrow=c(1,1))
 </code> </code>
 +{{:pasted:20240313-082705.png}}
normal_distribution.1569299683.txt.gz · Last modified: 2019/09/24 13:34 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki