convert a parameter vector back to a structured list Like relist, but adds the capability to fill in parameters from a "fixed-parameter" vector

restore(flesh, skeleton, fixed = NULL)

Arguments

flesh

a vector to be restored

skeleton

a list, the structure of which determines the structure of the result

fixed

a list which determines extra components to fill in

Note

Depends at present on the names of the unlisted object; may be fragile

Examples

opt_pars <- list(log_E0=4, log_beta0=-1, log_rel_beta0=c(-1,-1), log_nb_disp=0)
restore(unlist(opt_pars),opt_pars)
#> $log_E0
#> [1] 4
#> 
#> $log_beta0
#> [1] -1
#> 
#> $log_rel_beta0
#> [1] -1 -1
#> 
#> $log_nb_disp
#> [1] 0
#> 
invlink_trans(restore(unlist(opt_pars),opt_pars))
#> $E0
#> [1] 54.59815
#> 
#> $beta0
#> [1] 0.3678794
#> 
#> $rel_beta0
#> [1] 0.3678794 0.3678794
#> 
#> $nb_disp
#> [1] 1
#>