{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "polynomialtransformationprocedure.json",
    "title": "PolynomialTransformationProcedure",
    "type": "object",
    "description": "Polynomial transformation procedure. Being x the input values, it returns intercept + x**1 * coefficient[0] [ + x**2 * coefficient[1] ] and so on for additional coefficients.",
    "allOf": [
        {
            "$ref": "procedure.json"
        }
    ],
    "properties": {
        "type": {
            "type": "string",
            "enum": [
                "Polynomial",
                "PolynomialProcedure",
                "PolynomialTransformationProcedure"
            ]
        },
        "parameters": {
            "type": "object",
            "description": "Model parameters",
            "properties": {
                "coefficients": {
                    "type": "array",
                    "items": {
                        "type": "number"
                    },
                    "description": "ordered coefficients starting from the linear (mandatory), then the cuadratic, and so on",
                    "minItems": 1
                },
                "intercept": {
                    "type": "number",
                    "description": "intercept of the linear transformation. Defaults to 0"
                }        
            },
            "required": ["coefficients"],
            "additionalProperties": false
        },
        "extra_pars": {
            "type": "object",
            "description": "additional parameters",
            "properties": {
                "allow_na": {
                    "type": "boolean",
                    "description": "allow for null values in input",
                    "default": false
                }
            },
            "additionalProperties": false
        },
        "boundaries": {
            "oneOf": [
                {
                    "type": "array",
                    "items": {
                        "allOf": [
                            { "$ref": "procedureboundary.json"},
                            {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "enum": ["input"]
                                    }
                                }
                            }
                        ]
                    },
                    "minItems": 1,
                    "maxItems": 1
                },
                {
                    "type": "array",
                    "description": "list of lists of observations",
                    "items": {
                        "$ref": "observationlist.json"
                    },
                    "minItems": 1,
                    "maxItems": 1
                },
                {
                    "type": "string",
                    "description": "Path to CSV file. First column must be the datetime index. Headers (first row) must indicate input names"
                }
            ]
        },
        "outputs": {
            "oneOf": [
                {
                    "type": "array",
                    "items": {
                        "allOf": [
                            { "$ref": "procedureboundary.json"},
                            {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "enum": ["output"]
                                    }
                                }
                            }
                        ]
                    },
                    "minItems": 1,
                    "maxItems": 1
                },
                {
                    "type": "array",
                    "description": "list of lists of observations",
                    "items": {
                        "$ref": "observationlist.json"
                    },
                    "minItems": 1,
                    "maxItems": 1
                },
                {
                    "type": "string",
                    "description": "Path to CSV file. First column must be the datetime index. Headers (first row) must indicate output names"
                }
            ]
        }
    },
    "required": [
        "type",
        "parameters"
    ]
}