EcologicalInferenceStrategyCalvoEtAl: EcologicalInferenceStrategyCalvoEtAl

EcologicalInferenceStrategyCalvoEtAlR Documentation

EcologicalInferenceStrategyCalvoEtAl

Description

EcologicalInferenceStrategyCalvoEtAl

EcologicalInferenceStrategyCalvoEtAl

Super class

ElectionsLATAM::EcologicalInferenceStrategy -> EcologicalInferenceStrategyCalvoEtAl

Public fields

estsPG

estimation parameters

fracsPG

fractions

Methods

Public methods

Inherited methods

Method new()

Usage
EcologicalInferenceStrategyCalvoEtAl$new(seed = 143324)

Method callDifp()

CALL.DIFP Calculates penalty for given parameters

Usage
EcologicalInferenceStrategyCalvoEtAl$callDifp(
  p,
  mx,
  my,
  covar,
  nR,
  nC,
  nP,
  const
)
Arguments
p

- parameter vector R x (C-1)

mx

- Column marginals

my

- row marginals

nR

- number of rows

nC

- number of columns

nP

- number of precincts

const

- weight for penalty


Method paramsEstim()

Ecological Inference in the RxC case Penalized Least Square Minimizer PARAMS.ESTIM Estimates parameters minimizing the penalized least squares criterion

Usage
EcologicalInferenceStrategyCalvoEtAl$paramsEstim(
  data,
  x = -1,
  nR,
  nC,
  const = 0.001,
  parSeed = -1
)
Arguments
data

- marginals (optionally with covariates)

x

- index (optional, for bootstrapping)

nR

- number of rows

nC

- number of columns

const

- weight for penalty

parSeed

- Seed for parameters (optional)


Method calcFractions()

Calculate Fractions CALC.FRACTIONS Calculate fractions from the parameters

Usage
EcologicalInferenceStrategyCalvoEtAl$calcFractions(p, nR, nC, covar = F)
Arguments
p

- parameters

nR

- number of rows

nC

- number of columns

covar

- (Optional) Vector of covariates


Method paramsBoot()

Bootstrapping PARAMS.BOOT

Usage
EcologicalInferenceStrategyCalvoEtAl$paramsBoot(data, nR, nC, bootSamples)
Arguments
data

- marginals (optionally, with covariates)

nR

- number of rows

nC

- number of columns

bootSamples

- number of bootstrap samples


Method runEcologicalInference()

runEcologicalInference run ecological inference with current strategy

Usage
EcologicalInferenceStrategyCalvoEtAl$runEcologicalInference(
  input.shares.fields,
  output.shares.fields
)
Arguments
input.shares.fields

shares fields in input table

output.shares.fields

shares fields in output table


Method clone()

The objects of this class are cloneable with this method.

Usage
EcologicalInferenceStrategyCalvoEtAl$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Author(s)

ecalvo

Examples

ein <- EcologicalInferenceStrategyCalvoEtAl$new()
# Cannot run without having a processor
# ein$runEcologicalInference(NULL, NULL)

rOpenStats/ElectionsLATAM documentation built on April 22, 2022, 12:53 a.m.