Skip to contents

This function estimates initial parameter values for different models using optimization techniques. The function uses the `optim` function with the L-BFGS-B method, which supports parameter bounds. It calculates the initial parameter estimates for models "M0", "M1", "M2", "M3", and "M4".

Usage

init.guess(
  model,
  types,
  data = sim_dat$diff_Y_t,
  t_list,
  u_list,
  init_param = rep(1, 3)
)

Arguments

model

A character string specifying the model type. Must be one of "M0", "M1", "M2", "M3", or "M4".

types

A vector specifying the type of distribution or model for the lambda calculation.

data

A numeric matrix with columns representing the data for each product.

t_list

A list of vectors, where each vector contains the time or covariates for each product.

u_list

A list of vectors, where each vector contains the additional covariates for each product (can be NULL).

init_param

A numeric vector containing the initial parameter guesses. Default is a vector of 1's of length 3 or 5.

Value

A numeric vector containing the initial parameter estimates for the given model.