gradient22: Gradient function for a subset of variables

View source: R/augment.R

gradient22R Documentation

Gradient function for a subset of variables

Description

Calculates the gradient function of a model with respect to a subset of the parameters given in par_int, char_vars, evaluates it at the provided values and returns the result as a function of the variable x.

Usage

gradient22(model, char_vars, values, par_int, weight_fun = function(x) 1)

Arguments

model

formula describing the model, which must contain only x, the parameters defined in char_vars and the numerical operators.

char_vars

character vector of the parameters of the model.

values

numeric vector with the nominal values of the parameters in char_vars.

par_int

vector of indexes indicating the subset of variables to omit in the calculation of the gradient.

weight_fun

optional one variable function that represents the square of the structure of variance, in case of heteroscedastic variance of the response

Value

A function depending on x that's the gradient of the model with respect to char_vars


optedr documentation built on Nov. 18, 2022, 5:12 p.m.