Skip to content

Commit

Permalink
Intect to use allow_multiple_parameters to replace Vectorize
Browse files Browse the repository at this point in the history
  • Loading branch information
MJomaba committed Nov 14, 2024
1 parent 4a13741 commit 99e02d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion monty.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ Assuming that the population is 75% from subpopulation 1 (normally distributed w

```{r}
l_distribution <- monty_model_function(fn,
fixed = list(p = 0.75, m1 = 3, m2 = 7))
fixed = list(p = 0.75, m1 = 3, m2 = 7),
allow_multiple_parameters = TRUE)
```

We have just created a `monty` model.
Expand All @@ -46,7 +47,9 @@ l_distribution
We can plot the density of our model for values of $l$ between 0 and 10 and eye-check that we can see the two subpopulations in the correct proportions and with the 3 and 7 as modes.

```{r}
#l <- matrix(seq(from = 0, to = 10, by = 0.1), 1)
l <- seq(from = 0, to = 10, by = 0.1)
#monty_model_density(l_distribution, l)
plot(l,
exp(Vectorize(l_distribution$density)(l)),
type = "l",
Expand Down

0 comments on commit 99e02d2

Please sign in to comment.