NEWS.md
ml_replicate()
. Getting a replication algorithm now is guaranteed to work even without the mlfit package in the current environment. This can be an fatal issue when mlfit is internally called by another package. The root cause of this is in the .get_int_fnc() that uses as.environment(“package:mlfit”).prior_weights
argument. The name of a weight column in the reference sample to be used as prior weights should be specified using the prior_weight
argument in special_field_names()
.group_controls
and individual_controls
arguments of ml_problem()
now have NULL
as their default value.ml_problem()
not allowing single-level control when the geo_hierarchy
argument is not NULL
. (#78, @walkerke)geo_hierarchy
ml_problem()
. Simply specify the name of the weight column in your reference sample using the prior_weight
argument in special_field_names()
. (#78, @walkerke)Harmonize yaml formatting.
Revert changes to matrix section.
Reduce parallelism.
Also check dev on cran-* branches.
Update hash key for dev.
Remove R 3.3.
flat_weights
field of an ml_fit
object when there are one or more entries that correspond to zero-valued controls in its ml_problem
object. (#60)testthat
3rd edition.compute_margins()
and margin_to_df()
(#62)compute_margins()
. (#62)ml_problem()
gains a geo_hierarchy
argument, which let the user specifies a region and zone table for creating a list of ml_problem
objects based on zones. See the README
page for an example. Printing ml_problem
will also show its zone, if exists.ml_fit_dss()
(#55).is.ml_problem()
and is.ml_fit()
to is_ml_problem()
and is_ml_fit()
.fitting_problem()
to ml_problem()
to be consistent with the other main functions (ml_fit()
and ml_replicate()
) (#42).fitting_problem
objects to ml_problem
objects (#46).as.flat_ml_fit_problem()
to as_flat_ml_fit_problem()
(#48)ml_fit()
now uses fitting_problem
as first argument to better support pipe workflows (#41).ml_replicate()
which helps to replicate the reference sample of a fitted problem.ml_replicate()
for replicating the reference sample of a fitted problem (#38).ml_fit()
.verbose = TRUE
are prepended with a time stamp.NA
group ID found.iterations
and tol
members (#28).ml_fit()
gains tol
argument, which determines the success of a fitting operation.ml_fit
objects have new members success
, rel_residuals
, and flat_weighted_values
(#28).as.flat_ml_fit_problem()
is used to coerce input for the ml_fit_
functions.format()
and print()
methods for classes fitting_problem
, flat_ml_fit_problem
and ml_fit
.flatten_ml_fit_problem()
gains new model_matrix_type
argument that allows selecting an alternative model matrix building method where all cross-classifications are allocated to a column, regardless of overlaps. Flattened problems store the type of model matrix used, it is also shown with the format()
and print()
methods.individualsPerGroup
special variable.NA
values in controls.grake
package again for calibration, because the alternatives are worse: sampling
uses a too low tolerance, survey
forcibly loads MASS
, and laeken
could work but is unrelated (which is the reason grake
has been started in the first place).control_totals
to target_values
.toy_example()
allows easier access to bundled examples, load with readRDS()
.data-raw
directory.dplyr
functions instead of aggregate()
.flatten_ml_fit_problem()
.compute_margins()
and margins_to_df()
for validationsurvey::grake()
instead of grake::calibWeights()
.data.table
(explicitly convert to data.frame
)Matrix
package if necessaryimportFrom
instead of ::
fitting_problem
, is.fitting_problem
, special_field_names
fitting_problem
(as returned by the fitting_problem
and import_IPAF_problem
functions); former calls like ml_fit(ref_sample, controls, field_names)
now need to be written as ml_fit(fitting_problem(...))
grake
package instead of laeken
ginv
to ml_fit_dss
, passed down to calibWeightsnew function ml_fit_dss
with an implementation very close to the paper by Deville et al. (1993); implementation in the laeken
package
normalize weights to get rid of precision problems
allow partly uncontrolled attributes and controls without observations in the reference sample (with a warning, #24)
better error reporting for non-factor controls and existence of group ID column
improve warning and progress messages
return correct weights – regression introduced in # mlfit 0.0.9
rewrite transformation of weights using sparse matrices and a home-grown Moore-Penrose inverse for our (very special) transformation matrix (#17)
warn on missing observations for nonzero controls (#20)
ml_fit_entropy_o
also returns flat weights
allow arbitrary order in control total tables (#19)
remove observations that correspond to zero-valued control totals, with warning; don’t warn if no corresponding observations need to be removed (#16)
support multiple controls at individual or group level, also detect conflicting control totals
support fitting one-dimensional problems (where only group-level controls are given)
new function flatten_ml_fit_problem
: transform representation as returned by import_IPAF_result
into a matrix, a control vector and a weights vector
function ml_fit_entropy_o
: use BB::dfsane
instead of BB::BBsolve
for solving the optimization problem; rename argument BBsolve_args
to dfsane_args
function ml_fit
: new parameter verbose
aggregate identical household types, implement prior weights (so far only internally)
Add example for ml_fit
(#11)
allow additional arguments for the algorithms; ml_fit_entropy_o
now accepts a named list BBsolve_args
that contains additional arguments to BB::BBsolve
Faster internal data preparation for ml_fit_entropy_o
import_IPAF_results
now returns a class of type IPAF_results
ml_ipf
and ml_ipf_entropy_o
, implementation does not yet return the same weights as the Python codeFix importing configuration files with more than one control of any type and with comments in the control definition
New parameter config_name
to import
, defaults to config.xml
all_weights
to import
that allows importing also intermediate weights. The output format of import
has changed, the weights for each algorithm are now always a list of weight vectors, even in the default case all_weights == FALSE
(#5).