Skip to content

selsfm.Rd: a model table up front, per-model arguments and values (issue #3) - #48

Merged
davidhbernstein merged 1 commit into
mainfrom
docs/selsfm-rd
Oct 1, 2026
Merged

davidhbernstein merged 1 commit into
mainfrom
docs/selsfm-rd

Conversation

@davidhbernstein

Copy link
Copy Markdown
Owner

This continues the issue #3 readability pass with selsfm.Rd. It covers two models, "greene" and "kts", but most of the arguments and the whole of \value described "greene" only. Every fact below was checked against R/selsfm.R, R/selsfm_kts.R and fits on main.

Corrected or added facts

what the page said or omitted what the code does how checked
Nsim, sim_type, antithetics, seed: no mention of model "kts" never receives them (.selsfm_kts_fit() has no such parameters) signature of .selsfm_kts_fit
start_val: "Name the starting-value vector" true for "greene". For "kts", a numeric start_val is used as the start, with the four scales as logs selsfm_kts.R: if (is.numeric(start_val)) start_v <- start_val; the start vector holds log(...) scales
keep_objective: FALSE by default "kts" ignores it and always returns $objective fit with the default: !is.null(f$objective) is TRUE
\value: parameters sigma_u, sigma_v, rho, coefficients "greene" only. "kts" returns t0.*, t1.*, sigma_v0, sigma_v1, sigma_u0, sigma_u1, choice.*, delta rownames(f$out) on a kts_sim(600, 3) fit
nobs, n_selected "greene": nobs = selected rows (437 of 800 in the example). "kts": nobs = every row used (600), n_selected = technology-1 rows (368 = Σ I) measured
selection: response may be logical or a two-level factor "greene" only. "kts" requires 0/1 the "kts" branch's binary check
frontier: y may be NA where d == 0 "greene" only. "kts" drops any incomplete row complete.cases() in .selsfm_kts_fit

Layout

  • \description now opens with a three-column table: model_name, model, and what drives the choice.
  • \details has two titled subsections, one per model. The former \section{The KTS model} moved into the second one unchanged, recovery table included.
  • \value has a paragraph for each model.

No technical content was removed. \usage is byte-identical, and tools::checkRd() is clean. I checked the rendered text with R CMD Rdconv -t txt; table cells are kept on one line so the columns don't run together.

🤖 Generated with Claude Code

https://claude.ai/code/session_014oJL17ewiahA8pWbemnqNp


Generated by Claude Code

…sue #3)

The page described only the Greene model's return value and arguments; for
"kts" it did not say that Nsim, sim_type, antithetics and seed are unused,
that a numeric start_val is used as the start (scales as logs), that
$objective is always returned, or what parameters and counts the fit carries.
The KTS discussion moves into Details beside Greene's, under titled
subsections. \usage is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014oJL17ewiahA8pWbemnqNp
@davidhbernstein
davidhbernstein merged commit afe1436 into main Oct 1, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants