Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit1426e4a759655f69f40ca5fa2a41440fdabd1ee3 (patch)
Author
 Syndamia <kamen@syndamia.com>
2024-04-17 20:14:40 +0300
Committer
 Syndamia <kamen@syndamia.com>
2024-04-17 20:14:40 +0300
Files4ca1f718f943d7ae84feea32b047a37ffe39a64c
uni-projects-1426e4a759655f69f40ca5fa2a41440fdabd1ee3.tar
uni-projects-1426e4a759655f69f40ca5fa2a41440fdabd1ee3.tar.gz
uni-projects-1426e4a759655f69f40ca5fa2a41440fdabd1ee3.zip
Parent5856b28e64b1c3ef39d34c032275f9550e6ac983 (diff)
[S/hw1] Updated from dnorm to pnorm
5 files changed, 5 insertions, 5 deletions
-rw-r--r--Year 3/Statistics/hw1-ex2-plot120.pngbin10287 -> 18942 bytes
-rw-r--r--Year 3/Statistics/hw1-ex2-plot200.pngbin10761 -> 17456 bytes
-rw-r--r--Year 3/Statistics/hw1-ex2-plot30.pngbin10232 -> 23147 bytes
-rw-r--r--Year 3/Statistics/hw1.pdfbin85556 -> 111954 bytes
-rw-r--r--Year 3/Statistics/hw1.r10
diff --git a/Year 3/Statistics/hw1-ex2-plot120.png b/Year 3/Statistics/hw1-ex2-plot120.png
index 912a2a7..3c9bb21 100644
--- a/Year 3/Statistics/hw1-ex2-plot120.png
+++ b/Year 3/Statistics/hw1-ex2-plot120.png
Binary files differ
diff --git a/Year 3/Statistics/hw1-ex2-plot200.png b/Year 3/Statistics/hw1-ex2-plot200.png
index a806df8..8ab2fee 100644
--- a/Year 3/Statistics/hw1-ex2-plot200.png
+++ b/Year 3/Statistics/hw1-ex2-plot200.png
Binary files differ
diff --git a/Year 3/Statistics/hw1-ex2-plot30.png b/Year 3/Statistics/hw1-ex2-plot30.png
index e2b61ce..5f8c1c8 100644
--- a/Year 3/Statistics/hw1-ex2-plot30.png
+++ b/Year 3/Statistics/hw1-ex2-plot30.png
Binary files differ
diff --git a/Year 3/Statistics/hw1.pdf b/Year 3/Statistics/hw1.pdf
index eedb714..d9a3a02 100644
--- a/Year 3/Statistics/hw1.pdf
+++ b/Year 3/Statistics/hw1.pdf
Binary files differ
diff --git a/Year 3/Statistics/hw1.r b/Year 3/Statistics/hw1.r
index ec9f021..afb1be3 100644
--- a/Year 3/Statistics/hw1.r
+++ b/Year 3/Statistics/hw1.r
@@ -19,7 +19,7 @@ ex1 <- function(total = 24, marked = 4, boxes = 4, iterations = 10000) {
ex1()
ex2 <- function(n, lambda = 1/5, N = 10000, mu = 5, sigma = 5 / sqrt(n)) {
- x <- function() rexp(n, rate=lambda)
+ x <- function() rexp(n, rate=lambda)
xdash <- replicate(N, sum(x()) / n)
fchapeau <- function(t) {
@@ -28,12 +28,12 @@ ex2 <- function(n, lambda = 1/5, N = 10000, mu = 5, sigma = 5 / sqrt(n)) {
return (1/N * sum(I(xdash <= t)))
}
- t <- seq(0, 10, by=0.1)
+ t <- seq(2, 8, by=0.1)
Fpoints <- sapply(t, fchapeau)
- Npoints <- sapply(t, function(t) dnorm(t, mu, sigma))
+ Npoints <- sapply(t, function(t) pnorm(t, mu, sigma))
- plot (t, Fpoints, type="l", ylim=c(0, 1.1))
- lines(t, Npoints, lty=2)
+ plot (t, Fpoints, type="l")
+ lines(t, Npoints, lty=2, col="darkred")
}
ex2(30)