Skip to content

Commit 3f61578

Browse files
committed
Finished presentation, junk in rmd file
1 parent 68bcf9c commit 3f61578

File tree

3 files changed

+668
-9
lines changed

3 files changed

+668
-9
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.ipynb_checkpoints/
2+
.gitignore

BayesianBlocks.Rmd

+18-4
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ cp_h
8585
```
8686

8787
```{r}
88-
options(repr.plot.width=18, repr.plot.height=8)
89-
par(mfrow=c(1,2))
88+
options(repr.plot.width=6, repr.plot.height=4)
89+
#par(mfrow=c(1,2))
9090
91-
h_t <- hist(test, breaks=200)
91+
h_t <- hist(test, breaks=200, freq=FALSE, col=rgb(0,0,1,0))
9292
93-
h_bb <- hist(test, breaks=cp_h )
93+
h_bb <- hist(test, breaks=cp_h, freq=FALSE, col=rgb(1,0,0,0), add=TRUE)
9494
9595
```
9696

@@ -109,6 +109,20 @@ The result depends on only the number of data points and the
109109
adopted value of p0:
110110

111111
```{r}
112+
ncp_prior <- function(p0, N){ 4 - log(73.53 * p0 * N^(-0.478))}
113+
114+
p0 <- c(0.0001, 0.001, 0.01, 0.1)
115+
N <- length(test)
116+
117+
par(mfrow=c(1,2))
118+
119+
for (i in 1:length(p0)){
120+
cp <- bayesian_blocks(xs = test, prior=ncp_prior(p0[i], N))
121+
h <- hist(test, breaks=cp, freq=FALSE, plot=FALSE)
122+
123+
plot(h_t)
124+
plot(h, add=TRUE)
125+
}
112126
113127
```
114128

0 commit comments

Comments
 (0)