In this paper, we analyze the finite sample complexity of stochastic system identification using modern tools from machine learning and statistics. An unknown discrete-time linear system evolves over time under Gaussian noise without external inputs. The objective is to recover the system parameters as well as the Kalman filter gain, given a single trajectory of output measurements over a finite horizon of length N . Based on a subspace identification algorithm and a finite number of N output samples, we provide non-asymptotic high-probability upper bounds for the system parameter estimation errors. Our analysis uses recent results from random matrix theory, self-normalized martingales and SVD robustness, in order to show that with high probability the estimation errors decrease with a rate of 1/ √ N . Our non-asymptotic bounds not only agree with classical asymptotic results, but are also valid even when the system is marginally stable. * The authors are with the Department of Electrical and Systems Engineering, University of Pennsylvania, Philadelphia, PA 19104. Emails: {atsiamis,pappasg}@seas.upenn.edu ρ(A) < 1) and is limited to asymptotic results. In [7,8] it is shown that the identification error can decrease as fast as O 1/ √ N up to logarithmic factors, as the number of output data N grows to infinity. While asymptotic results have been established, a finite sample analysis of subspace algorithms remains an open problem [2]. Another open question is whether the asymptotic stability condition ρ(A) < 1 can be relaxed to marginal stability ρ(A) ≤ 1.From a machine learning perspective, finite sample analysis has been a standard tool for comparing algorithms in the non-asymptotic regime. Early work in finite sample analysis of system identification can be found in [13][14][15]. A series of recent papers [16][17][18] studied the finite sample properties of system identification from a single trajectory, when the system state is fully observed (C = I). Finite sample results for partially observed systems (C = I), which is a more challenging problem, appeared recently in [19][20][21]. These papers provide a non-asymptotic convergence rate of 1/ √ N for the recovery of matrices A, B, C, D up to a similarity transformation. The results rely on the assumption that that the system can be driven by external inputs, i.e. B, D = 0. In [19], the analysis of the classical Ho-Kalman realization algorithm was explored. In [20], it was shown that with a prefiltering step, consistency can be achieved even for marginally stable systems where ρ (A) ≤ 1. In [21], identification of a system of unknown order is considered. Finite sample properties of system identification algorithms have also been used to design controllers [22]. The dual problem of Kalman filtering has not been studied yet in this context.In this paper, we perform the first finite sample analysis of system (1) in the case B, D = 0, when we have no inputs, also known as stochastic system identification (SSI) [2]. This problem is more challenging than the case B, D...