John Dodson:hi there John Dodson:I am going to start the recording Pat Suk:Hello, John :) John Dodson:how is the homework going? John Dodson:if anyone want to speak, let me know. Xiaowen:Are you on conference? John Dodson:no, I wasn't planning to use the conference, but we could if you prefer Abdou Mouguiss Ba-Traore:Hi John r u using the mic so far bec i cannot hear u Abdou Mouguiss Ba-Traore:ok i can hear u now thx! Xiaowen:ok Xiaowen:I had a question on the homework Xiaowen:and I am kinda waiting for sharon to get on . John Dodson:ok Xiaowen:so you don't have to repeat John Dodson:I did get an e-mail from her, which I responded to recently Peter:I had a question too (probably the same as Sharons?). If we have the joint density and we are suppose to evaluate the correlation from $E[X_1 X_2]$. However, the joint denisty is in terms of u1, u2 and theta, so how do we find the expectation with respect to X? Xiaowen:basically, I had trouble in #1 after I took partial derivative. I am not sure how I can sub x into U. Xiaowen:yes same question Sharon Linden:Should I be hearing audio? John Dodson:you need to evaluate $E[X_1 X_2]$ in order to determine $\theta$ from $\rho$. Sharon Linden:much better Xiaowen:yes pleaes Sharon Linden:*please Xiaowen:thanks John Dodson:to evaluate $E[X_1 X_2]$, you need the joint density Xiaowen:slide 8 John Dodson:and you can get the joint density from, for example, the slides -- #8 Sharon Linden:John, am I correct in thinking that the joint density is bivariate standard normal based on the marginals being standard normal? John Dodson:Sharon, no it is not. We are mixing normal margins with a non-Gaussian copula John Dodson:At some point, the problem becomes numerical Sharon Linden:yes, I have seen that Peter:so i think we have the left side of the eqn on slide 8 which is the derivative of F WTR to u1 and u2. is the right side of that eqn, the derivative of the pdf WRT x? John Dodson:Peter, you care about $f_X$ John Dodson:so you would use $f_X(x)=f_U(F_1(x_1),F_2(x_2))f_1(x_1)f_2(x_2)$ Peter:i think that helps. i'm working through it now. thank you. John Dodson:Fanda, did my reply make sense? Fanda:actually not Fanda:so what is this notation actually mean? E[x_1 x_2]> Fanda:? Fanda:the expectation of x_1 times x_2 John Dodson:Fanda, yes. This is the Pearson's correlation for standard margins. John Dodson:ordinarily, it would be $\rho=cov[X_1,X_2]/\sqrt$ John Dodson:but here the variance are unity and the cov is just the expectation of the product John Dodson:since the marginal means are zero Fanda:so how to invert an expectation? Xiaowen:just to clarify, you are using X as the joint distribution? in the previous formula? John Dodson:$E[X_1 X_2]$ is going to be some complicated calculation involving $\theta$. You need to determine the value of $\theta$ that yields a result of 0.7. John Dodson:Xiaowen, $X=(X_1,X_2)$ is the joint random variable here. Xiaowen:thanks John Dodson:or rather $X=(X_1,X_2)'$. It should be a column. Holly Borgie:What do you mean by variance are unity...? Holly Borgie:1? John Dodson:by design, $E[X_1]=E[X_2]=0$ and $var[X_1]=var[X_2]=1$. Holly Borgie:ok Jingnan:sorry,I press the wrong botton John Dodson:no prb John Dodson:Holly, yes "unity" is just a fancy way of saying "1". Holly Borgie:Thanks :) Holly Borgie:I like non-fancy terminology John Dodson:fair enough. John Dodson:I guess "unity" is technically a dimensionless scalar "1", which "1" may have units or may be a vector Sharon Linden:John, once we have f_u, what is the best way of finding F_1(x_1),F_2(x_2)? I feel like there is a big picture I am missing here. John Dodson:Sharon, the copula won't tell you anything about the marginals. The problem specifies standard normal margins. Sharon Linden:right Xiaowen:I think I can find copula in terms of u but not x Xiaowen:I am kinda stuck there. Fanda:john, so you want us to find the joint density which is on the numerator on page 8, do the expectation of the product, so as to find the correlation, then equate to .7, right? Sharon Linden:the notation in the book led me to believe that we needed to substitute the CDF of each marginal into f_u so that we are dealing with the same variables on both sides. I am still very unclear about inverting as you and Fanda discussed earlier John Dodson:Xiaowen, I gave you the copula $F_U$ already. You just need to use the definition to get the joint density $f_X$ Holly Borgie:yeah, I see from pearson's rho formula then that 0.7 = E[XY] since E[X] and E[Y] = 0 and SD of X and Y are 1 Xiaowen:I am sorry, I can find f_u. John Dodson:Xiaowen, then $f_X(x)=f_U(F_1(x_1),F_2(x_2))f_1(x_1)f_2(x_2)$, right? John Dodson:Sharon, you won't be able to compute $E[X_1 X_2]$ until you choose a value for $\theta$. You need to find the value that yields a result of 0.7. Xiaowen:right, but f_u is in terms of u and f_x is in terms of x. Holly Borgie:is F(x) then the standard normal CDF? John Dodson:Xiaowen, put $u_1=F_(x_1)$ and $u_2=F_(x_2)$. John Dodson:Holly, yes. The margins are standard normal, so $F_1$ and $F_2$ are the stanard normal distribution functions. Holly Borgie:ok Xiaowen:agree John Dodson:Fanda, yes; that is the program for the first part. Xiaowen:I see why you said we have to use numerical analysis now Jingnan:Jonh, since $f_U$ is density function, how to prove its integral is 1? John Dodson:Jingnan, you could integrate it. Do you get a different result? Jingnan:Use the definition to integral on page 8? John Dodson:Jingnan, actually, all you need to show is that F_U(0,0)=0 and F_U(1,1)=1. John Dodson:Since $F_U$ is the distribution function. John Dodson:and it needs to be non-dereasing in both variables Jingnan:i see, thanks john Fanda:john, so how can we invert an expected value? Fanda:so far i have is the integrand of the expected value John Dodson:Fanda, you need to use a solver such as 'fzero()' Xiaowen:John, we have tried to plug the cdf into f_u and mathematica is not computing. John Dodson:Xiaowen, you probably need to switch over to NIntegrate[] Xiaowen:thank you Holly Borgie:can I just set 0.7 = E[XY] where E[XY] = integral of X*Y*dist of X,Y, which is equal to the function you gave us differentiated twice with the CDF of X and Y plugged in for u1 and u2 respectively? John Dodson:Holly, yes that is the approach. John Dodson:Holly, don't forget the maginal densities Holly Borgie:sweet. Holly Borgie:hmm... John Dodson:$f_X(x)=f_U(F_1(x_1),F_2(x_2))f_1(x_1)f_2(x_2)$ Holly Borgie:yeah, I know, but how does that relate to the formula for pearson's rho? John Dodson:because $\rho=cov[X_1,X_2]/\sqrt$ Holly Borgie:yes Holly Borgie:... John Dodson:what are $var[X_1]$ and $var[X_2]$? Xiaowen:1 Holly Borgie:I thought you said 1 and 1 Holly Borgie:and E[X] amd E[Y] = 0, so rho = E[XY] John Dodson:yes. that's it. Fanda:john, is solve[] the mathematica version of fzero? John Dodson:Fanda, 'Solve[]' is generally for algebraic problems. You probably need to use 'NSolve[]' or 'FindRoot[]' Holly Borgie:ok, ok, so E[XY] = f(X,Y) = f(F(x), F(y)) * f(x) * f(y), right? Holly Borgie:is it possible to do this without a computer? Otherwise I might be at a serious disadvantage... John Dodson:Fanda, sorry.. 'NSolve[]' only works for polynomials. Fanda:gotcha Fanda:how about this NIntegrate Fanda:i was foreced to give specific boundary numbers for x1 and x2 John Dodson:You will have to use that, too. John Dodson:Holly, I don't understand "E[XY]=f(X,Y)" above. What do you mean? John Dodson:$E[XY]=\int\int x y f(x,y) dx dy$ Holly Borgie:on slide 8, take the left hand side multiplied by the denominator on the right hand side, basically if that makes sense...(that's what I'm getting at) John Dodson:ok Holly Borgie:still nonsensical, or ok? John Dodson:Holly, you're defining the joint density, but then equating it with the covariance... John Dodson:so that part doesn't make sense yet Holly Borgie:OK, well I'm not trying to. I'm not on your wavelength. John Dodson:You wrote 'E[XY] = f(X,Y)'. When, in fact, E[XY] = int x y f(x,y) dx dy, right? Xiaowen:what boundaries should I use for NIntergrate for the cdf? -inf to inf is giving me an error Holly Borgie:yes, I think I said above that it is the integral of X*Y*joint density of X and Y, but I'm just having trouble identifying the joint density of X and Y Xiaowen:and i am using Nintergate inside of findroot with theta John Dodson:Xiaowen, you should just play around with various large but fintite values, such as +/- 10, and make that the answer doesn't depend too much on your choice Holly Borgie:seriously though, is it possible to do this with a pencil and paper? Xiaowen:ok understood John Dodson:Holly, no I don't think it is possible to do this without a computer. Holly Borgie:<--- not a happy camper John Dodson:sorry. Stats is very computer intense these days. Holly Borgie:what if I don't have mathematica? John Dodson:my soution is in MATLAB, becasue that the language you are all supposed to have learned... Holly Borgie:yes, but I don't have the symbolic toolbox... John Dodson:I just use the standard packages. I know some people go crazy downloading packages. I don't use MATLAB symbolics. ugh. Fanda:John, what is the matlab function you use for integration? is it trapz()? John Dodson:Fanda, there are various versions of 'quad()'. Fanda:ok i will check that Sharon Linden:John, could you be more specific about how to do this in MATLAB. I feel like we have learned how to do various things in MATLAB, but not how to apply various problems or picture them to use MATLAB efficiently. John Dodson:Sharon, you are going to need to use 'fzero()' for the calibration and some form of 'quad()' to evalaute the expectations. You are also going to need 'erf()' for the normal distribution. John Dodson:'fzero()' and 'quad()' will require you to define anonymous functions. John Dodson:and, of course, John Dodson:'plot()' for the last part. John Dodson:or 'fplot()', which is my preference Sharon Linden:okay. this may be more helpful. John Dodson:Sharon, have you taken Chris' class? I know he said he taught anonymous functions and some of these applications. Jingnan:John, do we need erf()? To convert u_1 to x_1, can we use cdf()? John Dodson:Jingnan, I don't know the 'cdf()' function. Is that part of the stats toolkit? If it is in a package, you are welcome to use it, but I won't support it. John Dodson:Jingnan, I looked up 'cdf()' and it is in the statistics toolbox. Jingnan:yes, it is. John Dodson:I am sure it works, but the definition from week 1 in terms of the standard 'erf()' might be faster. Jingnan:gotcha, another question, in your last Wishart r.v, \Omega stands for sample space, right? John Dodson:no. $\Omega$ here is the generalization of $\omega$ from the characteristic function $\ph(\omega)$. It is the argument -- here a matrix -- that we will use as the basis for differentiation and typically evaluate at zero. John Dodson:I guess I could have used the lower-case $\omega$ instead, but Meucci switched to upper case to indicate that it was a matrix. John Dodson:eq (2.226) John Dodson:He also uses $\Sigma$ as an argument, which I find really confusing, so I used $\Tau$ instead. John Dodson:Maybe I will switch it back to lower-case $\omega$ for posterity. Xiaowen:Hi John, I need some clarification in #3. John Dodson:Jingnan, there. It is switched. Thanks. Xiaowen:I am suppose to plot x2 from -4 to 4 and conditional expectation as y? Xiaowen:so a 2D plot John Dodson:XIaowen, yes, a 2D plot with two lines, one of which is trivial. Xiaowen:and use joint denisty / marginal for conditional exp? John Dodson:yes John Dodson:Xiaowen, you can manipulate the integrand and make use of the fact that $f'(x)=-x f(x)$ for a normal density to simplify the expectation, but it is not necessary. Fanda:john, so i have the pdf of the joint density typed into matlab and try to get the expected values Fanda:the function i am trying to use is quad Fanda:however, the integrad funciton i defined is a function of x1, x2, and thea Fanda:theta Fanda:matlab get sucked there for asking what is theta John Dodson:Fanda, yes, perhaps 'dblquad()'. And yes, you will need to provide a value for 'theta'. John Dodson:this is why you need to use 'fzero()'. Fanda:i don't understand now Fanda:so i tried fzero(quad(...)) Fanda:that is not working John Dodson:you need to define a function that evaluates the integral for a given theta, then supply that function to 'fzero()'. You may need to read some of the documentation if you have never used these functions before. Greg:The function handle for dblquad seems to only take two variables, so there is no room for theta. Perhaps we need to use a traditional function and get theta to it by using a global variable? John Dodson:Greg, I would define an anonymous function on the fly, such as dblquad(@(x1,x2)my_cov(x1,x2,theta),...) Greg:ah.. clever John Dodson:I guess I don't know a less clever way... John Dodson:Everyone, I need to sign-off soon. Any final requests? Greg:Thanks for your help. John Dodson:Sure. See you on Wed. Xiaowen:Thank you John. John Dodson:over the computer, at least. Avinash Pulchan:Thanks Mr. Dodson John Dodson:of course, Avi. John Dodson:I will save the session and the chat log. John Dodson:going once... John Dodson:going twice...