sk_to_string: Extract Kronecker covariance parameters as plot-friendly...

View source: R/sk_pars.R

sk_to_stringR Documentation

Extract Kronecker covariance parameters as plot-friendly strings

Description

Generate strings describing the model and parameter values in a Kronecker covariance parameter list pars. These are used to fill out titles and axis labels in calls to sk_plot_pars.

Usage

sk_to_string(pars, nsig = 3)

Arguments

pars

character, character vector, or list (see details)

nsig

number of significant figures to print

Details

If pars is a parameter list (of the form returned by sk_pars), the function returns a list of strings: a kernel family string ('k'), dimension-wise kernel parameters (sub-list 'kp', with entries 'y' and 'x'), and a title containing the kernel family, nugget effect, and partial sill.

When pars is a character string, the function returns it unchanged. When pars is a vector of two character strings, it concatenates them with separator " x ". When pars is a list of kernel parameters for a single dimension, it returns a named list of two character strings: the kernel name (named entry 'k') and the parameter(s) (named entry 'kp'), parenthesized, in "name = value" format where "value" is rounded to nsig significant digits).

Value

a character string or list of them

See Also

sk_plot_pars

Other parameter managers: sk_bds(), sk_fit(), sk_kp(), sk_pars_make(), sk_pars_update(), sk_pars()

Examples

kname = 'mat'
sk_to_string(kname)
sk_to_string(rep(kname, 2))
sk_to_string(list(k=kname))

gdim = c(10, 15)
pars = sk_pars(gdim, kname)
sk_to_string(pars)


snapKrig documentation built on May 31, 2023, 6:34 p.m.