pkern_pars_make | R Documentation |
Constructs a nested list containing expected covariance parameters for the supplied
kernel names in pars
. If pars
is already such a list, the function checks that
parameter names and lengths are valid and returns a copy containing only the
expected parameters, properly named, with NAs assigned to any missing parameters.
pkern_pars_make(pars = "gau")
pars |
character vector of kernel name(s) or list of parameters (see DETAILS) |
pars
can be a kernel name ('gau', 'mat', etc), or a vector or list of two of them,
in which case the function returns a filled-out kernel definition list indicating
expected parameters.
parameter list containing sub-lists 'y', 'x', and scalars 'psill' and 'eps'
# pass a kernel name to get 2d version with NAs for all parameters
'mat' |> pkern_pars_make()
# pass a vector or list of kernel names - when unnamed, order y, x is assumed
c('gau', 'mat') |> pkern_pars_make()
list('gau', 'mat') |> pkern_pars_make()
list(x='gau', y='mat') |> pkern_pars_make()
# when missing , x kernel definition is copied from y, and vice versa
list(k='exp', kp=c(rho=1)) |> pkern_pars_make()
# when unnamed, kernel range and shape parameters are assigned expected names
list(psill=1, x=list(k='mat', kp=c(1,2))) |> pkern_pars_make()
# incorrectly named parameters raise errors - example:
# list(psill=1, x=list(k='exp', kp=c(foo=1))) |> pkern_pars_make()
# complete parameter definition lists are returned unchanged
k_list = list(k='exp', kp=c(rho=1))
list(psill=1, eps=0, x=k_list, y=k_list) |> pkern_pars_make()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.