{
    "command": "sgfit",
    "description": "Fit the selected model independently by group using one target vector and the\nconfigured predictor fields. The fitted target is written to the output;\noptional diagnostics include fit error and model parameters.",
    "examples": [],
    "input_description": "input dataset:\n1. the first vector is the target (dependent variable)\n2. the remaining vectors are predictors (independent variables)",
    "notes": [],
    "output_description": "output dataset with the first vector replaced by fitted values and a fiterr field added",
    "package": "sigclear-optim",
    "parameters": [
        {
            "choices": [],
            "default": "stdin",
            "default_known": false,
            "description": "input dataset:\n1. the first vector is the target (dependent variable)\n2. the remaining vectors are predictors (independent variables)",
            "name": "in",
            "required": false,
            "type": "ifile",
            "units": null
        },
        {
            "choices": [],
            "default": "stdout",
            "default_known": false,
            "description": "output dataset with the first vector replaced by fitted values and a fiterr field added",
            "name": "out",
            "required": false,
            "type": "ofile",
            "units": null
        },
        {
            "choices": [
                "linear",
                "match",
                "poly"
            ],
            "default": "linear",
            "default_known": true,
            "description": "fitting model:\nlinear: y = a[0] + sum_i=1:n a[i]*x[i]\nmatch: y[i] = sum_k=-mf:nf a[k]*x[i-k]\npoly: y = sum_k=0:nf a[k]*x^k",
            "name": "model",
            "required": false,
            "type": "enum",
            "units": null
        },
        {
            "choices": [],
            "default": 5,
            "default_known": true,
            "description": "causal filter order for match mode, or polynomial order for poly mode",
            "name": "model.nf",
            "required": false,
            "type": "int",
            "units": null
        },
        {
            "choices": [],
            "default": 0,
            "default_known": true,
            "description": "number of non-causal matching-filter coefficients",
            "name": "match.mf",
            "required": false,
            "type": "int",
            "units": null
        },
        {
            "choices": [],
            "default": "NULL",
            "default_known": false,
            "description": "optional output dataset containing fitted model parameters",
            "name": "model.qc",
            "required": false,
            "type": "ofile",
            "units": null
        },
        {
            "choices": [
                "mae",
                "mse",
                "mme",
                "m4e"
            ],
            "default": "mse",
            "default_known": true,
            "description": "fitting objective:\nmae: minimize absolute error for Laplacian noise\nmse: minimize squared error for Gaussian noise\nmme: minimize maximal error  \nm4e: minimize fourth-power error as an approximation to mme",
            "name": "optim",
            "required": false,
            "type": "enum",
            "units": null
        },
        {
            "choices": [
                "steepgrad",
                "proxgrad"
            ],
            "default": "steepgrad",
            "default_known": true,
            "description": "optimization algorithm",
            "name": "optim.driver",
            "required": false,
            "type": "enum",
            "units": null
        },
        {
            "choices": [],
            "default": 10,
            "default_known": true,
            "description": "number of optimization iterations",
            "name": "optim.niter",
            "required": false,
            "type": "int",
            "units": null
        }
    ],
    "related": [],
    "schema_version": 1,
    "summary": "Fit linear, matching-filter, or polynomial models by group",
    "synopsis": "sgfit <stdin >stdout model=linear model.nf=5 match.mf=0 model.qc=NULL optim=mse optim.driver=steepgrad optim.niter=10",
    "version": "1.0.1-5"
}