Busabase
Busabase는 AI 에이전트를 위한 오픈소스(MIT) 데이터베이스 및 작업 공간입니다
설명 변수 분포 변화가 CPUE 지표에 미치는 영향을 계산·시각화하는 모델 중립 진단
Calculates and visualises how changes in the distribution of explanatory variables affect standardised catch-per-unit-effort indices. A model-neutral S3 diagnostic provides consistent summaries and pl
데이터R · HTMLGitHub @quantifish온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기Model-neutral influence diagnostics and standardised CPUE indices for fisheries models in R.
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
influ2 calculates and visualises how explanatory variables, random effects,
and spatial fields influence standardised fisheries CPUE indices.
The package uses one model-neutral S3 interface:
The result is a compact influ_diag object with consistent tables and plots
across backends. brms posterior coefficients are projected directly into
focus-by-term diagnostics, avoiding observation-by-draw-by-term arrays.README 전문 보기 ↗influ2 calculates and visualises how explanatory variables, random effects,
and spatial fields influence standardised fisheries CPUE indices.
The package uses one model-neutral S3 interface:
diagnostic <- influ(model, focus = "year")
diagnostic
summary(diagnostic)
plot(diagnostic, type = "influence")
plot(diagnostic, type = "cdi", term = "vessel")
Initial adapters are available for:
stats::glm();mgcv::gam();brms::brm();glmmTMB::glmmTMB();lme4::lmer(), lme4::glmer(), and lme4::glmer.nb();sdmTMB::sdmTMB(); andtinyVAST::tinyVAST().The result is a compact influ_diag object with consistent tables and plots
across backends. brms posterior coefficients are projected directly into
focus-by-term diagnostics, avoiding observation-by-draw-by-term arrays.
Compare saved diagnostics from different model runs in one overlaid CDI:
plot_cdi(list(Full = diagnostic_full, Recent = diagnostic_recent),
term = "month", years = "union")
Coefficient estimates, composition bubbles, and influence lines use the same model colours. A common year axis leaves unavailable years blank; plotting does not silently recalculate each model's centring reference.
# Full posterior calculation, compact stored summaries.
diagnostic <- influ(brms_fit, focus = "year", retain = "summary")
# Retain only draws of the derived diagnostics.
diagnostic <- influ(
brms_fit,
focus = "year",
retain = "derived_draws"
)
# Fast posterior-mean preview.
preview <- influ(brms_fit, focus = "year", uncertainty = "none")
Supported base families in the first implementation are Gaussian, binomial, Poisson, negative binomial, lognormal, Gamma, and Tweedie. Hurdle/delta and zero-inflated components are kept explicit.
Year-effect indices from influ() require an unambiguous focus effect. Offset/exposure
diagnostics currently support single-component log-link ratios and
identity-link contrasts, not combined or nonlinear-probability outputs.
Lognormal support follows each backend's parameterisation; see the main
vignette for the supported location, scale, and link combinations.
For an assessment-ready expected-response table, use cpue_index() with an
explicit common reference profile or population. Both "standardised" and
"standardized" are accepted. GLM, GAM, glmmTMB, lme4, complete brms, sdmTMB, and
univariate tinyVAST fits are supported for response standardisation.
integrate_index() separately calculates area-weighted totals for these same
seven backends, whether or not the fitted model includes spatial effects.
index <- cpue_index(model, year = "year", reference_data = reference_profile)
as.data.frame(index) # Year, Mean, Median, SD, CV, Qlower, Qupper, and metadata.
plot_index(index)
geo_mean(c(1, 4, 16))
total <- integrate_index(model, reference_data = prediction_grid,
area = "area_km2", year = "year",
area_units = "km^2", response_units = "kg/km^2", units = "kg")
plot_index(total)
These response indices are distinct from the year-effect contrasts used in the step plots. See the CPUE indices article for reference choices, compact uncertainty, and comparison examples. Area integration requires a stated domain and compatible response/area units; integrating CPUE does not automatically turn it into absolute biomass.
For GAM, sdmTMB, and univariate tinyVAST fits, index_domain() reports
sampling coverage, native link contributions, restricted-domain indices,
and masked term-omission comparisons without refitting:
domain <- index_domain(model, reference_data = prediction_grid, year = "year",
sampled = list(coords = c("X", "Y"), distance = 5))
plot(domain)
The sampling rule is explicit, and missing responses or zero likelihood weights do not count as observations. GAM spatial/spatiotemporal smooths are grouped only by declared native labels. Shared joint draws preserve dependence across years and counterfactuals, with blocked prediction and compact retained results. See the spatial article for executed examples and interpretation limits.
For a separate view of multiplicative differences, calculate and plot index ratios from stored estimates:
ratios <- index_ratio(list(Full = index_full, Recent = index_recent),
reference = "Full")
plot_index_ratio(ratios)
Ratios use matching years and retain gaps. Their point estimates are not between-model confidence intervals. The Comparing influence and indices article demonstrates unequal year ranges and separate ratio diagnostics.
Residual overviews also adapt to the response: Bernoulli encounter models use fixed-bin probability calibration, while positive and combined responses retain the observed-versus-simulated CDF. No model is refitted by these calls.
checks <- influ_residuals(model, year = "year")
plot(checks) # Automatic fourth panel.
plot(checks, type = "distribution") # Explicit original CDF.
DHARMa is an optional residual engine using the same native simulations and conditioning choices:
checks <- influ_residuals(model, residual_method = "dharma")
plot(checks)
This leaves the default compact engine unchanged. Compact DHARMa calculations
now use a temporary disk cache and bounded observation blocks by default,
rather than holding the full response-simulation matrix in RAM. Native DHARMa
calculates the PIT values and vector-based tests; dispersion and outlier checks
use explicitly labelled bounded-memory equivalents. Use retain_dharma = TRUE
only when its genuine full-memory object is needed for DHARMa's own tools.
Disk storage and extra I/O replace the matrix's RAM cost, not all backend or
diagnostic memory. Conditioning and false-positive calibration are unchanged. See the
DHARMa example
for memory limits, endpoint handling, and interpretation.
For native fitting evidence and a term-by-term residual report:
report <- check_cpue(model, data = original_data)
report
summary(report)$terms
plot(report) # Stored model statistics and exploratory DHARMa tests.
# Quick fitting report; no response simulation.
check_cpue(model, simulate = FALSE)
The checker supports the same seven backends. Unavailable tests are explicitly
unassessed, and there is no overall model-pass flag. Numeric and categorical
term screens are exploratory raw-predictor checks, not coefficient significance
or automatic term selection. Supplying residuals = checks reuses a native
residual result from the same fitted model without further simulation.
See Residual diagnostics for predictive-envelope interpretation and grouped checks that can reveal missing structure even when pooled encounter calibration looks good.
Use one buildmer-style interface with native GLM, GAM, glmmTMB, lme4, brms, sdmTMB, and tinyVAST refitting. Year, offsets, fitted rows, and essential processes stay protected. The default is a preflight report, not a refit:
search_cpue(model, year = "year")
search <- search_cpue(model, year = "year", direction = "backward",
criterion = "BIC", refit = TRUE, max_models = 30)
search$candidates
plot(search)
best <- selected_model(search)
Failed fits and stopping reasons remain visible; each specification is
evaluated once. The recommendation is the best eligible evaluated model,
not a guaranteed global optimum. Use check_cpue(best) separately: residual
p-values are not term-selection rules, and selected-model uncertainty does
not include selection uncertainty. See the
Model search article
for constraints, optional random terms, component handling, and memory limits.
pak::pak("quantifish/influ2")
See vignette("influ2") for the framework, memory strategy, and model
examples. The separate vignette("bentley-validation") documents and plots
the frozen agreement check against the original Bentley implementation.