Description Usage Arguments Details Value Author(s) See Also Examples
Solves the underlying equations based on data, the inputs parameters, and the control parameters. It tries to distribute the errors in the places accepted by the user.
1 2 3 | matching.solve(case, nA, nB, nu.A, phi.A, delta.A, gamma, delta.B, phi.B,
nu.B, verbose = FALSE, tolerance.pd = 1.5e-06,
tolerance.degree.max = 1.5e-08, tolerance.pij = 1e-06)
|
case |
a case prepared with |
nA |
the count of entities expected for population A |
nB |
the count of entities expected for population B |
nu.A |
control for nA: 0 means "respect nA", non-null "adapt it to solve the case" |
phi.A |
control for frequencies: 0 means "respect the original frequencies as detected in the sample", non-null "adapt it to solve the case" |
delta.A |
control for degree A: 0 means "respect the input parameters pdi", non-null "adapt them to solve the case" |
gamma |
control for pij: 0 means "respect the matching probabilities pij", non-null "adapt them to solve the case" |
delta.B |
control for degree B: 0 means "respect the input parameters pdj", non-null "adapt them to solve the case" |
phi.B |
control for frequencies: 0 means "respect the original frequencies as detected in the sample", non-null "adapt it to solve the case" |
nu.B |
control for nB: 0 means "respect nB", non-null "adapt it to solve the case" |
verbose |
if TRUE, the resolution will emit messages for debug |
tolerance.pd |
the tolerance for probability distributions |
tolerance.degree.max |
the tolerance for min/max average degrees |
tolerance.pij |
the tolerance for pij probabilities |
This function is deterministic as long as only one solution is found. In case several solutions with equivalent quality are found, one of them is randomly chosen.
a case ready for generation
Samuel Thiriot <samuel.thiriot@res-ear.ch>
matching.prepare
to prepare a case for this function,
matching.generate
to use the result for actual generation,
plot.dpp_resolved
to plot the quality of the solution
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # load sample data
data(dwellings_households)
# prepare the case
case.prepared <- matching.prepare(
dwellings_households$sample.A, dwellings_households$sample.B,
dwellings_households$pdi, dwellings_households$pdj,
dwellings_households$pij)
# resolve tbe case
solved <- matching.solve(case.prepared,
nA=50000,nB=40000,
nu.A=0, phi.A=0, delta.A=1,
gamma=1,
delta.B=0, phi.B=0, nu.B=0)
# print the resolution information
print(solved)
# access the solved frequencies, distribution of degrees and matching probabilities
print(solved$gen$hat.fi)
print(solved$gen$hat.pdi)
print(solved$gen$hat.pij)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.