---
# System prepended metadata

title: Untitled

---

Wave plot using normal prior
![](https://i.imgur.com/rPZGBqn.png)

#### 1) Creation of new design class log_design_normal_two()

```
des <- log_design_normal_two(30, 30, 0.6, 0.83, 0.83, 0.8, 0.8)
```

What this does?
applies log10 transformation to MV and TV without having to alter underlying code

![](https://i.imgur.com/tWljzsn.png)



wave plot using log-t prior
![](https://i.imgur.com/VeAlxxy.png)


Example 1
```

des <- log_design_normal_two(30, 30, 0.6, -0.08092, -0.08092, 0.8, 0.8)

> prior
Distribution: Log t
Parameters:
 locationlog: -0.203
 scalelog: 0.0465
 lower: 0.1
 df: 3
 
 > approx_unimodal(log10(rand(prior,1000000)), -0.5, 0.5)
$dens
[1] "t"

$params
       mean          sd          df 
-0.03793412  0.01798629  3.00000000 

> prior4
Distribution: t
Parameters:
 location: -0.0378887556939152
 scale: 0.0312649658848961
 df: 3
 
 assurance(des, prior4)
# A tibble: 1 × 4
     go  stop inter incon
  <dbl> <dbl> <dbl> <dbl>
1 0.295 0.142     0 0.563
 
```

Example 2 
```
> des <- design_normal_two(30, 30, 0.6, -0.08092, 0, 0.8, 0.8)

> prior <- dist_logt(-0.203, 0.0465, 0.1, 3)

> qdmtools::approx_unimodal(log10(rand(prior, 100000)), -0.5, 0.5)
Distribution: t
Parameters:
 location: -0.0379376141128745
 scale: 0.0180681441389967
 df: 3
 
> prior_new <- dist_t(-0.0379, 0.018)

> assurance(des, prior_new)
# A tibble: 1 × 4
     go  stop inter incon
  <dbl> <dbl> <dbl> <dbl>
1 0.289 0.278     0 0.432
```

Example 9
```
des <- design_normal_two(30, 30, 0.6, 0, 0.1761, 0.9, 0.99)

prior <- dist_gamma(4.78, 1.28, 0.1)

> approx_unimodal(log10(rand(prior, 100000)), -0.5, 1)
$dens
[1] "beta"

$params
    alpha      beta     lower     upper 
 8.262214  3.683652 -0.500000  1.000000 

> db <- dist_beta(8.26, 3.68, lower = -0.5, 1)
Distribution: Beta
Parameters:
 alpha: 8.26
 beta: 3.68
 lower: -0.5
 upper: 1

> assurance(des, db)
# A tibble: 1 × 4
     go    stop inter  incon
  <dbl>   <dbl> <dbl>  <dbl>
1 0.909 0.00278     0 0.0884
```

Example 9 
```
> des <- design_normal_two(30, 30, 0.6, 0, 0.1761, 0.9, 0.99)

> prior <- dist_gamma(4.78, 1.28, 0.5)

> qdmtools::approx_unimodal(log10(rand(prior, 100000)), -0.5, 1)
Distribution: Normal
Parameters:
 mean: 0.596457274382407
 sd: 0.178093152201127
 
> prior_new <- dist_norm(0.59812, 0.1772004)

> assurance(des, prior_new)
# A tibble: 1 × 4
     go     stop inter  incon
  <dbl>    <dbl> <dbl>  <dbl>
1 0.955 0.000443     0 0.0443
```