EPF_logist_compl: Parameter Estimation Of Logistic Linear Models Using...

View source: R/EPF_logist_compl.R

EPF_logist_complR Documentation

Parameter Estimation Of Logistic Linear Models Using Evolutionary Particle Filters (EPF) Method

Description

Estimation of the parameters of a logistic regression using a particle filter method that includes two evolutionary algorithm-based steps. See Details

Usage

EPF_logist_compl(
  Data,
  Y,
  nPart = 1000L,
  p_mut = 0.01,
  p_cross = 0.5,
  thr = 0.5,
  lmbd = 3,
  count = 10,
  initDisPar,
  resample_met = syst_rsmpl
)

Arguments

Data,

matrix. The matrix containing the independent variables of the linear model

Y

numeric. The dependent variable

nPart

integer. The number of particles, by default 1000L

p_mut

numeric. The mutation probability in EPF, by default 0.01

p_cross

numeric. The cross-over probability in EPF, by default 0.5

thr

numeric. The threshold after which the estimated Y is classified as 1

lmbd

numeric. A number to be added and subtracted from the priors when initDisPar is not provided, by default 3

count

numeric. The number of replications within EPF, by default 10

initDisPar

matrix. Values a, b of the uniform distribution (via runif) for each parameter to be estimated, see more in Details

resample_met

function. The resampling method used in EPF, by default syst_rsmpl, see Details

Details

Estimation of the coefficients of a logistic linear regression using the evolutionary particle filter. EPF includes evolutionary algorithms (mutation and cross-over) within PF-base algorithm to avoid degeneracy of particles and prevent the curse of dimensionality. In mutation, p_mut * nPart particles are selected at random from the set of particles obtained in k-1 PF-iteration. This particles will be replaced by fresh new particles taken from a uniform distribution. In cross-over, a pair of random particles is selected from the k-1 propagated particles. The pair is combined into one particle (using the mean) and the result replaces a particle selected at random from the k-1 propagated particles. This cross-over process is replicated prob_cross * N times on each iteration. EPF_logist_compl uses all the information to estimate the parameters.

The state-space equations of the logistic regression model are:

(Eq. 1) X_{k} = a_0 + a_1 * X1_{k-1} + ... + a_n * Xn_{k-1}

(Eq. 2) Y_{k} = 1/(1 + exp(- X_{k}))

(Eq. 3) Z_{k} \sim Ber(Y_{k})

where, k = 1, ... , number of observations; a_0, ... , a_n are the parameters to be estimated (coefficients), and Ber(\cdot) is the Bernoulli distribution.

The priors of the parameters are assumed uniformly distributed. In initDisPar, the number of rows is the number of independent variables plus one since the constant term of the regression is also estimated. The first and second column of initDisPar are the corresponding arguments a and b of the uniform distribution (stats::runif) for each parameter prior. The first row of initDisPar is the prior guess of the constant term. The following rows are the prior guesses of the coefficients. If initDisPar is missing, the initial priors are taken using glm() and coeff() plus-minus lmbd as a reference.

For resample_met, several resampling methods are used following Li, T., Bolic, M., & Djuric, P. M. (2015). Resampling methods for particle filtering: classification, implementation, and strategies. IEEE Signal processing magazine, 32(3), 70-86. Currently available resampling methods are: syst_rsmpl - systematic resampling (default), multin_rsmpl - multinomial resampling, strat_rsmpl - stratified resampling, and simp_rsmpl - simple resampling (similar to PF_lm_ss)

Value

A list with the following elements: smmry: A summary matrix of the estimated parameters; first column is the GLM estimation, and second column is the EPF estimation. AIC: Akaike information criteria of the EPF estimation. Yhat: Estimation of the observation Y. sttp: A matrix with the last iteration parameters-particles. estm: A vector with the final parameter EPF estimation. c_time: The time in seconds it takes to complete EPF.

Author(s)

Christian Llano Robayo, Nazrul Shaikh.

Examples


## Not run: 
#Simulating logistic regression model
val_coef <- c(2, -1.25, 2.6, -0.7, -1.8)
Data1 <-  MASS::mvrnorm(100, mu = rep(0, 4),
                       Sigma = diag(4),
                       empirical = TRUE)
Y1 <- colSums(t(cbind(1,Data1))*val_coef)
prb <- 1 / (1 + exp(-Y1))
Y_ <- rbinom(100, size = 1, prob = prb) ##
#Run EPF
Res <- EPF_logist_compl(Data = Data1, Y = Y_)
#Summary EPF estimation
Res$smmry

## End(Not run)

ChrissCod/LMfilteR documentation built on Feb. 9, 2023, 1:06 p.m.