pkern_optim: Fit covariance parameters to data by maximum (profile)...

View source: R/pkern_estim.R

pkern_optimR Documentation

Fit covariance parameters to data by maximum (profile) likelihood using optim

Description

documentation unfinished

Usage

pkern_optim(
  g_obs,
  pars = "gau",
  X = 0,
  iso = FALSE,
  control = list(),
  quiet = FALSE,
  log_scale = TRUE,
  method = "L-BFGS-B",
  lower = NULL,
  initial = NULL,
  upper = NULL
)

Arguments

g_obs

list of form returned by pkern_grid (with entries 'gdim', 'gres', 'gval')

pars

list of fixed kernel parameters, with NAs indicating parameters to fit

X

numeric, vector, matrix, or NA, the mean or its linear predictors, passed to pkern_LL

iso

logical, indicating to constrain the y and x kernel parameters to be the same

control

list, passed to stats::optim

quiet

logical, indicating to suppress console output

...

named arguments to pass to pkern_bds

Examples

# set up example grid and data
g_obs = pkern_grid(10)
g_obs$gval = rnorm(10^2)
pkern_optim(g_obs, quiet=TRUE)

# repeat with one or more parameters fixed
pars = pkern_pars_make('gau') # NA parameters list
pars$psill = 1
pkern_optim(g_obs, pars, quiet=TRUE)
pars$y$kp = 1
pkern_optim(g_obs, pars, quiet=TRUE)

# iso mode constrains x parameters to equal y parameters
pkern_optim(g_obs, iso=T, quiet=TRUE)
pkern_optim(g_obs, pars, iso=T, quiet=TRUE)


deankoch/pkern documentation built on Oct. 26, 2023, 8:54 p.m.