(I have asked  in the math site, but think it might be more relevant here) I have been following the online MIT statistics course, and one course was about some fundamental distributions.()  I read it a couple of times and did a lot of search online, but I still find it hard to fully grasp the idea of how to match different distributions to different real life scenarios.   For example, "Suppose we have a tape measure with markings at each millimeter. If we measure (to the nearest marking) the length of items that are roughly a meter long, the rounding error will uniformly distributed between -0.5 and 0.5 millimeters." I just cannot wrap my head around how it was determined that uniform distribution matches this case.  I'm wondering if there are some books/articles that give detailed and intuitive explanation of distributions and their real life applications?
I am a grad student developing an interest for statistics. I like the material over-all, but I sometimes have a hard time thinking about applications to real life. Specifically, my question is about commonly used statistical distributions (normal - beta- gamma etc.). I guess for some cases I get the particular properties that make the distribution quite nice - memoryless property of exponential for example. But for many other cases, I don't have an intuition about both the importance and application areas of the common distributions that we see in textbooks.   There are probably a lot of good sources addressing my concerns, I would be glad if you could share those. I would be a lot more motivated into the material if I could associate it with real-life examples.
How can I handle autocorrelated residuals? In the Breusch-Godfrey test we use a model  $$ e_t = \varepsilon_t + \beta_1 \varepsilon_{t-1} + \dots+ \beta_p \varepsilon_{t-p}. $$  If we reject the null hypotesis of no serial auotocorrelation of the error, it means that the residuals follow an auto-regressive model of order ($p$).  If I want to avoid this problem, I must add a certain number of lags of the response variable $y$ as regressors in the original model. However, in some cases this method is not useful.   Are there other options to consider? I know that the Windows copy dialog (in Windows&nbsp;XP) stores the copy in memory first, and it is still copying after the dialog closes, so the time is off, but why is the estimation of the time it will take to make a copy so inaccurate, even when memory copying has been disabled (in Vista and Windows&nbsp;7)? It seems so arbitrary! How does the whole copy procedure work, and why can't Windows estimate it correctly? How were the number of rounds for different key sizes of AES selected? The number of AES rounds increases with the key length. Why increase the number of rounds at all, and how were these round counts chosen? Unicode Processing in C++ What is the best practice of Unicode processing in C++? How to copy the contents of a file in UNIX without displaying the file contents. I don't want to cat or vi to see the contents.  I want to copy them to clipboard so that I can paste it back on my windows notepad.  I can't copy the file from that server to another due to access restrictions. Can I read and write to the same file in Linux without overwriting it? How do you mock a Sealed class? can be quite a pain.  I currently favor an  to handle this, but something about just keeps feels weird.    So, What is the best way you mock sealed classes?  Java answers are more than welcome.  In fact, I would anticipate that the Java community has been dealing with this longer and has a great deal to offer.  But here are some of the .NET opinions: I want to filter a java.util.Collection based on a predicate. D+ and D- on USB I'm making a small project which will take +5v from USB, What should I do with the D+ and D-, keep it open or short them to ground or do I have to add some components?  I want to run ATMEGA168 and 16x2 LCD with back light. Can I recover app data after the phone has been Factory Reset? surjective immersion $\mathbb{R}^2 \to \mathbb{R}^2$ which is not a diffeomorphism Does there exist a surjective immersion $\mathbb{R}^2 \to \mathbb{R}^2$ which is not a diffeomorphism?  I tried to modify $\exp: \mathbb{C} \to \mathbb{C}$ to be surjective, but I find it hard to preserve the property of being immersion.  I also noticed that if we replace $\mathbb{R}^2$ with $S^2$ or any other compact simply connected manifold, no such immersion exists, because then it would be a covering map (as a local diffeomorphism from compact space, thus proper), but since the manifold is simply connected, it must be a diffeomorphism. The dimension of the Hilbert space is determined by the number of independent basis vectors. There is a infinite discrete energy eigenbasis $\{|n\rangle\}$ in the problem of particle in a box which can be used to expand a general state $|\psi\rangle$ as: $$|\psi\rangle=\sum\limits_{n=0}^{\infty} C_n |n\rangle$$ Here, the basis implies that the Hilbert space has countably infinite number of basis vectors. But one could well expand $|\psi\rangle$ in any other basis as well, say the continuous position basis. Then that superposition, $$|\psi\rangle=\int dx \psi(x)|x\rangle$$ is also possible. But this basis $\{|x\rangle\}$ is continuous and uncountably infinite. Such sets cannot be equal because they have different cardinality. Then my questions is how many independent basis vectors are really there in this Hilbert space? What is the difference between class and instance attributes? Is there any meaningful distinction between:  class A(object):     foo = 5   # some default value   vs.  class B(object):     def __init__(self, foo=5):         self.foo = foo   If you're creating a lot of instances, is there any difference in performance or space requirements for the two styles? When you read the code, do you consider the meaning of the two styles to be significantly different? What would be the Slater's determinant representation for an excited state? Setup  Introducing this spinorbital notation:  \begin{align} \Psi_1=\chi_{(r1)}\alpha_{(\omega1)}  = 1 \\ \Psi_1=\chi_{(r1)}\beta_{(\omega1)}  = \bar{1} \end{align}  and the Slater's determinant, for a system of two electrons, is:  \begin{align} |\Psi\rangle = \frac{1}{\sqrt{2}} \Big|  \begin{array}{cc} 1 &amp; \bar{1}  \\ 2 &amp; \bar{2}  \\ \end{array}  \Big| = \frac{|1\bar{2}\rangle-|\bar{1}2\rangle}{\sqrt2} \end{align}  Question  Based on the example, what would be the Slater's determinant representation for an excited state like $\Psi_a^r$ (i.e. with parallel spins like: $|\bar{1}\bar{2}\rangle$) and $\Psi_{ab}^{rs}$ (feel free to use any number) ? In the 1960s I read book--an older children's book, I think--which I loved, and still remember, roughly.  I have no idea what the title is or who the author is, and I'm wondering if anyone knows this one:  Scientists had invented a device which they didn't fully understand, and which had puzzling effects.  For example, when a pencil was put into the machine, it disappeared, and then reappeared inside out: The lead was on the outside.  When people went into the machine, they came back dead, having died from fright.  Finally they sent a very open-minded person into the machine.  She was an artist, I think.  She was able to return alive, and described an alternate universe in which geometry was very different.  I distinctly remember that there were supposedly square triangles or four-sided triangles--or was it three-sided squares?  (This is, of course, a literally contradictory claim, but I didn't see the matter as clearly then.)  Thanks! if $(x_0,y_0)$ is local extrema in $ax^2 + by^2 + cxy + dx + ey + l$ then its global too. An exercise on a book asks me to prove that if a point $(x_0,y_0)$ is a local extrema for the function $$f(x,y) = ax^2 + by^2 + cxy + dx + ey + l$$ then it's also a global extrema.  The exercise asks me to consider that $g(t) = f(x_0+ht,y_0+kt)$ is a parabola, but I couldn't understand how it helps. Maybe since it's a parabola, I know that this derivative has to be $0$ in some point, and also that this function $g(t)$ has a global extrema point, but I couldn't derive anything from this. I also tried to find the derivatives, equal them to $0$ and solve the system. I got:  $$x_0 = -\frac{2 b d - c e}{4 a b - c^2}, y_0 = -\frac{   c d - 2 a e}{-4 a b + c^2}$$  But when I try to find   $$f\left(-\frac{2 b d - c e}{4 a b - c^2},-\frac{   c d - 2 a e}{-4 a b + c^2}\right)$$ so I can try to prove:  $$f(x,y)-f(x_0,y_0)$$  is either greater or less $0$ depending on the case (so I can do $f(x,y) \le f(x_0,y_0)$ and $f(x,y) \ge f(x_0,y_0)$)  things get hairy. Problem storing arrays with update_user_meta I am writing a function that adds an ID number to an array and puts the array in the usermeta. $_GET['auction'] is the post_id.  Below is the function:  $reminders = get_user_meta( $current_user-&gt;ID, "reminders" ); print_r( $reminders ); if( in_array( $_GET['auction'], $reminders ) ) {     echo "Failed: Auction already in list"; } else {     array_push( $reminders, intval( $_GET['auction'] ) );     if ( update_user_meta( $current_user-&gt;ID, "reminders", $reminders ) ) {         echo "Success";     } else {         echo "Failed: Could not update user meta";     } } print_r( $reminders );   Here is the output after adding one auction:  Array ( )  Success Array ( [0] =&gt; 7 )    Here is the output after adding two auctions:  Array ( [0] =&gt; Array ( [0] =&gt; 7 ) )  Success Array ( [0] =&gt; Array ( [0] =&gt; 7 ) [1] =&gt; 73 )   And here is the output after adding three auctions:  Array ( [0] =&gt; Array ( [0] =&gt; Array ( [0] =&gt; 7 ) [1] =&gt; 73 ) )  Success Array ( [0] =&gt; Array ( [0] =&gt; Array ( [0] =&gt; 7 ) [1] =&gt; 73 ) [1] =&gt; 0 )   Notice that adding a new element to the array using array_push works fine. But when the array is stored in the usermeta then retrieved again, the last element in the array has been put into an array of its own, creating an infinitely dimensional array. I'd prefer to keep this array one dimensional.  Is there a way I can run update_user_meta and get_user_meta without it changing the structure of my array? How do I migrate my Keychain's "Local Items" to a new Mac? After preforming a Mavericks-Mavericks migration using Migration Assistant, I have a "Local Items" Keychain on my new machine in which many (perhaps most) items are out of date (using old passwords), and some are missing altogether. While I have access to a copy of the entire contents of the ~/Library/Keychains/ directory from my old machine, which presumably contains all the information I'm missing, I see no way of importing that information into my new machine.  How can I import the "Local Items" from my old Keychain into the Keychain on my new machine? How does an Intelligence penalty affect skill points when character-building/leveling-up? Why is it better to use "#!/usr/bin/env NAME" instead of "#!/path/to/NAME" as my shebang? I notice that some scripts which I have acquired from others have the shebang #!/path/to/NAME while others (using the same tool, NAME) have the shebang #!/usr/bin/env NAME.  Both seem to work properly.  In tutorials (on Python, for example), there seems to be a suggestion that the latter shebang is better.  But, I don't quite understand why this is so.  I realize that, in order to use the latter shebang, NAME must be in the PATH whereas the first shebang does not have this restriction.  Also, it appears (to me) that the first would be the better shebang, since it specifies precisely where NAME is located.  So, in this case, if there are multiple versions of NAME (e.g., /usr/bin/NAME, /usr/local/bin/NAME), the first case specifies which to use.  My question is why is the first shebang preferred to the second one?