\HeaderA{Variogram.default}{Calculate Semi-variogram}{Variogram.default}
\keyword{models}{Variogram.default}
\begin{Description}\relax
This method function calculates the semi-variogram for an arbitrary
vector \code{object}, according to the distances in \code{distance}.
For each pair of elements \eqn{x,y}{} in \code{object}, the
corresponding semi-variogram is \eqn{(x-y)^2/2}{}. The semi-variogram is
useful for identifying and modeling spatial correlation structures in
observations with constant expectation and constant variance.
\end{Description}
\begin{Usage}
\begin{verbatim}
## Default S3 method:
Variogram(object, distance, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] a numeric vector with the values to be used for
calculating the semi-variogram, usually a residual vector from a
fitted model.
\item[\code{distance}] a numeric vector with the pairwise distances
corresponding to the elements of \code{object}. The order of the
elements in \code{distance} must correspond to the pairs
\code{(1,2), (1,3), ..., (n-1,n)}, with \code{n} representing the
length of \code{object}, and must have length \code{n(n-1)/2}.
\item[\code{...}] some methods for this generic require additional
arguments.  None are used in this method.
\end{ldescription}
\end{Arguments}
\begin{Value}
a data frame with columns \code{variog} and \code{dist} representing,
respectively, the semi-variogram values and the corresponding
distances. The returned value inherits from class \code{Variogram}.
\end{Value}
\begin{Author}\relax
Jose Pinheiro \email{Jose.Pinheiro@pharma.novartis.com} and Douglas Bates \email{bates@stat.wisc.edu}
\end{Author}
\begin{References}\relax
Cressie, N.A.C. (1993), "Statistics for Spatial Data", J. Wiley \& Sons.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{Variogram.gls}{Variogram.gls}}, \code{\LinkA{Variogram.lme}{Variogram.lme}},
\code{\LinkA{plot.Variogram}{plot.Variogram}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## Not run: 
fm1 <- lm(follicles ~ sin(2 * pi * Time) + cos(2 * pi * Time), Ovary,
          subset = Mare == 1)
Variogram(resid(fm1), dist(1:29))[1:10,]
## End(Not run)
\end{ExampleCode}
\end{Examples}

