def arma_pacf(ar, ma, nobs=10):
 apacf = np.zeros(nobs)
 acov = arma_acf(ar, ma, nobs=(nobs + 1))
 apacf[0] = 1.0
 for k in range(2, (nobs + 1)):
  r = acov[:k]
  apacf[(k - 1)] = linalg.solve(linalg.toeplitz(r[:(-1)]), r[1:])[(-1)]
 return apacf

def arma_pacf ( ar , ma , nobs = 10 ) : apacf = np . zeros ( nobs ) acov = arma_acf ( ar , ma , nobs = ( nobs + 1 ) ) apacf [ 0 ] = 1.0 for k in range ( 2 , ( nobs + 1 ) ) : r = acov [ : k ] apacf [ ( k - 1 ) ] = linalg . solve ( linalg . toeplitz ( r [ : ( - 1 ) ] ) , r [ 1 : ] ) [ ( - 1 ) ] return apacf
partial autocorrelation function of an arma process parameters ar : array_like .