<?xml version="1.0" encoding="UTF-8"?>
<!-- 
United States Geological Survey - Water Resources Disipline - National Water Information System

The EstimationEquation schema defines the XML structure that holds the an equation used to estimate daily values from daily values at near sites or sites with similar characteristics.

Version 1.1 - 14/18/2012 - Original schema design.
-->
<xsd:schema xmlns:nwis="http://water.usgs.gov/XML/NWIS/5.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="5.0">
	<xsd:include schemaLocation="../shared/IEEE754FloatValue.xsd"/>
	<xsd:include schemaLocation="../shared/HistoryGroup.xsd"/>
	<xsd:element name="EstimationEquationTerm">
		<xsd:annotation>
			<xsd:documentation>
				<Definition>Regression estimation equation term.</Definition>
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="TermNumber" type="xsd:integer">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>The sequence number of the estimation equation term.</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="SiteAgencyCode" type="xsd:string">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>The agency code of the data descriptor site, which contains the data used in the term calculation.</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="SiteNumber" type="xsd:string">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>The site number of the data descriptor site, which contains the data used in the term calculation..</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="DataDescriptorNumber" type="xsd:integer">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>The data descriptor of the data descriptor site, which contains the data used in the term calculation.</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="TermStatisticCode" type="xsd:NMTOKEN">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>The code indicating the type of statistic the value or values represent.</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="TermCoefficient" type="IEEE754FloatValueType" minOccurs="0">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>The Estimation equation term coefficient value.</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="LagDayNumber" type="xsd:integer">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>Estimation equation term number of lag days. The number of days an estimation equation is lagged.</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="TRatioNumber" type="xsd:integer" minOccurs="0">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>t-ratio. The ratio of the computed regression coefficient to its standard deviation. It is used to test the null hypothesis that the coefficient is zero.</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="VarianceInflationFactor" type="IEEE754FloatValueType" minOccurs="0">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>Variance Inflation Factor (VIF). A common measure of multicollinearity (redundancy in predictors). VIFj = 1/(1-Rj^2) where Rj^2 is the coefficient of determination from a regression of predictor Xj on the other predictors in the regression. It represents an "inflation factor" for the variance of the regression coefficient due to redundancy of the predictors.</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="EstimationEquation">
		<xsd:annotation>
			<xsd:documentation>
				<Definition>An equation used to estimate daily values from other daily values.</Definition>
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="StatisticCode" type="xsd:NMTOKEN">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>The code indicating the statistic type of the data being estimate.</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="EquationNumber" type="xsd:integer">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>The sequence number of the estimation equation for the given data descriptor and statistic code.</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="StartDateTime" type="DateTimeWithDatum">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>The effective starting date and time of the estimation equation.</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="EndDateTime" type="DateTimeWithDatum">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>The effective ending date and time of the estimation equation.</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="EquationName" type="xsd:string">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>The name of the estimation equation.</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="EquationDescription" type="xsd:string">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>The description of the estimation equation.</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="SeasonStartDay" type="xsd:string">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>Estimation equation season start day.</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="SeasonEndDay" type="xsd:string">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>Estimation equation season end day.</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="LogarithmicTransformIndicator" type="xsd:boolean">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>A true or false flag indicating if a logarithmic transform is used for the estimation equation computation.</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="EquationConstantMeasure" type="IEEE754FloatValueType">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>Equation constant value. The value of a in a regression equation of the form: y(t) = a + a11*x1(t-L1) + a12*x1(t-L2) +... + a21*x2(t-L1) +... + ank*xn(t-Lk) where y(t) = flow at "study" station at time t, xi(t-Lj) = flow at index station #i at time t-Lj, aij = coefficients to be estimated, and Lj = lag #j (e.g., 3 days, or -1 day, or zero, etc.). </Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="CorrelationCoefficient" type="IEEE754FloatValueType" minOccurs="0">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>The "coefficient of correlation" and expresses the closeness of the relationship. It is the fraction of the total variance of the Y values that is expressed by the regression line. The value of one (1) is a perfect relationship.</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="AdjustedCorrelationCoefficient" type="IEEE754FloatValueType" minOccurs="0">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>Adjusted R-squared value. A rescaling of R-square by degrees of freedom in the regression. It involves the ratio of mean squares rather than sums of squares. It is more comparable than R-square for regression models involving different numbers of explanatory variables with the same dependent variable.</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="StandardErrorMeasure" type="IEEE754FloatValueType" minOccurs="0">
					<xsd:annotation>
						<xsd:documentation>
							<Definition>Standard error of estimate (SEE). The standard deviation of the residuals and describes the dependability of the estimates.</Definition>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:group ref="HistoryGroup"/>
				<xsd:element ref="EstimationEquationTerm" minOccurs="1" maxOccurs="unbounded"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
</xsd:schema>
