Matlab's command for defining a vector time series model is vgxset, the formalism for which can be accessed by the command "doc vgxset". It says that the model parameter Q is "[a]n n-by-n symmetric innovations covariance matrix". No description of what it is for. I assumed that it was the covariance of the noise sources that show up in the equations for each times series in the archetypal representation of a vector time series, e.g., http://faculty.chicagobooth.edu/john.cochrane/research/papers/time_series_book.pdf.
Matlab的定义向量时间序列模型的命令是vgxset,它可以被命令“doc vgxset”访问。它表示模型参数Q是“[a]n n- n- n对称创新协方差矩阵”。没有描述它是什么。我假设这是在一个向量时间序列的原型表示法中,每个时间序列中出现的噪音源的协方差,例如:http://adminty.chicagobooth.edu/john.cochrane/research/papers/time_series_book.pdf。
I could be off about something (I often am), but this doesn't seem to match results from actually issuing the command to estimate a model's parameters. You can access the code that illustrates such estimation via the command "doc vgxvarx":
我可能会对某些事情(我经常是这样)感到失望,但这似乎并不匹配实际发出命令来估计模型参数的结果。您可以通过命令“doc vgxvarx”来访问演示这种估算的代码:
load Data_VARMA22
[EstSpec, EstStdErrors] = vgxvarx(vgxar(Spec), Y, [], Y0);
The object EstSpec contains the model, and the Q matrix is:
对象EstSpec包含模型,Q矩阵为:
0.0518 0.0071
0.0071 0.0286
I would have expected that a covariance matrix as ones on the diagonal. Obviously, I misunderstand and/or mis-guessed at the purpose of Q. However, if you actually pull up the code for vgxset ("edit vgxset"), the comments explicitly describe Q as an "[i]nnovations covariance matrix".
我希望在对角线上有一个协方差矩阵。显然,我误解了Q的目的,但是,如果你真的拉起了vgxset(“编辑vgxset”)的代码,注释就会明确地把Q描述为一个“[I]nnovations协方差矩阵”。
I have 3 questions:
我有3个问题:
(1) What exactly is Q?
(1)Q到底是什么?
(2)Is there a Matlab reference document that I've failed to locate for fundamental parameters like this?
(2)是否有一个Matlab参考文档,我没有找到这样的基本参数?
(3)If it isn't the covariance matrix for the noise sources, how does one actually supply actual noise source covariances to the model?
(3)如果不是噪声源的协方差矩阵,如何将实际噪声源协方差提供给模型?
Please note that this question is specifically about Matlab's command for setting up the model, and as such, does not belong in the more concept-oriented Cross Validated Stack Exchange forum. I have posted this to:
请注意,这个问题具体是关于Matlab的建立模型的命令,因此,它不属于更概念化的交叉验证堆栈交换论坛。我把这个贴在:
(1) vgxset command: Q parameter for resulting model object?
(1)vgxset命令:生成模型对象的Q参数?
(2) http://groups.google.com/forum/#!topic/comp.soft-sys.matlab/tg59h1wkRCw
(2)http://groups.google.com/forum/ # ! / comp.soft-sys.matlab / tg59h1wkRCw话题
1 个解决方案
#1
1
I will try to iterate
to an answer, but being so many branches of discussion, i prefer to access directly onto this format. Whatever mean, this is a constructive process, as the purpose of this forum is...
我将尝试迭代到一个答案,但是由于有太多的讨论分支,我倾向于直接访问这种格式。无论如何,这是一个建设性的过程,因为这个论坛的目的是……
Some previous "clarifications":
一些以前的“澄清”:
-
The Output Covariance from
EstSpec.Q
after and before running the commandvgxvarx
are quite similar. Thus the command is outputting what he is shiningly expecting from itself.来自EstSpec的输出协方差。在运行命令vgxvarx之前和之前都非常相似。因此,这一命令的结果是,他所期待的一切都是他所期待的。
-
As an Output Covariance -or whatever other meaning for the
Q
parameter- is almost never to be a "mask" of the parameters to use, -i.e. an identity or a sparse zero-one matrix input parameter-. If you can assign it as a diagonal multiplied by some scalar univariate scalar is a different history. This is a covariance, plainly, just as in otherMATLAB
commands.作为一个输出协方差——或者是Q参数的其他含义——几乎不可能是使用的参数的“掩码”,即一个标识或一个稀疏的零- 1矩阵输入参数。如果你可以把它赋值为一个对角线乘以一个标量的单变量标量是不同的历史。这是一个协方差,很明显,就像在其他的MATLAB命令中一样。
Hence:
因此:
(2) Is there a Matlab reference document that I've failed to locate for fundamental parameters like this?
(2)是否有一个Matlab参考文档,我没有找到这样的基本参数?
No, Matlab ussualy don't give further explanations for "non popular" commands. Yes, this is, under some measure, "not popular", so i would not be impressed if the answer for this question is no.
不,Matlab ussualy没有给出“非流行”命令的进一步解释。是的,在某种程度上,这是“不受欢迎的”,所以如果这个问题的答案是否定的,我不会被打动。
Of course, the doctoral method is to check the provided references, on this case, those provided under doc vartovec
. Which i dunno the hell where to find without order the books seeking the proper library or seeking the overall internet on five minutes...
当然,博士的方法是检查提供的参考文献,在本例中,是由vartovec博士提供的。我不知道在哪里找不到合适的图书馆,或者在五分钟内找遍整个互联网……
Thus the obscure method is always better... check the code for the function by doing edit vgxvarx
. Check the commented Section % Step 7 - Solve for parameters
(Line 515, Matlab R2014b). There are calculations for a Q
matrix through a function mvregress
. At this point, both of us know, this is the core function.
因此,模糊的方法总是更好……通过编辑vgxvarx检查函数的代码。检查注释部分% step7 -求解参数(第515行,Matlab R2014b)。通过函数mvrego计算Q矩阵。在这一点上,我们都知道,这是核心函数。
This mvregress
function (Line 62, Matlab R2014b) receives an input parameter called Covar0
, which is described as a *D-by-D matrix to be used as the initial estimate for SIGMA*
.
这个mvre函数(第62行,Matlab R2014b)接收一个名为Covar0的输入参数,它被描述为一个*D-by-D矩阵,用来作为SIGMA*的初始估计值。
This antecedent leads to the answer for (1).
这个先行词导致了(1)的答案。
(1) What exactly is Q?
(1)Q到底是什么?
The MATLAB
code has dozens of switch -both as options and auto-triggered- so i am actually not sure of which algorithm are you interested on, or based on your data, which ones are actually "triggered" :). Please read the previous answer, and place a Debug Point on the mvregress
function:
MATLAB代码有几十个开关——都是选项和自动触发——所以我实际上不确定你对哪个算法感兴趣,或者基于你的数据,哪些是实际“触发”的:)。请阅读前面的答案,并在mvreexit函数上放置一个调试点:
Covar=Covar+CovAdj; %Line 433, Matlab R2014b
and/or at:
和/或:
Covar = (Covar + Resid'*Resid) / Count; % Line 439, Matlab R2014b
Having that, the exact meaning of Q
, and as indicated by the mvregress
help, would be an "Initial Matrix for the Estimate of the Output Covariance Matrix". The average is simply given by averaging the Count
s...
有了这个,Q的确切含义,以及mvrego帮助所指出的,将是“输出协方差矩阵估计值的初始矩阵”。平均值是通过计算平均值得出的。
But, for the provided data, making:
但是,对于提供的数据,制作:
Spec.Q=[1 0.1;0.1 1];
and then running vgxvarx
, the parameter Covar
never got initialized!. Which for the presented unfortunate case, leads to a simply "Unused Parameter".
然后运行vgxvarx,参数Covar从未被初始化!对于这个不幸的例子,导致一个简单的“未使用参数”。
(3) If it isn't the covariance matrix for the noise sources, how does one actually supply actual noise source covariances to the model?
(3)如果不是噪声源的协方差矩阵,如何将实际噪声源协方差提供给模型?
I've lost tons of manhours trying to gather the correct information from pre-built Matlab
commands. Thus, my suggestion here, is to stick onto the concepts of system identification, and I would put my faith under one of the following alternatives:
我已经丢失了大量的工时,试图从预制的Matlab命令中收集正确的信息。因此,我在这里的建议是坚持系统识别的概念,我将把我的信念放在以下几个备选方案中:
-
Keep believing, and dig a bit and debug inside the
mvregress
function, and check if some of theEstMethod
s -i.e.cwls
ecm
mvn
under Line 195- leads to a proper filling of theCovar0
parameter,继续相信,并在mvreexit函数中进行一些挖掘和调试,并检查是否有一些EstMethods——也就是第195行下的cwls ecm mvn——会导致Covar0参数的正确填充,
-
Stick to the
vgxvarx
command, but let theQ
parameter go, and diagonalize | normalize the data properly, in order to let the algorithm identify the data as a Identically Distributed Gaussian Noise,坚持vgxvarx命令,但让Q参数走,并对|进行正规化,使数据正常化,以便算法将数据识别为同分布的高斯噪声,
-
Send
vgxvarx
to the hell, and usearx
. I am not sure about the current stability ofvgxvarx
, but i am quite surearx
should be more "stable" on this regard...将vgxvarx发送到地狱,并使用arx。我不确定vgxvarx目前的稳定性,但我很确定在这方面arx应该更加“稳定”……
Good Luck,
祝你好运,
hypfco.
hypfco。
EDIT
编辑
A huge and comprehensive comment, i have nothing much to add.
一个巨大而全面的评论,我没什么可补充的。
- Indeed, it is quite probable the
vgxvarx
was run on the Matlab data sample. Hence the results lay explained, - 实际上,vgxvarx很可能是在Matlab数据样本上运行的。因此,结果说明,
- I tried to use the
Q
parameter on thevgxvarx
, with no success by now. If any working code is found, it would be interesting to include it, - 我尝试使用vgxvarx上的Q参数,但现在没有成功。如果发现了任何工作代码,将其包括进来将是很有趣的,
-
The implementation of the noise transformation over the data should be really simple, of the form:
对数据的噪声转换的实现应该非常简单,形式如下:
Y1=(Y-Y0)*L
日元=(Y-Y0)* L
with L
the left triangular cholesky for the inverse calculated covariance of Y
, and Y0
the mean,
用L左三角函数求逆计算的Y的协方差,和Y0的均值,
- I think the
MA
part is as critical as theAR
part. Unless you have very good reasons, you usually cannot say you explained your data in a gaussian way. - 我认为MA部分和AR部分一样重要。除非你有很好的理由,否则你通常不能说你用高斯的方式解释你的数据。
- From your very last comment, I really suggest you to move onto a better, more established command for doing
AR
,MA
,ARMA
and such flavours. I am pretty sure they handle the MV case... - 从你最后的评论,我真的建议你转到一个更好,更成熟的命令去做AR, MA, ARMA和这样的味道。我很确定他们处理MV案例…
- Again,
Matlab
don't impress me on that behaviour... - 同样,Matlab也不能给我留下这样的印象……
Cheers...
欢呼声……
hypfco
hypfco
#1
1
I will try to iterate
to an answer, but being so many branches of discussion, i prefer to access directly onto this format. Whatever mean, this is a constructive process, as the purpose of this forum is...
我将尝试迭代到一个答案,但是由于有太多的讨论分支,我倾向于直接访问这种格式。无论如何,这是一个建设性的过程,因为这个论坛的目的是……
Some previous "clarifications":
一些以前的“澄清”:
-
The Output Covariance from
EstSpec.Q
after and before running the commandvgxvarx
are quite similar. Thus the command is outputting what he is shiningly expecting from itself.来自EstSpec的输出协方差。在运行命令vgxvarx之前和之前都非常相似。因此,这一命令的结果是,他所期待的一切都是他所期待的。
-
As an Output Covariance -or whatever other meaning for the
Q
parameter- is almost never to be a "mask" of the parameters to use, -i.e. an identity or a sparse zero-one matrix input parameter-. If you can assign it as a diagonal multiplied by some scalar univariate scalar is a different history. This is a covariance, plainly, just as in otherMATLAB
commands.作为一个输出协方差——或者是Q参数的其他含义——几乎不可能是使用的参数的“掩码”,即一个标识或一个稀疏的零- 1矩阵输入参数。如果你可以把它赋值为一个对角线乘以一个标量的单变量标量是不同的历史。这是一个协方差,很明显,就像在其他的MATLAB命令中一样。
Hence:
因此:
(2) Is there a Matlab reference document that I've failed to locate for fundamental parameters like this?
(2)是否有一个Matlab参考文档,我没有找到这样的基本参数?
No, Matlab ussualy don't give further explanations for "non popular" commands. Yes, this is, under some measure, "not popular", so i would not be impressed if the answer for this question is no.
不,Matlab ussualy没有给出“非流行”命令的进一步解释。是的,在某种程度上,这是“不受欢迎的”,所以如果这个问题的答案是否定的,我不会被打动。
Of course, the doctoral method is to check the provided references, on this case, those provided under doc vartovec
. Which i dunno the hell where to find without order the books seeking the proper library or seeking the overall internet on five minutes...
当然,博士的方法是检查提供的参考文献,在本例中,是由vartovec博士提供的。我不知道在哪里找不到合适的图书馆,或者在五分钟内找遍整个互联网……
Thus the obscure method is always better... check the code for the function by doing edit vgxvarx
. Check the commented Section % Step 7 - Solve for parameters
(Line 515, Matlab R2014b). There are calculations for a Q
matrix through a function mvregress
. At this point, both of us know, this is the core function.
因此,模糊的方法总是更好……通过编辑vgxvarx检查函数的代码。检查注释部分% step7 -求解参数(第515行,Matlab R2014b)。通过函数mvrego计算Q矩阵。在这一点上,我们都知道,这是核心函数。
This mvregress
function (Line 62, Matlab R2014b) receives an input parameter called Covar0
, which is described as a *D-by-D matrix to be used as the initial estimate for SIGMA*
.
这个mvre函数(第62行,Matlab R2014b)接收一个名为Covar0的输入参数,它被描述为一个*D-by-D矩阵,用来作为SIGMA*的初始估计值。
This antecedent leads to the answer for (1).
这个先行词导致了(1)的答案。
(1) What exactly is Q?
(1)Q到底是什么?
The MATLAB
code has dozens of switch -both as options and auto-triggered- so i am actually not sure of which algorithm are you interested on, or based on your data, which ones are actually "triggered" :). Please read the previous answer, and place a Debug Point on the mvregress
function:
MATLAB代码有几十个开关——都是选项和自动触发——所以我实际上不确定你对哪个算法感兴趣,或者基于你的数据,哪些是实际“触发”的:)。请阅读前面的答案,并在mvreexit函数上放置一个调试点:
Covar=Covar+CovAdj; %Line 433, Matlab R2014b
and/or at:
和/或:
Covar = (Covar + Resid'*Resid) / Count; % Line 439, Matlab R2014b
Having that, the exact meaning of Q
, and as indicated by the mvregress
help, would be an "Initial Matrix for the Estimate of the Output Covariance Matrix". The average is simply given by averaging the Count
s...
有了这个,Q的确切含义,以及mvrego帮助所指出的,将是“输出协方差矩阵估计值的初始矩阵”。平均值是通过计算平均值得出的。
But, for the provided data, making:
但是,对于提供的数据,制作:
Spec.Q=[1 0.1;0.1 1];
and then running vgxvarx
, the parameter Covar
never got initialized!. Which for the presented unfortunate case, leads to a simply "Unused Parameter".
然后运行vgxvarx,参数Covar从未被初始化!对于这个不幸的例子,导致一个简单的“未使用参数”。
(3) If it isn't the covariance matrix for the noise sources, how does one actually supply actual noise source covariances to the model?
(3)如果不是噪声源的协方差矩阵,如何将实际噪声源协方差提供给模型?
I've lost tons of manhours trying to gather the correct information from pre-built Matlab
commands. Thus, my suggestion here, is to stick onto the concepts of system identification, and I would put my faith under one of the following alternatives:
我已经丢失了大量的工时,试图从预制的Matlab命令中收集正确的信息。因此,我在这里的建议是坚持系统识别的概念,我将把我的信念放在以下几个备选方案中:
-
Keep believing, and dig a bit and debug inside the
mvregress
function, and check if some of theEstMethod
s -i.e.cwls
ecm
mvn
under Line 195- leads to a proper filling of theCovar0
parameter,继续相信,并在mvreexit函数中进行一些挖掘和调试,并检查是否有一些EstMethods——也就是第195行下的cwls ecm mvn——会导致Covar0参数的正确填充,
-
Stick to the
vgxvarx
command, but let theQ
parameter go, and diagonalize | normalize the data properly, in order to let the algorithm identify the data as a Identically Distributed Gaussian Noise,坚持vgxvarx命令,但让Q参数走,并对|进行正规化,使数据正常化,以便算法将数据识别为同分布的高斯噪声,
-
Send
vgxvarx
to the hell, and usearx
. I am not sure about the current stability ofvgxvarx
, but i am quite surearx
should be more "stable" on this regard...将vgxvarx发送到地狱,并使用arx。我不确定vgxvarx目前的稳定性,但我很确定在这方面arx应该更加“稳定”……
Good Luck,
祝你好运,
hypfco.
hypfco。
EDIT
编辑
A huge and comprehensive comment, i have nothing much to add.
一个巨大而全面的评论,我没什么可补充的。
- Indeed, it is quite probable the
vgxvarx
was run on the Matlab data sample. Hence the results lay explained, - 实际上,vgxvarx很可能是在Matlab数据样本上运行的。因此,结果说明,
- I tried to use the
Q
parameter on thevgxvarx
, with no success by now. If any working code is found, it would be interesting to include it, - 我尝试使用vgxvarx上的Q参数,但现在没有成功。如果发现了任何工作代码,将其包括进来将是很有趣的,
-
The implementation of the noise transformation over the data should be really simple, of the form:
对数据的噪声转换的实现应该非常简单,形式如下:
Y1=(Y-Y0)*L
日元=(Y-Y0)* L
with L
the left triangular cholesky for the inverse calculated covariance of Y
, and Y0
the mean,
用L左三角函数求逆计算的Y的协方差,和Y0的均值,
- I think the
MA
part is as critical as theAR
part. Unless you have very good reasons, you usually cannot say you explained your data in a gaussian way. - 我认为MA部分和AR部分一样重要。除非你有很好的理由,否则你通常不能说你用高斯的方式解释你的数据。
- From your very last comment, I really suggest you to move onto a better, more established command for doing
AR
,MA
,ARMA
and such flavours. I am pretty sure they handle the MV case... - 从你最后的评论,我真的建议你转到一个更好,更成熟的命令去做AR, MA, ARMA和这样的味道。我很确定他们处理MV案例…
- Again,
Matlab
don't impress me on that behaviour... - 同样,Matlab也不能给我留下这样的印象……
Cheers...
欢呼声……
hypfco
hypfco