1
$\begingroup$

I'm sorry for a really basic question. I lack proper background in mathematics, but I have to calculate a list of values.

I'm given a vector (list) of observations, and $\hat{Y}$, which is a list of $Y$ estimations (in my case, by the means of linear regression). I need to calculate values $h_i$, such that

$h_i = \frac{\partial{\hat{Y_i}}}{\partial{Y_i}}$

This is where I'm stuck. How do I calculate $h_i$? If, for example $Y=[1, 2, 3, 4]$ and $\hat{Y}=[1.1, 2.2, 3, 3.9]$ what would be corresponding $h_i$ values? I'm familiar with matlab and python, so answers that use either syntax will be perfectly understood

PS. I'm really embarrassed to ask such a basic question. Thus the anonymity. Please forgive me. Oh, and this is not a homework

  • 0
    You could differentiate the result you got from linear regression...2011-05-04
  • 0
    That's exactly what I don't know how to do. I'm looking for a trivial example.2011-05-04
  • 0
    You say you generated your $\hat{Y}$ values via regression; that's why I assumed you had an expression you could differentiate. Or are the $\hat{Y}$ values empirical?2011-05-04
  • 0
    Oh, I see.. $\hat{Y}$ values were calculated using an equation of the form $\hat{y_i}=a\times x_i + b$, where $a$ and $b$ are parameter estimations. So the first derivative of that would be $a$. I can't still figure out how to continue from here2011-05-04
  • 0
    Well, yes, the derivative of a linear function is constant... however, are you sure that your data are adequately described by a line? Did you check the [Pearson correlation coefficient](http://en.wikipedia.org/wiki/Pearson_product-moment_correlation_coefficient) (which any decent regression program should be able to compute), for instance? Better yet, could you post a scatter plot of the *actual* data you have?2011-05-04
  • 0
    Yep, linear regression is totally appropriate with $r=0.93$, mean value of standardized residuals: exp(-5), slope of the residuals exp(-14). And yet, $h_i$ calculation is an enigma for me2011-05-04
  • 0
    Impressive. :) So why can't $h_i$ be the slope of your regression line, then?2011-05-04

0 Answers 0