Skip to contents

Fit individual LATER model to each dataset in a dataframe of datasets

Usage

individual_later_fit(
  df,
  with_early_component = FALSE,
  fit_criterion = "likelihood",
  jitter_settings = list(n = 7, prop = 0.5, seed = NA, processes = 2)
)

Arguments

df

A dataframe with columns: time, name, promptness, and e_cdf

with_early_component

If TRUE, the model contains a second 'early' component that is absent when FALSE (the default).

fit_criterion

String indicating the criterion used to optimise the fit by seeking its minimum.

  • ks: Kolmogorov-Smirnov statistic.

  • neg_loglike: Negative log-likelihood.

jitter_settings

Settings for running the fitting multiple times with randomly-generated offsets ('jitter') applied to the starting estimates.

  • n: How many jitter iterations to run (default of 7).

  • prop: The maximum jitter offset, as a proportion of the start value (default of 0.5).

  • seed: Seed for the random jitter generator (default is unseeded).

  • processes: Maximum number of CPU processes that can be used (default is 2).

Value

A dataframe with one row for each named dataset in df and columns equal to the LATER model parameters returned by fit_data$named_fit_params

Examples

# \donttest{
data <- rbind(
  data.frame(name = "test", promptness = rnorm(100, 3, 1)),
  data.frame(name = "test_2", promptness = rnorm(100, 1, 1))
)
fit_params <- individual_later_fit(data)
# }