Produces an object that may be used in place of a vector in the creation of arguments to spec_rescomp().

rescomp_coefs_vector_custom(func, length)

Arguments

func

A function that takes params (a list of parameters) and returns a vector.

length

The length of the vector returned by func.

Value

S3 object of class rescomp_coefs_vector.

Examples

# Vector with one time-varying coefficient
rescomp_coefs_vector_custom(
  function(params) {
    c(0.2, 0.3, 0.4, params$fourth_coeff)
  },
  length = 4
)
#> $func
#> function (params) 
#> {
#>     c(0.2, 0.3, 0.4, params$fourth_coeff)
#> }
#> <environment: 0x141c7ca60>
#> 
#> $dim
#> [1] 4
#> 
#> attr(,"class")
#> [1] "rescomp_coefs_vector_custom" "rescomp_coefs_custom"       
#> [3] "rescomp_coefs_vector"        "rescomp_coefs"