degrees of freedom in ARIMA model I estimated parameters of an ARIMA model by arima function in R and I calculeted t ratios or t statistics for each parameter. Now I want to find p values for t test, what is my degree of freedom? is it the number of my observations?
 A: Let's say you have an $ARIMA(2,0,0)$, and the length $n=100$, then you have $98$ degrees of freedom. Then the first two values of the variable you are modelling are "used", and you will have $98$ fitted values, and $98$ degrees of freedom. 
A: Working with AR in R: 
for an ARIMA(2,0,0)  the df = N - 2 
including an intercept  df = N - 3 
including both an intercept and a time trend (i.e.  xreg = 1:N) 
the df = N - 4. 
in the below code, an AR(2) is done using maximum likelihood to estimate the coefficients. In other languages (such as SAS) the sum of squared errors and mean squared error is calculated automatically using the appropriate number of degrees of freedom. 
You can tell that the degrees of freedom are N + X (where X = -4) because: 
Start out with all points are free. 
X = 0
It is AR(2), thus two points are not free. 
X = X - 2 
An intercept is included, another point has lost freedom: 
X = X - 1
An external regressor (here, the time component,  1 : length(y), i.e. 1 to the number of y's) is included, another point has lost freedom: 
X = X - 1 
Thus X = -4 because 4 points have lost freedom. 
y_ar <- arima(y, order = c(2,0,0), # AR(2) 
method = "ML,        # maximum likelihood 
include.mean = TRUE,  # include intercept 
  # see the following link for details on irregularities in R 
  # given this parameter 
  # https://www.stat.pitt.edu/stoffer/tsa2/Rissues.htm
transform.pars = FALSE,  # best practice for method = "ML"
xreg = 1:length(y))   # includes time trend as external regressors 

sse = sum(y_ar$residuals^2)
mse = sum(y_ar$residuals^2)/(length(y) - 4)
     # 4 parameters 

