gradient_value: Estimate the update gradient value

Description Usage Arguments Value Examples

View source: R/package_contents.R

Description

Estimate the update gradient value

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
gradient_value(
  beta = NULL,
  data,
  formula,
  family = binomial(),
  iteration_number = 0,
  shuffle_rows = TRUE,
  link = NULL
)

use_glm_gradient_value(
  beta = NULL,
  data,
  formula,
  family = binomial(),
  iteration_number = 0,
  shuffle_rows = TRUE
)

Arguments

beta

current beta value, leave NULL to initialize

data

dataset to get gradient value from

formula

model formula to fit, with tilde syntax

family

generalized linear model family, see family

iteration_number

number of fitting iteration, used for tracking

shuffle_rows

should the rows of the dataset be permuted, so as to decrease privacy concerns

link

link function to use with family

Value

A list of estimated values, including the gradient, sample size, iteration number, covariance matrix (A_mat), number of samples with non-zero weights, the sum of the dispersion values (for overdispersion estimates), and a vector of values for combining to create the population gradient (u), with length of the number of beta values

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data = data.frame(y = c(0, 0, 1),
pois_y = c(4, 1, 0),
x2 = c(-2.19021287072066,
       -0.344307138450805, 3.47215796952745),
x1 = c(-0.263859503846267,
       -0.985160029707486, 0.227262373184513))
gradient_value(data = data, formula = y ~ x1 + x2,
family = "binomial")
gradient_value(data = data, formula = pois_y ~ x1 + x2,
family = "poisson")
data = data.frame(y = c(0, 0, 1),
pois_y = c(4, 1, 0),
x2 = c(-2.19021287072066,
       -0.344307138450805, 3.47215796952745),
x1 = c(-0.263859503846267,
       -0.985160029707486, 0.227262373184513))
use_glm_gradient_value(data = data, formula = y ~ x1 + x2,
family = binomial(link = "probit"))

distribglm documentation built on April 15, 2021, 5:06 p.m.