sk_pars_make | R Documentation |
Constructs a nested list naming the expected covariance parameters for the supplied
correlation function 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 NA
s assigned to any missing parameters.
sk_pars_make(pars = "gau")
pars |
character vector of kernel name(s) or list of parameters (see details) |
pars
should be a correlation function name accepted by sk_kp
('exp', 'gau','sph', or
'gex', 'mat'), or a vector or list of two of them in the order y, x.
parameter list containing sub-lists 'y', 'x', and scalars 'psill' and 'eps'
sk_corr
Other parameter managers:
sk_bds()
,
sk_fit()
,
sk_kp()
,
sk_pars_update()
,
sk_pars()
,
sk_to_string()
# pass a correlation function name to get 2d version with NAs for all parameters
sk_pars_make('mat')
# pass a vector or list of correlation function names in order y, x (or else specify)
sk_pars_make(c('gau', 'mat'))
sk_pars_make(list(x='gau', y='mat'))
# if the the x definition is missing it is copied from y, and vice versa
sk_pars_make(list(k='exp', kp=c(rho=1)))
# when unnamed, kernel range and shape parameters are assigned expected names
sk_pars_make(list(psill=1, x=list(k='mat', kp=c(1,2))))
# incorrectly named parameters raise errors
sk_pars_make(list(psill=1, x=list(k='exp', kp=c(foo=1))))
# complete parameter definition lists are returned unchanged
k_list = list(k='exp', kp=c(rho=1))
pars = list(y=k_list, x=k_list, eps=0, psill=1)
identical(pars, sk_pars_make(pars))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.