\name{ac}
\alias{ac}
\title{Spatial Accessibility Measures}
\description{
This function measures the accessibility of geographical areas to amenities.
The former usually refer to places of residence and the latter to services
such as health care, education, and culture. Several functions may define the
accessibility measure. See \code{family} for details.}
\usage{
ac(p, n, D, d0, power = 2, family = "SAM")
}
\arguments{
  \item{p}{a vector that quantifies the demand for services in each location, usually the population at risk. For example, it may be the number of older people interested in geriatric services at hospitals.}
  \item{n}{a vector that quantifies the supply of services in each location, usually a characteristic of the service. For example, it may be the number of beds at hospitals.}
  \item{D}{a matrix of a quantity separating the demand from the supply. This is usually a distance matrix, preferably using a road network distance or travel time through the road network.}
  \item{d0}{the threshold distance or time that defines the catchment area (spatial kernel). Required when \code{family} is \code{"2SFCA"} or \code{"KD2SFCA"}.}
  \item{power}{the power of the separation variable. This is usually 2 from the theory of the gravity model in geography.}
  \item{family}{a character value defining the accessibility measure function: \code{"SAM"}, \code{"2SFCA"}, \code{"KD2SFCA"}, \code{"Hansen"}, or \code{"log"}. Default is \code{"SAM"}.

    SAM are the initials of Spatial Accessibility Measure referring to the function \eqn{A_i = \Sigma_j (n_j / (p_i * D_{ij}^2))} discussed in Kalogirou and Foley (2006).}
}
\details{SAM refers to the Spatial Accessibility Measure proposed by Kalogirou and Foley (2006).}

\value{A vector with accessibility measures for all locations (defined by the length of \code{p}).}

\author{Stamatis Kalogirou <stamatis.science@gmail.com>}

\references{
Kalogirou, S., and Foley, R. (2006). Health, place and Hanly: Modelling accessibility to hospitals in Ireland. Irish Geography, 39(1), 52-68.

Kalogirou, S. (2017). Spatial inequality in the accessibility to hospitals in Greece, The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, XLII-4/W2, 91-94, https://doi.org/10.5194/isprs-archives-XLII-4-W2-91-2017.
}
\examples{
n<-1:4
p<-20:25
D<-matrix(1:24, ncol=4, nrow=6)
Acc.p <- ac(p, n, D)
}

\keyword{accessibility}
\keyword{spatial accessibility}
