fpiter {daarem}R Documentation

Fixed-Point Iteration Scheme

Description

A function to implement the fixed-point iteration algorithm. This includes monotone, contraction mappings including EM and MM algorithms

Usage

  fpiter(par, fixptfn, objfn=NULL, control=list( ), ...)

Arguments

par

A vector of parameters denoting the initial guess for the fixed-point iteration.

fixptfn

A vector function, F that denotes the fixed-point mapping. This function is the most essential input in the package. It should accept a parameter vector as input and should return a parameter vector of same length. This function defines the fixed-point iteration: x_{k+1} = F(x_k). In the case of EM algorithm, F defines a single E and M step.

objfn

This is a scalar function, $L$, that denotes a ”merit” function which attains its local minimum at the fixed-point of $F$. This function should accept a parameter vector as input and should return a scalar value. In the EM algorithm, the merit function L is the log-likelihood. In some problems, a natural merit function may not exist, in which case the algorithm works with only fixptfn. The merit function function objfn does not have to be specified, even when a natural merit function is available, especially when its computation is expensive.

control

A list of control parameters to pass on to the algorithm. Full names of control list elements must be specified, otherwise, user-specifications are ignored. See *Details* below.

...

Arguments passed to fixptfn and objfn.

Details

control is list of control parameters for the algorithm.

control = list(tol = 1.e-07, maxiter = 1500, trace = FALSE)

tol A small, positive scalar that determines when iterations should be terminated. Iteration is terminated when ||x_k - F(x_k)|| \leq tol. Default is 1.e-07.

maxiter An integer denoting the maximum limit on the number of evaluations of fixptfn, F. Default is 1500.

trace A logical variable denoting whether some of the intermediate results of iterations should be displayed to the user. Default is FALSE.

Value

A list with the following components:

par

Parameter,x* that are the fixed-point of F such that x* = F(x*), if convergence is successful.

value.objfn

The value of the objective function L at termination.

fpevals

Number of times the fixed-point function fixptfn was evaluated.

objfevals

Number of times the objective function objfn was evaluated.

convergence

An integer code indicating type of convergence. 0 indicates successful convergence, whereas 1 denotes failure to converge.

See Also

daarem

Examples


### Generate outcomes from a probit regression model
n <- 1000
npars <- 5
true.beta <- .5*rt(npars, df=2) + 1
XX <- matrix(rnorm(n*npars), nrow=n, ncol=npars)
yy <- ProbitSimulate(true.beta, XX)
max.iter <- 1000
beta.init <- rep(0.0, npars)

### EM algorithm for estimating parameters from probit regression

em.probit <- fpiter(par=beta.init, fixptfn = ProbitUpdate, X=XX, y=yy,
                    control=list(maxiter=max.iter))

[Package daarem version 0.7 Index]