c****n 发帖数: 21367 | 1 哈哈,当然要,但是不用那么多维数
最低维模型,就一个二元变量就行了(死/活),按咱们以前的(I,O,S)标记法
写成常见的(I,S->S+O)形式就是
(猪肉炖粉条,活->活(爽))(半斤砒霜,活->死)(异性按摩,活->未知)
(任何输入,死->死)等等 :)
加入生理constraints是必要的,但是你心肝脾胃肾,各种蛋白,还都不
独立,作用未知,复杂系统的所有因子能全加得进来么?:)
这就是复杂系统的问题啊,所以要低维模型近似。这个低维模型包括所有的
因素,但是是用抽象的方式表达的,比如说咱就迷信了,就金木水火土(看不
习惯用x1-x5代替),然后给能考察的表象分类。比如看到一个人蓬头垢面,
眼里全是血丝,肝痛,口臭,不吃饭,痔疮,皮肤粗糙等等,咱就大笔一挥,
你的,上火的干活~ :) 火参数为8。
其实这些所谓金木水火土,就是大量随机试验以后对实验现象的分类。为什么
他们会和系统特征值恰好差不多呢?这也有道理的。你看啊,我上面举的这些
现象是不是常一起出现?常一起出现说明什么,covariance :) covariance
大的方向是什么?特征方向。:) 简单的线性系统就是 |
|
w*****g 发帖数: 47 | 2 How to make draws which follow multivariate normal distribution? used the
subroutine to decompose the covariance matrix into cholesky factor. but can
not guarantee the matrix is positive definite. is all covariance matrix
positive definite? |
|
s***s 发帖数: 151 | 3 may not be correct,since randn is not for multivariate distribution.
furthermore, even randn generates multivariate N(0,I), the multiplier should
be chol(A), not A, since the new covariance matrix for transformation y = M
*x+u is M'*Sigma*M, where Sigma is x's covariance matrix. |
|
r****y 发帖数: 1437 | 4 【 以下文字转载自 Mathematics 讨论区 】
发信人: rossby (五十岚已夜), 信区: Mathematics
标 题: a question about random number generator
发信站: BBS 未名空间站 (Thu Feb 7 11:28:25 2008), 转信
e.g., given a covariance matrix
cov = [ 1 0.02
0.02 1]
how to generate two random number series that have such covariance?
let's make it more specific, two random numbers both follow normal
distribution.
I guess there must be an algorithm invented already by someone for
such thing.
|
|
c*******h 发帖数: 1096 | 5 【 以下文字转载自 Mathematics 讨论区 】
发信人: cockroach (冬冬), 信区: Mathematics
标 题: a question on brownian motion
发信站: BBS 未名空间站 (Thu Feb 10 20:22:29 2011, 美东)
Let W(t) be the standard Brownian motion. It is known that the covariance
matrix K has entries K(i,j)=min{i,j}. Now, if t is a vector instead of a
scalar (I even don't know the name of this random process), what does the
covariance matrix look like? |
|
q**j 发帖数: 10612 | 6 请问在用predict()产生预测以后如何才可以(简单的)得到covariance matrix of
the forecasts? 我知道可以得到forecast error的covariance,但是如何估计
parameter estimate带来的的forecast error呢?多谢了。 |
|
D******n 发帖数: 2965 | 7 解个线性方程就性了。
1. Let X = (W, X_{sub}). 因为正态分布,对于每个W_j, 都可以写成一个关于X_sub
的线性方程加上一个独立的正态分布变量, i.e.,
W = b+ B * X_{sub} + V
where b is (n-m)*1 vector, B is (n-m)*m matrix, V independent of X_sub and
be joint normal with
zero mean, variance sigma_V -- (n-m)*(n-m) matrix.
use variance and covariance info of X to solve B, and sigma_V: covariance
between W and X_sub for B, and variance of W for sigma_V (the latter you
might not need given 2.)
(1) B* Sigma_{X_sub} = Cov (W, X_sub)
(2) B*Sigma_{X_sub} * B... 阅读全帖 |
|
s*******y 发帖数: 558 | 8 X is an n-dimensional random vector with expected value u_X and
covariance C_X.
Let Y = AX, where A is an nxn orthogonal matrix (det(A) is either 1 or
-1). We know that the covariance of Y, denotes as C_Y is given by
C_Y = A C_X A'.
I was wondering whether the eigenvalues and eigenvectors of C_X is the
same as those of C_Y.
What if Y = AX + b, where b is an n-dimensional constant vector?
Thanks a lot!!! |
|
c**c 发帖数: 39 | 9 S is the sample covariance matrix of a random vector X.
From singular value decomposition,
S=UDU'
Partition the columns of U as (U1,U2).
W is the sample covariance matrix of vec(S), that is, the sample fourth-
moments of the random vector X.
The singular value decomposition of W is
W=AGA'
Hence, the inverse of W is Winv= A(G^-1)A'.
Define
kx as kronecker product,
and define two quadratic forms
L1=y'(U2'kxU2')Winv(U2kxU2)y = y'(U2'kxU2')A(G^-1)A'(U2kxU2)y
L2=y'(U2'kxU2')(G^-1)(U2kxU2)y
The questi |
|
r****y 发帖数: 1437 | 10 e.g., given a covariance matrix
cov = [ 1 0.02
0.02 1]
how to generate two random number series that have such covariance?
let's make it more specific, two random numbers both follow normal
distribution.
I guess there must be an algorithm invented already by someone for
such thing.
|
|
c****x 发帖数: 4 | 11 var(e1)=var(e2)=1
corr(e1,e2)=0
x=e1,y=-e1+e2,z=-e1-2e2
(x,y)=-1
(x,z)=-1
(y,z)=-1
The covariance matrix is only semi-positive-definite. But if you introduce a
3rd independent variable e3, you can have a strict positive definite
covariance matrix. |
|
c*******h 发帖数: 1096 | 12 Let W(t) be the standard Brownian motion. It is known that the covariance
matrix K has entries K(i,j)=min{i,j}. Now, if t is a vector instead of a
scalar (I even don't know the name of this random process), what does the
covariance matrix look like? |
|
m********e 发帖数: 1156 | 13 我还算有知的,无论深度还是广度,奈何世界上的知识太多。
有人贴出老爱的几百篇论文,我一看大多数是德文,不知道,无法判断。
您瞅一眼,看看有多少是真正的科研论文?
1913 Einige Argumente für die Annahme einer molekular Agitation beim
absoluten Nullpunkt Annalen der Physik(ser. 4), 40, 551–560, link
Some Arguments for the Assumption of Molecular Agitation at Absolute
Zero
1913 Déduction thermodynamique de la loi de l'équivalence
photochimique Journal de physique (ser. 5), 3, 277–282
Thermodynamic Deduction of the Law of Photoche... 阅读全帖 |
|
p********0 发帖数: 186 | 14 How many equities did you include in the Markowitz model? What's the method
of your covariance and variance calculation. Did you calculate the expected
return/variance/covariance purely based on the historical data? What is the
number of years your calculation is based on? Does the positive drift happen
every period, constantly beat the market or just one period, a big jump?
What's your turn over ratio for the portfolios(cost for actual implementing
the strategy?)
If you donot have a reasonable |
|
r**a 发帖数: 536 | 15 His formula is correct, since the covariance between B_1 and B_2 is
vanishing here. In Ito's formula the term of 2nd order derivatives
corresponds to the covariance. |
|
i**w 发帖数: 71 | 16 这些是最近两个月每次面试完,给C同学(谢谢陪我一路哈~~)的汇报整理出来的。其实
也没怎么整
理...
大部分都是常见的题。有些常见的题就直接没列。还有些当时忘了的,现在更记不起来
了。
有些是电话上的,有些是onsite。题目有些没说清楚,大家将就,领会精神。
本来什么都没定下来的时候一肚子感想和经验,想着有一天搞定了,一定好好总结总结
。现在定下来
了,倒没了兴致了。。。但想想从版上看过那么多面试题和面经,我争取写点儿,励志
型的,给出身
不好的同学们一点鼓励。也顺便攒攒人品,希望OPT快点儿下来!
1. Singly linked list, write a function to print the nodes backwards.
2. solve dS = (a - b*S)dt+sigma*dW Calculate the variance of S(T)
3. what does it look like if we plot: floating variable against the
actual value assigned to the variable?
4.... 阅读全帖 |
|
i**w 发帖数: 71 | 17 这些是最近两个月每次面试完,给C同学(谢谢陪我一路哈~~)的汇报整理出来的。其实
也没怎么整
理...
大部分都是常见的题。有些常见的题就直接没列。还有些当时忘了的,现在更记不起来
了。
有些是电话上的,有些是onsite。题目有些没说清楚,大家将就,领会精神。
本来什么都没定下来的时候一肚子感想和经验,想着有一天搞定了,一定好好总结总结
。现在定下来
了,倒没了兴致了。。。但想想从版上看过那么多面试题和面经,我争取写点儿,励志
型的,给出身
不好的同学们一点鼓励。也顺便攒攒人品,希望OPT快点儿下来!
1. Singly linked list, write a function to print the nodes backwards.
2. solve dS = (a - b*S)dt+sigma*dW Calculate the variance of S(T)
3. what does it look like if we plot: floating variable against the
actual value assigned to the variable?
4.... 阅读全帖 |
|
z***e 发帖数: 5600 | 18 Use the same correlation matrix from original covariance matrix, then reset
vols with implied vols given, then reconstruct new covariance matrix.
Mathematically just need to scale rows & cols by vol ratios correctly. |
|
w***r 发帖数: 66 | 19 Q1.
Question data:
Portfolio
Market, Investment
S&P 500, $50,000
WHEAT, $250,000
Forecasts
Expected 1 day return, Expected 1 day volatility
0.25%, 2%
0.1%, 3%
FORECAST correlation between S&P 500 and wheat is 20%
Questions:
A1. Calculate the portfolio 1 day expected return (both in percentage terms
and in dollars terms
(show working))
A2. Calculate the portfolio 1 day volatility (both in percentage terms and
in dollars terms (show
working)) – hi... 阅读全帖 |
|
a**********0 发帖数: 422 | 20 我觉得这个问题很复杂 但是 John Cochrane 在他的书里详细讲了volatility和risk的
关系
见而言是 risk不是asset的volatility 而是它和你的utility的covariance
volatility是描述随机变量运动程度的 但是它选择的参照系是绝对的 covariance 也
是描述随机变量运动程度的 但是它的参照系是你的utility/consumption 基于这个
思想 任何volatility可以分解成两部分 一部分叫做systematic risk 另一部分叫做
idiosyncratic risk 前者形容了asset和大盘的关系 后者是只有individual asset
才有的 后者可通过portfolio进行diversity 理论上可以让这部分变成零 所以经典的
金融理论强调idiosyncratic risk earns no premium
举个例子 你在船上 船相当于大盘 你对船有一个相对运动 船自己有个绝对运动 还有
一个人 他相对于船也有一个相对运动 于是你两人组成的系统可以用如下方式hed... 阅读全帖 |
|
r*****d 发帖数: 346 | 21 AB是不是covariance matrix?
不是,因为a covariance matrix必须对称。
如果AB=BA, 则是,因为对称okay, 而且AB=BA使得A,B可以同时对角化;易证AB的特征
根是A的乘以B的,所以非负。 |
|
|
j****x 发帖数: 13 | 23 我知道你会做那个面试题,我也会,但你那写法就是有问题的。
我之所以说你概念混乱,就是你一边说题目给的是vector是数字,但一边写法上又是
random model。
如果x,y都是数字,那你写cov(x,y)是什意思,不都是0么。如果你还处于中学阶段那种
把sample covariance和covariance等价来看的水平,那当我什么都没说过。而且还说
什么x1,x2 iid,不是random variable又哪来的iid。、虽然题目给的是数字没错,都
是estimate。
你能算出个正确答案又如何,说明过程错漏百出,真的让一知半懂的学生看你的解答就
根本是害人。还动不动让人去翻教科书问老师,该是你太久没看教科书都忘了怎样正确
地书写数学了。
mu
parameter |
|
w*******e 发帖数: 14 | 24 yes, the bottom line is to give the covariance matrix between X and Y
Suppose the covariance matrix is S(note s is symmetric)
you assume X~mvn(a,vx),Y~mvn(b,vy)
so Y|X=x(where x is a realization of X) is mvn with
mean b+S*inv(vx)*(x-a)
and variance vy-S*inv(vx)*S' |
|
c**********e 发帖数: 2007 | 25
You got it. This is incorrect.
Using xyct's example, P(x=1,y=1|z=1)=0 but P(x=1|z=1)=P(y=1|z=1)=1/2.
Another example, if x,y,z has a multivariate normal with covariance
1 0 r1
0 1 r2
r1 r2 1
then conditional covariance matrix of (x,y)|z is
1-r1*r1 1-r1*r2
1-r1*r2 1-r2*r2
so x|z and y|z are not independent for given z. |
|
L*****2 发帖数: 66 | 26 如何从SAS 的model的output 中抓出p value
非常多的covariate,用每个covariate来fit一个logistic regression,想比较一下p
value看看那个显著,怎样才能抓出p value,这样可以写个macro,不用一个一个run
了。谢谢 |
|
t**a 发帖数: 6 | 27 有一个关于analysis 的问题,如下:
controal variable: C1, C2, C3
Independent variable: IV1
Dependent variable: DV1, DV2, DV3 (DV1, DV2, DV3 are correlated with each
other)
How should I test the effect of IV1 on DV1, DV2, DV3?
One way is to run separate linear regression on each DV. But this method
doesn't count into the correlation among DVs.
Should I use MANCOVA? If so, in SPSS, should I put IV1 into fixed variable
or covariate? and should I put control variables into fixed or covariate? I'
m always confuse |
|
W**********E 发帖数: 242 | 28
我最近也碰到类似问题。我的想法:
1.
K-M CURVE 是UNADJUSTED. 但是你用TPHREG的话,你估计的SURVIVAL PROBABILITIES
ADJUSTED FOR COVARIATES(S(T)=S(T)0^EXP(BETA*X))。 SURVIVAL
PROBABILITIES 不仅仅随时间变化,也随这些COVARIATES数值的变化而变化.
打个比方,1月内生存概率S(T)应该比第2个月的高。但由于这些协变量X1,X2,
X3。那么不一定,有可能接受治疗+男性+白人第2月内比不治疗+女性+黑人第1月内
的生存概率反而高。
但你作图又无法考虑这些协变量的不同值的话,就出现上下波动,虽然趋势可能也是往下。
2.
用tphreg这个参数来输出SURVIVAL PROBABLITIES。你自己仔细看MANUAL
baseline out=; |
|
W**********E 发帖数: 242 | 29
我觉得你可以考虑你的模型3
1。 人-随机150个
2。 人的眼睛(3个因素:左,右,双)固定
3。 每个位置5个时间点。固定
1>2>3
类似于一个SPLIT-SPLIT PLOT 设计。 人分3个位置,每个位置又分5个点。但你可
以用其他COVARIANCE STRUCTURE 来模拟WITHIN EYE POSITION的COVARIANCE。
3. proc mixed;
class eye time subid;
model score=eye time time*eye/ddfm=kr;
***subid*eye=error term for testing H0: eye=0
random subid subid*eye;
***subject=subid*eye is the unit within which time factor is nested;
repeated time/ type=ar(1) subject=subid*eye;
run; |
|
W**********E 发帖数: 242 | 30 问题相对简单,就是做一个NON-RANDOMIZED TREATMENT GROUP COMPARISON ON
SURVIVAL OUTCOME。这里既然非随机,那么TREATMENT GROUP 和COVARIATES是相关的,
实际中做COX MODEL时加GROUPING VARIABLE 的同时也要ADJUST COVARIATES AS
CONFOUNDERS。
我现在不是很清楚具体SIMULATION步骤,文献有一篇:
1。 SIMULATION X FROM condition distribution function F(X|GROUP)。这个X
的分布FUNCTION比较复杂。
2。 SIMULATE SURVIVAL TIME LOG(T)=B1*X+ERROR。这里ERROR 是EXTREME VALUE
DISTRIBUTION。
但这里X只是一个单变量,而我希望有多个变量。虽然我知道X DEPENDENT ON GROUP,
但为什么不在LOG(T)后面加上GROUP。比如LOG(T)=B0*GROUP+B1*X+ERROR?
不知道是否下面是否可行:
1 |
|
b******w 发帖数: 52 | 31 I tied to use phreg for time-dependent covariate.
According to sas, "No BASELINE data set is created if the counting process
style of input is used or if the model contains a time-dependent variable".
I would like to get the cumulative baseline hazard function \Lambda_0(t) or
the hazard function with all the covariates = 0.
could somebody tell me how to get \Lambda_0(t)? and even kindly point out
how to get h_0(t)?
Thanks! |
|
D******n 发帖数: 2836 | 32 impose some covariance structure, within the same "a" there are some non zer
o covariance, between different "a" ,all zeros |
|
c******5 发帖数: 22 | 33 谢谢回答哈~但是我现在是在logistic regression 中modeling fitting时的问题:就
是说我想研究bim_change_class (categorical variable)与case 的关系,model中还
包含很多covariates(例如年龄,race什么的),还包括bmi_2yrs (这是个
continuous variable,把它变成categorical的就不一样了), 是为了排除它带来的
因素。
你用chi-square来检验两个categorical variable之间的相关性没有错,但我其实不是
想知道bim_change_class和bmi_2yrs之间的关系。我是想知道在研究bmi_change_class
与outcome 的关系的model里,要是加进去了bmi_2yrs,会不会有什么multi-
collinearity的问题。我现在先做了一个只有bmi_change_class, 其他covariates(
例如年龄,race什么的)和outcome的model,发现adjusted for other covariat |
|
s*********t 发帖数: 3 | 34 有个关于Generalized Linear Mixed Models(GLMMs)的问题:
请问在R或SAS中能否得到 covariance matrix between fixed effect estimators (\
beta) and variance component estimator for random effect(\sigma)
在R或SAS中可以得到fixed effect estimators的variance matrix,也可以得到
variance component estimator(\sigma)的variance。但是能否输出它们两者的
covariance呢?
多谢~ |
|
s*********t 发帖数: 3 | 35 在linear mixed model里,fixed effect和 random effect之间的确没有covariance。
(因为Fisher Information Matrix的off-diagonal block matrix=0) 但是在
Generalized Linear Mixed Models里,fixed effect和 random effect之间是有
covariance。(因为Fisher Information Matrix的off-diagonal block matrix !=0) |
|
p********0 发帖数: 186 | 36 Hi,
I have 300 observation of two diemensional data, X1(a1, b1), X2(a2, b2), ...
X3(a3, b3).
how do I use the PCA analysis to get the eigen vector and eigen value?
Do I need to get covariance matrix first? E(a) = Average(a) and E(b) =
average(b).
All the E(X1) = E(X2) = ... = E(Xn)???
How do I get Covariance Matrix Cov(Xi, Xj) |
|
s*******e 发帖数: 226 | 37 This is a good point. In my model, the dependent variable is of firm
risk, and the covariates are a series of firm characteristics and market
conditions. Strictly speaking, when all those covariates are zero, which
means the firm is out of market or no longer exists, the firm's risk
should also be zero. In this sense, the intercept does not have any
meaningful effect.
I'm not sure about the intercept issue only because it's very common in
finance literature to include an intercept in regression |
|
p**********l 发帖数: 1160 | 38 What we learnt during a lecture was to use sphericity test to test if the
within subject variance-covariance matrix has a type H ( Huynh & Feldy)
structure, or others call it HF structure.
Covariance matrix is of type H iff its quadratic form with an orthogonal
contrast matrix.
H0: = sigma^2 I.
Ha: = unstructured form.
If the test is nonsignificant, use univariate test for within-subject
effects and since they are more powerful then the multivariate test.
If the test is signifi |
|
g******h 发帖数: 266 | 39 我用下面的简单程序得到了 communality 和 covariance matrix S of the same data
。 然后想算 Specific variances. 根据定义应该是 Specific variance=Sii-
communality. 但是不知道为什么有的Sii的值比communality小。这是怎么回事啊? 高
人指点一下吧。
程序:
proc factor data=test method=principal covariance;
run;
proc corr data=test cov;
var X1-X7;
run;
My summarized output values:
Variable Factor1_loading Communalities Sii Spedific_Variances=Sii-
communality
m100 0.67766 0.45921690 0.1553157 ??? How can it be
negative???
m200 0 |
|
g******h 发帖数: 266 | 40 I used a simple program to calculate the communality and covariance matrix S
. And use the diagonal element of S, Sii-communality to get specific
variances. But sometimes the Sii
wrong for any reason?
Code:
proc factor data=test method=principal covariance;
run;
proc corr data=test cov;
var m100 m200 m400 m800 m1500 m3000 marathon;
run;
output for communality:
Variable Communality Weight
|
|
j******1 发帖数: 62 | 41 Thanks a lot for your reply.
But Test of Homogeneity of Within Covariance Matrices shows that with-in
covariance matrices will be used in the discriminant function. That means I
need to use quadratic discriminant functions. Qudratic rule is sentitive to
departures from normality. So it would be good to transform hsgpa to nearly
normal. |
|
a********s 发帖数: 188 | 42 I am not a big bull, but I think, the covariance matrix ("Sigma") can be
eigendecomposed into
Sigma = FDt(F)
where, D is the diagonal matrix of eigenvalues. The larger the eigenvalue it
is, the higher the variation of covariance matrix. |
|
j*******y 发帖数: 58 | 43 are you sure? repeated 是specify一个covariance matrix,跟response是不是一样
没有关系吧?我觉得可能是因为这个data是unbalanced,每个id观察值个数不一样,所
以sas连这个covariance matrix的维数都确定不了。 |
|
B****n 发帖数: 11290 | 44 When doing PCA, you have to estimate the variance-covariance matrix. If p>>n
, it is impossible to get a good estimate unless you have special structures about your variance-covariance matrix. |
|
n*****n 发帖数: 3123 | 45 对于PCA, sample is X (n*p), covariance matrix是X'X 是p*p, 因为not full rank
, 所以会有些问题。其实可以考虑对XX'(n*n)做PCA, 然后做变换就可以了。编程实现
也不难。
>n
structures about your variance-covariance matrix. |
|
f***a 发帖数: 329 | 46 我胡乱提下问,希望能跟大家讨论讨论哈 :D
=======================================
Suppose
y_i = response data, i = 1,2,...,n
X_i = covariate data
b_i = coefficient
然后开始set up model, 大概可以写成
y_i \sim p( |g(X_i*b_i)) (或者再复杂点,加些random effects之类的)
p() is some distribution
g() is some function
或者p()也是some kind of function (in data mining perspective)
再或者是hierarchical model
y_i \sim p( |??), ?? \sim f( |!!), !! \sim q( |@@), ...
covariates看具体model,随便插在??/!!/@@ 的位置
那么一般做residual analysis的话,首先基本是estimate parameters
然后deriv... 阅读全帖 |
|
a********s 发帖数: 188 | 47 As far as I know, one strong assumption for covariance structure of mixed
model is the "constant" correlation assumption among measurements of
different subjects even with different baseline time. However, I think, in
my data, for different subjects with different baseline times, the
covariance structures are different. In other words, stuctures depend on
baseline time. How to solve this issue? |
|
d******e 发帖数: 7844 | 48 Covariance Matrix Rank deficient.
举个简单的例子,x服从N(0,1), y = x,那么(x,y)服从正态分布。但是这个协方差矩
阵rank只有1。无法求逆,自然也无法算density。其实Rank deficient的情况很多,常
用的PCA的假设就是covariance是low rank的。
正态分布的定义是
A random vector is said to be multivariate normally distributed if every
linear combination of its components has a univariate normal distribution.
并不是由density function来定义的。 |
|
Y******Y 发帖数: 8753 | 49 第一个model用age作为time scale, 它是通过对entry age做left truncation以及
assume baseline hazard is a function of age来adjust for age. 并且baseline
hazard里面对age effect没有做任何的parametric assumption. 所以在第一个model里
面你是不需要另外将age当作是covariate来adjust。
第二个model是用time on study作为time scale,这个你要adjust for age as a
covariate.这个model你是assume age的effects是exponentially。
两个model都是valid的。但是要注意这两个models大部分时候不是等价的,如果你耐心
写出他们的partial likelihood,他们是不一样。
hope this helps. |
|
q**j 发帖数: 10612 | 50 【 以下文字转载自 Economics 讨论区 】
发信人: qqzj (小车车), 信区: Economics
标 题: 请问有没有人用R里面的vars package做vector autoregression?
发信站: BBS 未名空间站 (Thu Oct 13 17:25:07 2011, 美东)
请问在用predict()产生预测以后如何才可以(简单的)得到covariance matrix of
the forecasts? 我知道可以得到forecast error的covariance,但是如何估计
parameter estimate带来的的forecast error呢?多谢了。 |
|