Question: The main idea of the question is how to choose priors' parameters for the time-varying-parameter VAR model. 

I am really confused in the way Primiceri (2005) constructed priors in his paper under the title ["Time varying structural vector autoregressions and monetary policy"](http://faculty.wcas.northwestern.edu/~gep575/tvsvar_final_july_04.pdf). If I understood the idea of the prior correctly, it should reflect our believe for the parameters so we can calculate our posterior distribution. However, how the author identity the matrices' priors in Q, W, and S (in pg. 13) and, for example, choosing the value 40 (the training sample) as the variance for our prior? 

The same inquiry apply for the paper: Nakajima, J., M. Kasuya, and T. Watanabe (2011). "Bayesian analysis of time-varying parameter vector autoregressive model for the Japanese economy and monetary policy". However, in this paper, the justification of the prior choice is really vague and not straightforward.

Answer: 
Primiceri (2005) writes on p. 830 bottom that the first 10 years (40 obs.) are used to calibrate the prior distributions. He estimates a constant parameter VAR model on the first 40 obs. and uses these point estimates to calibrate the prior distributions. Note that he calibrates the variance as four times the estimated variance from the constant parameter VAR.

Nakajima and Kasuya follow Primiceri (2005) when calibrating their prior distribution. They discuss this in sections 3.2 (p. 228-229) and 4.1 (p. 229-231).

The reason for choosing this prior is discussed by both Primiceri (2005) and Nakajima and Kasuya, see section 3.2: "*The priors should be carefully chosen because the TVP–VAR model has many state variables and their process is modeled as a non-stationary process. The TVP–VAR model is so flexible that the state variables can capture both gradual and sudden changes of the underlying economic structure. As mentioned by Primiceri (2005), the tight prior for the covariance matrix of the disturbance in the random walk process avoids implausible behaviors of the time-varying parameters. A tighter prior should sometimes be avoided in empirical econometrics for its arbitrary choice, although the TVP–VAR model needs slightly tighter priors to provide reasonable identification.*"

Nakajima, J. (2011) [Time-Varying Parameter VAR Model with Stochastic Volatility: An Overview of Methodology and Empirical Applications](http://www.imes.boj.or.jp/research/papers/english/me29-6.pdf) and Koop, G. and Korobilis, D. (2009). [BAYESIAN MULTIVARIATE TIME SERIES METHODS FOR EMPIRICAL MACROECONOMICS](http://www.rcfea.org/RePEc/pdf/wp47_09.pdf) provide more details on the TVP-VAR model. There is an improved MCMC algorithm for estimating the TVP-VAR model in Primiceri (2005). A discussion of this is found in [TIME VARYING STRUCTURAL VECTOR AUTOREGRESSIONS AND MONETARY POLICY: A CORRIGENDUM](http://faculty.wcas.northwestern.edu/~gep575/ErrataFinal4.pdf).
Let me try and answer the question: "However, how does the author identify the matrices' priors in Q, W, and S (in pg. 13) and, for example, choosing the value 40 (the training sample) as the variance for our prior?" Specifically, let me try to explain the the prior for Q.

The author states that his choice for the prior of the state error variance, Q, is an inverse Wishart distribution: $Q \sim IW(\Sigma,T)$, where $\Sigma$ is the scale matrix and $T$ the degrees of freedom. Two things are crucial in this distribution: (i) its interpretation and (ii) how to use pre-sample information in order to parameterize the prior.

(i) The inverse Wishart, like the Wishart, can be interpreted as generating sums of squares from samples of size $T$ of observations drawn from the multivariate normal distribution (check [Nydick, 2012](https://pdfs.semanticscholar.org/ac51/ee74af59c432d493da98bd950cc6f856a0ca.pdf), for a quick read on these distributions.) $\Sigma$, as Primiceri hints at on the first paragraph of page 831, can be interpreted as the population value of the variance/covariance matrix of the multivariate normal. So if $T\rightarrow\infty$, by the Law of Large Numbers, your sample sum of squares should be equal to the population sum of squares. Hence, the higher is $T$, the tighter is your prior. What is the relationship of the IW with $Q$? Note that the expected value of a variable $X$ distributed according to IW is $E(X) = \frac{\Sigma}{T - p -1}$, where p is the dimension of $X$. As you can see, if $\Sigma$ is a sum of squares, $E(X)$ is a variance, which is what we are trying to model (Primiceri, 2005, actually clears this up in footnote 20 on page 842.)

(ii) To set the value of $\Sigma$, the scale matrix for the prior of the state error covariance, Primiceri (2005) uses the OLS estimate of the VCV of parameters, $Var(\hat{B}\_{OLS})$. **Since $\bf{Var(\hat{B}\_{OLS})}$ is a variance, he must multiply it by the pre-sample size, in order to obtain the pre-sample sum of squares**. Since he used a pre-sample of 40, in my view, the number of degrees of freedom should be $40-p-1$, where $p$ is the number of parameters he is estimating, just like he does for the other two matrices (although I assume that this is of little consequence for the results.) Therefore, the expected value of his prior is $\frac{Var(\hat{B}\_{OLS})\times(T-p-1)}{T - p -1} = Var(\hat{B}\_{OLS})$.

Hope this helps