Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jun 30, 2023
1 parent bc2e04f commit af2abcf
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion vignettes/probability_of_direction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Let's compare the 4 available methods, the **direct** method and 3

Let's start by testing the proximity and similarity of the results obtained by different methods.

```{r message=FALSE, warning=FALSE, fig.align='center'}
```{r message=FALSE, warning=FALSE, fig.align='center', eval=FALSE}
library(bayestestR)
library(logspline)
library(KernSmooth)
Expand All @@ -181,6 +181,33 @@ data <- as.data.frame(sapply(data, as.numeric))
bayesplot::mcmc_pairs(data) +
theme_classic()
```
```{r echo=FALSE, message=FALSE, warning=FALSE, fig.align='center'}
library(bayestestR)
library(logspline)
library(KernSmooth)
# Compute the correlations
data <- data.frame()
for (the_mean in runif(25, 0, 4)) {
for (the_sd in runif(25, 0.5, 4)) {
x <- rnorm(100, the_mean, abs(the_sd))
data <- rbind(
data,
data.frame(
"direct" = pd(x),
"kernel" = pd(x, method = "kernel"),
"logspline" = pd(x, method = "logspline"),
"KernSmooth" = pd(x, method = "KernSmooth")
)
)
}
}
data <- as.data.frame(sapply(data, as.numeric))
# Visualize the correlations
suppressWarnings(bayesplot::mcmc_pairs(data)) +
theme_classic()
```

All methods give are highly correlated and give very similar results. That means
that the method choice is not a drastic game changer and cannot be used to tweak
Expand Down

0 comments on commit af2abcf

Please sign in to comment.