optimizer_smooth_model: Optimize the coefficients of the best fitted linear models...

Description Usage Arguments Value References See Also Examples

View source: R/optimizer_smooth_model.R

Description

this function optimizes the coefficients of the best fitted linear models
(from the function model_selection) via smooth modeling
and with maximum likelihood estimation

Usage

1
2
3
4
optimizer_smooth_model(m_select, method = c("nlminb","BFGS",
                       "ucminf","Nelder-Mead"),
                       follow.on = FALSE, itnmax = NULL,
                       printParam = FALSE)

Arguments

m_select

this input should be a list including max_data, covariables and models as in the output of the function model_selection

method

optimization method(s) for external function optimx, this can also be a vector. possible methods are: Nelder-Mead, BFGS, CG, L-BFGS-B, nlm, nlminb, spg, ucminf, newuoa, bobyqa, nmkb, hjkb, Rcgmin, Rvmmin
default is method = c("nlminb","BFGS","ucminf","Nelder-Mead")

follow.on

logical value; if TRUE, and there are multiple methods, then the last set of coefficients from one method is used as the starting set for the next
default is FALSE

itnmax

if provided as a vector of the same length as the length of method, this gives the maximum number of iterations or function values for the corresponding method. if a single number is provided, this will be used for all methods

printParam

logical value; if TRUE, the GEV parameters during the optimization are printed. this might be useful to check the proper functioning of the optimization (shape parameter should be approximately between -0.5 and 0.5)
default is FALSE

Value

a list with

summary

a summary of the optimization results, including an information message whether the optimization was successful or not and which method delivered the best coefficients

coefficients

a list with the optimized coefficients.
containing:
loccoeff, scalecoeff, shapecoeff and all_coeff

References

Blanchet, J. & Lehning, M. (2010): Mapping snow depth return levels: smooth spatial modeling versus station interpolation. Hydrology and Earth System Sciences 14(12): 2527-2544.

https://www.hydrol-earth-syst-sci.net/14/2527/2010/hess-14-2527-2010.pdf

See Also

model_selection, optimizer_biv_hr_model

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# load function output from model_selection
sd_m_select  = get(data("sd_m_select"))
swe_m_select = get(data("swe_m_select"))

# perform optimization
sd_optim =
  optimizer_smooth_model(m_select = sd_m_select,
                         method = c("nlminb","ucminf"))

swe_optim =
  optimizer_smooth_model(m_select = swe_m_select,
                         method = "nlminb",
                         itnmax = 500)

SpatialModelsZAMG documentation built on Nov. 11, 2019, 3 p.m.