this is my first post so I apologize if the formatting is a little rocky.  I'm currently going through "Probability and Statistics" 4th ed by DeGroot/Schervish, and I was wondering if somebody could help me out on two related problems (7.5.10, 7.6.1).  The first question is as follows: Suppose that $ X_1, \dots, X_n $ form a random sample from a distribution for which the p.d.f. $ f(x|\theta) $ is as follows: $$ f(x|\theta) = \frac{1}{2} e^{-|x-\theta|} \text{ for } -\infty &lt; x &lt; \infty $$ Also, suppose that the value of $ \theta $ is unknown, for $ -\infty &lt; \theta &lt; \infty $. We will find the M.L.E. of $ \theta $.  The likelihood function is given by $$ f_n(\mathbf{x}|\theta) = \frac{1}{2^n} e^{-\sum_{i=1}^n |x_i - \theta|}$$ and will be maximized when $ \sum_{i=1}^n |x_i - \theta| $ is minimized. By choosing $ \theta $ to be a median value of $ x_1, \dots, x_n $, we accomplish the minimization task.  More specifically, note that the likelihood function has log \begin{align*} \log f(\mathbf{x}|\theta) &amp;= -n \log 2 - \sum_{i=1}^n |x_i - \theta| \\ &amp;= n \left ( - \log 2 - \frac{1}{n} \sum_{i=1}^n |x_i - \theta| \right ) \end{align*} Now, we see that the M.L.E. will minimize the sum in the log likelihood shown above. We can also see that $ \frac{1}{n} \sum_{i=1}^n |x_i - \theta| = E(|X-\theta|)$ for $ X $ having a discrete distribution assigning probability $ \frac{1}{n} $ to each of $ x_1, \dots, x_n $, and 0 everywhere else. So now we can see that, by choosing $ \hat{\theta} $ to be a median of $ x_1, \dots, x_n $, then the log likelihood will be minimized. This follows from the fact that the median of a distribution minimizes the mean absolute error.  The second question is to find the MLE of $e^{-\frac{1}{\theta}}$, which by the invariance property of MLEs, should just be $e^{-\frac{1}{\hat{\theta}}}$.  My problem is that the answer in the back of the book (for the second question) is given as $\left ( \prod_{i=1}^n x_i \right)^{\frac{1}{n}}$, and I'm having trouble reconciling that with my answer. You'd think it'd be pretty straightforward, but...  Any help would be appreciated!
Find the MLE of the unknown parameter $\theta$ when $X_1,X_2,...,X_n$ is a sample from the distribution whose density function is: $$f_X(x) = \frac12e^{-|x-\theta|}, -\infty&lt;x&lt;\infty$$ What I did so far: $$\text{maximize }(\frac12)^ne^{-|x_1-\theta|-|x_2-\theta|-...-|x_n-\theta|} \\ \text{thus we want to minimize }|x_1-\theta|+|x_2-\theta|+...+|x_n-\theta|$$ Since $|x_i-\theta|$ is positive for all $i$, we want to solve for $\theta$ so: $$|x_1-\theta|+|x_2-\theta|+...+|x_n-\theta|=0$$ What do I do from here?
Analysis Question Involving Real Numbers Photoelectric Effect - Dependence of current on frequency How useful is that rule and how many times we can use that in one game?  Under what conditions can the en passant rule be used?  How often does it come up and is it a good idea to use it? Why does the Cauchy distribution have no mean? From the distribution density function we could identify a mean (=0) for Cauchy distribution just like the graph below shows. But why do we say Cauchy distribution has no mean? Using "the" instead of "a" for something that isn't a specific object I've been curious about this for a while.  Generally, one uses "the" if they mean a specific object ("The copy of Lord of the Rings I bought yesterday") instead of any object that fits a description ("I have a copy of Lord of the Rings").  However I've seen "the" used in some cases where the phrase doesn't refer to a specific object. I've noticed it mostly being about technology, such as "This game requires the Classic Controller" (seen on some Wii Virtual Console games). While saying "This game requires a Classic Controller" seems to be correct as well, using "the" doesn't feel wrong either.  The controller's page on Wikipedia also uses "the":   What is the rule that allows the use of "the" in this context?  I presume it has something to do with "Classic Controller" being a proper noun. Is there a feasible way to take a one year break from a IT job and work as a crew member on a big ship? How can one go about this? I am a recreational sailor and know intermediate sailing, coastal navigation, radio handling and all that stuff. I think this could be the experience of a life time. Where should  I look? I imagine getting it would be hard since obviously this is a lucrative job. I started reading "The Mathematics of nonlinear Programming - AL peressini" recently.  Theorem : Suppose that $f(x) , f'(x) ,f''(x)$ exist on the closed interval $[a,b]$. If $x^* ,x $ are two different points of $[a,b]$ , then there exists a point $z$ strictly between $x^*$ and $x$ such that   $$f(x)=f(x^*)+f'(x^*)(x-x^*)+\frac{f''(z)}{2}(x-x^*)^2$$  I tried to prove this theorem using The Fundamental theorem of calculus. But I can not stop it at the second derivative . Do I have to use mean value theorem ? or is there a simple proof for this ? every planar graph can be expressed as a union of five edge-disjoint forests How can I prove that every planar graph can be expressed as a union of (maximum) five edge-disjoint forests?  Only thing I can think about is going somehow like the $5$ color theorem but I get stuck in the middle. Or with induction, but still something doesn't fit. Can you help? When to use ''[verb] that'' I would like to know when to say think(s) that, say(s) that and mean(s) that and when to omit that. reflecting direct light on glossy surface in Cycles Working in Cycles.  Say I have a "disco ball" with a glossy shader. I'm pointing a spot light to it, and I'm trying to have the reflections of that light illuminate the diffuse material on the walls with the patterns from the ball.    I get this:    but I'd like to get something like:    For the illustration I placed a point light inside the ball an removed faces. But what I'd like to do is move the light around the ball so that the light reflected from it changes like it would do in real life.   Is that possible at this point?  EDIT:  Just for the record here's the image rendered in LuxRender (yet another program to learn...) One of the great 'coincidences' in physics is that the Sun happens to shine most brightly at exactly the wavelengths our eyes can see; it's an easy explanation that our eyes evolved to make the most out of what was available.  However, this spectral window is also , with Rayleigh scattering and the ozone layer protecting us from the UV and strong water vapour absorption in the IR until way into the radio range.  My question is: is this a coincidence? Were there geological factors that made it so? Or is it just lucky chance? (I also notice other planets in our neighbourhood weren't quite so lucky.) Or had atmospheric absorption been different our eyes would have tuned to whatever spectral window were brighter as a whole? Is this metric space incomplete? I will give this question a little context. Firstly, as I understand it, as soon as I "close the switch" on a circuit, electric current pretty quickly establishes a steady state where, at any given cross section along a wire, the average kinetic energy of that slice is both constant and equal anywhere along the wire. (Please correct me if I am misunderstanding).   If the average kinetic energy is constant anywhere throughout the wire in the circuit (which confuses me, as I would think that the electrons should all accelerate after exiting the resistor since they are no longer being impeded as much), that means that the average velocity is constant. So, in the example of a simple circuit with a battery of v Volts and a resistor of o Ohms, my question is the following:  Because a 'voltage drop' is known to occur across the resistor, what type energy is being "traded" to generate the heat that radiates from the resistor? I would think that the reflexive answer is "electrical energy"...hence the VOLTAGE drop (the sacrificed energy is clearly not kinetic, as the velocity is constant everywhere). However, I find this confusing. Does this mean that if I had a positive test charge, it would be easier for me to bring it to the beginning of the resistor as compared to bringing it to the end of the resister?     Further, if the correct answer IS "electrical energy", why exactly DOES electrical energy get "dissipated" as the electrons pass through the resistor? I always here the comment Oh! It's because all the electrons are running into densely packed crap which impedes their flow but that to me sounds like a reason for their KINETIC energy to be reduced. However, clearly that's not the case. So, ultimately, I guess the real question is:  **What goes on in the resistor that is literally removing electrical energy **. I am sure that this is a quantum mechanics question, but my quantum mechanics knowledge is not terribly strong. If I could get an answer that is devoid of crazy wave function equations, I would greatly appreciate it. Thanks! How does leave-one-out cross-validation work? How to select the final model out of $n$ different models? I have some data and I want to build a model (say a linear regression model) out of this data. In a next step, I want to apply Leave-One-Out Cross-Validation (LOOCV) on the model so see how good it performs.  If I understood LOOCV right, I build a new model for each of my samples (the test set) using every sample except this sample (the training set). Then I use the model to predict the test set and calculate the errors $(\text{predicted} - \text{actual})$.  In a next step I aggregate all the errors generated using a chosen function, for example mean squared error. I can use these values to judge on the quality (or goodness of fit) of the model.  Question: Which model is the model these quality-values apply for, so which model should I choose if I find the metrics generated from LOOCV appropriate for my case? LOOCV looked at $n$ different models (where $n$ is the sample size); which one is the model I should choose?   Is it the model which uses all the samples? This model was never calculated during the LOOCV process! Is it the model which has the least error? I am trying to pass a member function within a class to a function that takes a member function class pointer.  The problem I am having is that I am not sure how to properly do this within the class using the this pointer.  Does anyone have suggestions?  Here is a copy of the class that is passing the member function:  class testMenu : public MenuScreen{ public:  bool draw;  MenuButton&lt;testMenu&gt; x;  testMenu():MenuScreen("testMenu"){     x.SetButton(100,100,TEXT("buttonNormal.png"),TEXT("buttonHover.png"),TEXT("buttonPressed.png"),100,40,&amp;this-&gt;test2);      draw = false; }  void test2(){     draw = true; } };   The function x.SetButton(...) is contained in another class, where "object" is a template.  void SetButton(int xPos, int yPos, LPCWSTR normalFilePath, LPCWSTR hoverFilePath, LPCWSTR pressedFilePath, int Width, int Height, void (object::*ButtonFunc)()) {      BUTTON::SetButton(xPos, yPos, normalFilePath, hoverFilePath, pressedFilePath, Width, Height);      this-&gt;ButtonFunc = &amp;ButtonFunc; }   If anyone has any advice on how I can properly send this function so that I can use it later. Install Nvidia driver instead of nouveau I've installed Ubuntu 14.04 and I'm experiencing a fuzzy/blurry screen and bad support for multiple screens.  I realized that Ubuntu installs nouveau as default, but I need to install nvidia drivers, so I tried this:   sudo apt-add-repository ppa:ubuntu-x-swat/x-updates apt-get update apt-get install nvidia-current apt-get upgrade       Now that nvidia is installed, you need to blacklist the nouveau driver   so it don’t pop out when you will reboot. Create or edit the following   file:  nano /etc/modprobe.d/blacklist-nouveau.conf       …and add these lines at the end:  blacklist nouveau blacklist lbm-nouveau options nouveau modeset=0 alias nouveau off alias lbm-nouveau off    I checked via the software &amp; updates if nvidia driver got installed successfully, and it says the driver installed is nvidia 304.117  I then tried to run:  lshw -c video | grep 'configuration'   and the result is that the driver is still nouveau:  configuration: driver=nouveau latency=0   So how do I install and use the nvidia drivers? Insert missing dates within table I have a table with a column for ID, Date and Frequency of occurrence for that particular date and ID.  ID    date          Frequency 1     2014-05-18      5 1     2014-05-19      4 1     2014-05-20      25 2     2014-05-20      7 3     2014-05-18      4 3     2014-05-20      1 4     2014-05-18      6   I'm looking to insert the dates for each ID that aren't currently there (assuming that the date ranges from 2014-05-18 to 2014-05-20) and add a value of 0 in Frequency for those.  For example, you can see that  ID 1 has an observation for all three dates;  ID 2 is missing 2014-05-18 and 2014-05-19;   ID 3 is missing 2014-05-19;   ID 4 is missing 2014-05-19 and 2014-05-20.  Therefore, the output should look like this  ID    date          Frequency 1     2014-05-18      5 1     2014-05-19      4 1     2014-05-20      25 2     2014-05-18      0 2     2014-05-19      0 2     2014-05-20      7 3     2014-05-18      4 3     2014-05-19      0 3     2014-05-20      1 4     2014-05-18      6 4     2014-05-19      0 4     2014-05-20      0   I've attempted the following from . However, that will only add dates with 0 Frequency that aren't present throughout the entire table instead of on an ID level.   DECLARE @s DATE = '20140518', @e DATE = '20140520';  SELECT c.date, Frequency = COALESCE(a.Frequency,0) FROM dbo.Calendar AS c LEFT OUTER JOIN dbo.table AS a ON c.date = s.[date] WHERE c.d &gt;= @s AND c.d &lt; DATEADD(DAY, 1, @e); Propose a privilege to sit in the 500 reputation mark Bash prompt error when pressing up arrow I've written this nice and colorful prompt for my OS X terminal:   parse_git_branch() {     git branch 2&gt; /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ [\1]/' }  export PS1="\e]2;\w\a\e[1;30;1m\][\u@\[\033[0;36m\]\h\e[1;30;1m\]:\[\033[0;35m\]\w\e[1;30;1m\]] \[\033[0;31m\](\t) \[\033[0;33m\]\$(parse_git_branch)\n\[\033[0m\]\e[1;30;1m\]\$\[\e[0m\]"   I source ~/.bash_profile it and it works fine. except when I use the arrow up to navigate the history I get a weird thing happening.   basically the beginning of the source ~/.bash_profile command in the history, becomes part of the prompt. when I ctrl+c or enter it returns to normal, but as soon as I see the history of the source command the prompt changes again.   Here's an example where I've seen the history and then ctrl+u and typed ls:   [user@host:~/Documents] (14:01:40)  [branch] $source ~/.ls   Any clue about this? Is there a good way to determine the value of magic items in 5e? In 5e, magic items aren't as common or as varied as in older editions, but that also means it is hard to place prices on them.  As DM, NPC's can't really sell a magic item because we don't know the prices for these items. While it is stated that they are rare and usually unpurchasable and unsellable, but I still have to have some basis on what to price them.  So is there a way to find buying and selling prices for magic items in 5e?