Skip to contents

[Stable] Takes the output of gp_opts() and converts it into a list understood by stan.

Usage

create_gp_data(gp = gp_opts(), data)

Arguments

gp

A list of options as generated by gp_opts() to define the Gaussian process. Defaults to gp_opts().Set to NULL to disable the Gaussian process.

data

A list containing the following numeric values: t, seeding_time, horizon.

Value

A list of settings defining the Gaussian process

See also

gp_opts

Author

Sam Abbott

Examples

# define input data required
data <- list(
  t = 30,
  seeding_time = 7,
  horizon = 7
)

# default gaussian process data
create_gp_data(data = data)
#> $t
#> [1] 30
#> 
#> $seeding_time
#> [1] 7
#> 
#> $horizon
#> [1] 7
#> 
#> $fixed
#> [1] 0
#> 
#> $M
#> numeric(0)
#> 
#> $L
#> [1] 1.5
#> 
#> $ls_meanlog
#> [1] 2.991842
#> 
#> $ls_sdlog
#> [1] 0.3245928
#> 
#> $ls_min
#> [1] 0
#> 
#> $ls_max
#> [1] 16
#> 
#> $alpha_sd
#> [1] 0.05
#> 
#> $gp_type
#> [1] 0
#> 

# settings when no gaussian process is desired
create_gp_data(NULL, data)
#> $t
#> [1] 30
#> 
#> $seeding_time
#> [1] 7
#> 
#> $horizon
#> [1] 7
#> 
#> $stationary
#> [1] 1
#> 
#> $fixed
#> [1] 1
#> 
#> $M
#> numeric(0)
#> 
#> $L
#> [1] 1.5
#> 
#> $ls_meanlog
#> [1] 2.991842
#> 
#> $ls_sdlog
#> [1] 0.3245928
#> 
#> $ls_min
#> [1] 0
#> 
#> $ls_max
#> [1] 16
#> 
#> $alpha_sd
#> [1] 0.05
#> 
#> $gp_type
#> [1] 0
#> 

# custom lengthscale
create_gp_data(gp_opts(ls_mean = 14), data)
#> $t
#> [1] 30
#> 
#> $seeding_time
#> [1] 7
#> 
#> $horizon
#> [1] 7
#> 
#> $fixed
#> [1] 0
#> 
#> $M
#> numeric(0)
#> 
#> $L
#> [1] 1.5
#> 
#> $ls_meanlog
#> [1] 2.527486
#> 
#> $ls_sdlog
#> [1] 0.4723807
#> 
#> $ls_min
#> [1] 0
#> 
#> $ls_max
#> [1] 16
#> 
#> $alpha_sd
#> [1] 0.05
#> 
#> $gp_type
#> [1] 0
#>