This function aims to find a possible distribution that would give rise to the observed sample parameters. For that, you need to pass a list of parameters, best created with set_parameters

find_possible_distribution(parameters, seed = NULL, values_only = FALSE)

Arguments

parameters

List of parameters, see set_parameters

seed

An integer to use as the seed for random number generation. Set this in scripts to ensure reproducibility.

values_only

Should only values or a more informative list be returned. See Value section.

Value

Unless values_only = TRUE, a list with:

outcome

success or failure - character

distribution

The distribution that was found (if success) / that had the closest variance (if failure) - numeric

mean

The exact mean of the distribution - numeric

sd

The SD of the distribution that was found (success) / that came closest (failure) - numeric

iterations

The number of iterations required to achieve the specified SD - numeric

If values_only = TRUE, then the distribution is returned if one was found, and NULL if it failed.

Examples

sprite_parameters <- set_parameters(mean = 2.2, sd = 1.3, n_obs = 20,
                                    min_val = 1, max_val = 5)
#> Warning: The sample size (* number of items) is too big compared to the precision of the reported mean. The GRIM test is only meaningful when N < 10 ^ precision (e.g. N < 100 for single-items means reported to two decimal places).
#> Warning: The sample size (* number of items) is too big compared to the precision of the reported mean. The GRIM test is only meaningful when N < 10 ^ precision (e.g. N < 100 for single-items means reported to two decimal places).
find_possible_distribution(sprite_parameters)
#> $outcome
#> [1] "success"
#> 
#> $values
#>  [1] 1 2 4 4 3 1 1 3 3 3 3 5 1 1 1 2 1 3 2 1
#> 
#> $mean
#> [1] 2.25
#> 
#> $sd
#> [1] 1.251315
#> 
#> $iterations
#> [1] 7
#>