getTheta: getTheta Updates theta. Vectorized but only updates...

View source: R/getTheta.R

getThetaR Documentation

getTheta Updates theta. Vectorized but only updates observations that have not converged.

Description

getTheta Updates theta. Vectorized but only updates observations that have not converged.

Usage

getTheta(
  spt,
  f0,
  mu,
  sampprobs,
  ySptIndex,
  thetaStart = NULL,
  thetaControl = theta.control()
)

Arguments

spt

Support of the observed response variable. (This is the set of unique values observed, not the set of all possible values.)

f0

Values of the baseline distribution corresponding to the values of spt

mu

The fitted mean for each observation. Note these values must lie strictly within the range of the support.

sampprobs

Matrix of sampling probabilities. The number of rows should equal the number of observations, and the number of columns should equal the number of unique observed support points.

ySptIndex

Vector containing index of each obervation's response value within the spt vector. This is only needed to calculate the log-likelihood after each update.

thetaStart

Vector of starting values. One value per observation. If NULL, zero is used as the starting value for each observation.

thetaControl

Object of class thetaControl, which is a list of control arguments returned by the thetaControl function.

Value

List containing the following:

  • theta Updated values.

  • fTilt Matrix containing the exponentially tilted distribution for each observation, i.e. f(y|X=x). Each column corresponds to an observation and sums to one.

  • bPrime Vector containing the mean of the exponentially tilted distribution for each observation. Should match mu argument very closely.

  • bPrime2 Vector containing the variance of the exponentially tilted distribution for each observation.

  • fTiltSW Matrix containing the exponentially tilted distribution for each observation, conditional on that observation being sampled, i.e. f(y|X=x, S=1). If sampprobs=NULL, then fTiltSW matches fTilt.

  • bPrimeSW Vector containing the mean for each observation, conditional on that observation being sampled. If sampprobs=NULL, then bPrimeSW matches bPrime.

  • bPrime2SW Vector containing the variance for each observation, conditional on that observation being sampled. If sampprobs=NULL, then bPrime2SW matches bPrime2.

  • llik Semiparametric log-likelihood, evaluated at the current beta and f0 values. If sampling weights are used, then the log-likelihood is conditional on each observation being sampled.

  • conv Convergence indicator.

  • iter Number of iterations until convergence was reached.


gldrm documentation built on May 29, 2024, 4:28 a.m.

Related to getTheta in gldrm...