Likelihood of an autoregressive time series model with i.i.d. normal innovations
ar_lik(x, ar, mean = 0, sd = 1, log = F, full = T)
numeric vector of data
vector of ar parameters
the innovation mean
the innovation standard deviation
logical; if TRUE, probabilities p are given as log(p)
logical; if TRUE, the full likelihood for all observations is computed; if FALSE, the partial likelihood for the last n-p observations
numeric value for the likelihood or log-likelihood