logLik_from_vector_param: Compute the log-likelihood from parameter vector

Description Usage Arguments Details Value See Also Examples

View source: R/fit_model.R

Description

This function is called internally by other functions. It is a wrapper to the function logLik_from_design_matrix which has inputs consistent to the requirements of optimisation routines.

Usage

1
2
3
logLik_from_vector_param(param_values, param_str, data, indices = NULL,
  scale = 1, param_matrix = NULL, empty_param_matrix_full = NULL,
  empty_design_matrix = NULL)

Arguments

param_values

The vector of values for the parameters

param_str

The named vector indicating the parameter structure, that is, the type of subcategory for each meta parameter

data

The dataset to be used

indices

The list of indices computed by compute_indices

scale

The scaling parameter (useful if the optimisation function can only minimise)

param_matrix

The matrix storing parameter values

empty_param_matrix_full

The empty expanded or complete parameter matrix

empty_design_matrix

The empty design matrix

Details

If the argument param_matrix is given, the parameter matrix will be updated and not build from scratch. This will save some computation time.

Value

The scaled log-likelihood.

See Also

logLik_from_design_matrix

Examples

1
2
3
4
5
logLik_from_vector_param(param_values = c(0.1, 0.200001), param_str = c("w1" = "s"),
                         data = SurvEles_small)
pmat <- build_param_matrix(param_values = c(0.1, 0.2), param_str = c("w1" = "s"))
logLik_from_vector_param(param_values = c(0.1, 0.200001, rep(0, 14)), param_str = c("w1" = "s"),
                         data = SurvEles_small, param_matrix = pmat)

courtiol/SileR documentation built on May 16, 2020, 8:10 p.m.