diagnose_regression
Diagnose regression model issues like multicollinearity, heteroscedasticity, and autocorrelation to validate statistical assumptions and improve analysis accuracy.
Instructions
회귀분석 진단 가이드 (다중공선성, 이분산, 자기상관 등)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"issues": "<issues>"
},
"name": "diagnose_regression"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issues | Yes | 의심되는 문제 (multicollinearity, heteroscedasticity, autocorrelation, outliers) | |
| model_type | No | 모형 유형 |
Implementation Reference
- src/tools/index.ts:1324-1351 (handler)Handler function that takes issues array and returns diagnostic tests, code snippets, and solutions for common regression problems like multicollinearity, heteroscedasticity, and autocorrelation.
function handleDiagnoseRegression(args: Record<string, unknown>) { const issues = args.issues as string[]; const diagnostics: Record<string, any> = { multicollinearity: { tests: ["VIF (>10 문제)", "Condition Number (>30 문제)", "Correlation Matrix"], r_code: "car::vif(model)", stata_code: "vif", solution: "변수 제거, PCA, Ridge regression" }, heteroscedasticity: { tests: ["Breusch-Pagan test", "White test", "Residual plot"], r_code: "lmtest::bptest(model)", stata_code: "hettest", solution: "Robust SE, WLS, Log transformation" }, autocorrelation: { tests: ["Durbin-Watson", "Breusch-Godfrey", "ACF plot"], r_code: "lmtest::dwtest(model)", stata_code: "dwstat", solution: "HAC SE, GLS, ARIMA errors" } }; return { issues, diagnostics: issues.map(issue => diagnostics[issue] || { issue, message: "진단 정보 검색 필요" }) }; } - src/tools/index.ts:201-215 (registration)Registration of the 'diagnose_regression' tool in the main tools array, including name, description, and input schema.
name: "diagnose_regression", description: "회귀분석 진단 가이드 (다중공선성, 이분산, 자기상관 등)", inputSchema: { type: "object", properties: { issues: { type: "array", items: { type: "string" }, description: "의심되는 문제 (multicollinearity, heteroscedasticity, autocorrelation, outliers)" }, model_type: { type: "string", description: "모형 유형" }, }, required: ["issues"], }, }, - src/tools/index.ts:203-214 (schema)Input schema defining the expected parameters: issues (array of strings) required, model_type optional.
inputSchema: { type: "object", properties: { issues: { type: "array", items: { type: "string" }, description: "의심되는 문제 (multicollinearity, heteroscedasticity, autocorrelation, outliers)" }, model_type: { type: "string", description: "모형 유형" }, }, required: ["issues"], }, - src/tools/index.ts:808-809 (registration)Switch case in handleToolCall that routes calls to the diagnose_regression handler.
case "diagnose_regression": return handleDiagnoseRegression(args);