Consider the following "facts" about Bayes theorem and likelihood:   Bayes theorem, written generically as $P(A|B) = \frac{ P(B|A) P(A) }{ P(B) }$ involves conditional and marginal probabilities.  Focus on $P(B|A)$. Wiki Bayes theorem says this is a conditional probability (or conditional probability density in the continuous case). This seems quite clear in the alternate expression $P(B|A) P(A) = P(A|B) P(B)$. In the Bayes theorem, $P(B|A)$ is called the likelihood. The likelihood is $P(B|A)$ viewed as a function of $A$, not of $B$. It is not a conditional probability because it does not integrate to one. See  , or Bishop Pattern Recognition &amp; Machine Learing book p.22, "Note that the likelihood is not a probability distribution over w, and its integral with respect to w does not (necessarily) equal one."     There is a problem here, one of these three facts must be wrong, or else I do not understand something. How can the likelihood in the Bayes theorem be a conditional probability, and also not a conditional probability?  I am not sure (since I do not understand!), but perhaps an answer would be to explain how to view the Bayes equation in terms of what is variable and what is fixed, and how probabilities (and non-probabilities -- the likelihood) can combine in a "type consistent" way.  For example, is it accurate to say that in the Bayes equation $P(A|B) = \cdots$ we should regard $B$ as fixed and $A$ as variable?  And if $P(B|A)$, the likelihood, is not a conditional probability, then the form of Bayes is $$     \text{conditional probability} = \frac{ \text{other} \cdot \text{probability}  }{ \text{probability}  } $$ (or if dealing with continuous variables, $$     \text{conditional probability density} = \frac{ \text{other} \cdot \text{probability density} }{ \text{probability density} } $$ ) where "other" is the type of the likelihood (not a conditional probability density). Is there a rule that  $$    \text{other} \cdot \text{probability} = \text{probability} $$ ?  To me this seems wrong:  multiplying a probability by a thing (likelihood) with arbitrarily large values will cause the result to not integrate to 1.  Aside, I have tried to asked this question , but it was closed as a duplicate. However, I think the people deciding it was a duplicate did not understand the question, which is specifically about the likelihood appearing in Bayes theorem.  I hope this version is more clear!  Please read the whole question before marking it as a duplicate, thank you!
I have a simple question regarding "conditional probability" and "Likelihood". (I have already surveyed this question  but to no avail.)  It starts from the Wikipedia . They say this:     The likelihood of a set of parameter values, $\theta$, given   outcomes $x$, is equal to the probability of those observed outcomes   given those parameter values, that is      $$\mathcal{L}(\theta \mid x) = P(x \mid \theta)$$   Great! So in English, I read this as: "The likelihood of parameters equaling theta, given data X = x, (the left-hand-side), is equal to the probability of the data X being equal to x, given that the parameters are equal to theta". (Bold is mine for emphasis).  However, no less than 3 lines later on the same page, the Wikipedia entry then goes on to say:     Let $X$ be a random variable with a discrete probability distribution   $p$ depending on a parameter $\theta$. Then the function      $$\mathcal{L}(\theta \mid x) = p_\theta (x) = P_\theta (X=x), \, $$      considered as a function of $\theta$, is called the likelihood   function (of $\theta$, given the outcome $x$ of the random variable   $X$). Sometimes the probability of the value $x$ of $X$ for the   parameter value $\theta$ is written as $P(X=x\mid\theta)$; often   written as $P(X=x;\theta)$ to emphasize that this differs from   $\mathcal{L}(\theta \mid x) $ which is not a conditional probability,   because $\theta$ is a parameter and not a random variable.   (Bold is mine for emphasis). So, in the first quote, we are literally told about a conditional probability of $P(x\mid\theta)$, but immediately afterwards, we are told that this is actually NOT a conditional probability, and should be in fact written as $P(X = x; \theta)$?   So, which one is is? Does the likelihood actually connote a conditional probability ala the first quote? Or does it connote a simple probability ala the second quote?  EDIT:  Based on all the helpful and insightful answers I have received thus far, I have summarized my question - and my understanding thus far as so:    In English, we say that: "The likelihood is a function of parameters, GIVEN the observed data." In math, we write it as: $L(\mathbf{\Theta}= \theta \mid \mathbf{X}=x)$. The likelihood is not a probability.  The likelihood is not a probability distribution.  The likelihood is not a probability mass. The likelihood is however, in English: "A product of probability distributions, (continuous case), or a product of probability masses, (discrete case), at where $\mathbf{X} = x$, and parameterized by $\mathbf{\Theta}= \theta$." In math, we then write it as such: $L(\mathbf{\Theta}= \theta \mid \mathbf{X}=x) = f(\mathbf{X}=x ; \mathbf{\Theta}= \theta) $ (continuous case, where $f$ is a PDF), and as $L(\mathbf{\Theta}= \theta \mid \mathbf{X}=x) = P(\mathbf{X}=x ; \mathbf{\Theta}= \theta) $ (discrete case, where $P$ is a probability mass). The takeaway here is that at no point here whatsoever is a conditional probability coming into play at all.  In Bayes theorem, we have: $P(\mathbf{\Theta}= \theta \mid \mathbf{X}=x) = \frac{P(\mathbf{X}=x \mid \mathbf{\Theta}= \theta) \ P(\mathbf{\Theta}= \theta)}{P(\mathbf{X}=x)}$. Colloquially, we are told that "$P(\mathbf{X}=x \mid  \mathbf{\Theta}= \theta)$ is a likelihood", however, this is not true, since $\mathbf{\Theta}$ might be an actual random variable. Therefore, what we can correctly say however, is that this term $P(\mathbf{X}=x \mid \mathbf{\Theta}= \theta)$ is simply "similar" to a likelihood. (?) [On this I am not sure.]   EDIT II:  Based on @amoebas answer, I have drawn his last comment. I think it's quite elucidating, and I think it clears up the main contention I was having. (Comments on the image).    EDIT III:   I extended @amoebas comments to the Bayesian case just now as well:
What are the grammatical rules determining whether to use which or what?  I usually go by intuition. It's "What car are you looking at?" and "What bicycle do you like most?" but "Which song did you sing?" Quite often, I don't know whether to use what or which.  How can I tell? Pretty sure that my edit was correct but it was rejected? How to shop for mortgage rates ? I have already been prequalified with 3.8% (but I am sure I can do better :)). Now, I am about to make an offer on a house. So, once the seller accepts my offer, how do I rate shop ?    Do I need to do the rate shopping before making an offer, or after the seller accepts my offer ?  When the seller accepts my offer, then I will go to a banker and submit a full application, so will it be legally binding for me to go with the approved mortgage application ?  Or, once the seller accepts my offer, may I simultaneously apply for a mortgage with 3-4 bankers, and then choose the lowest rate ?     I asked my realtor, but she recommends to go with just one banker (her friend), and not to do any rate shopping. Is it the right way ?   (I live in a state of Arkansas, so I am thinking of going with the local bankers) Missing files (basic sty files) when TEXINPUTS is set Below is my files tree:  .../Doc/Tex/book.tex .../Doc/Tex/images/im.jpg .../Doc/TexBase/myTemplate.sty .../Doc/TexBase/baseImages/logo.jpg   On Windows it was enough to set TEXINPUTS evironment variable with some paths and then I was able to compile with:  pdflatex Tex/book.tex   my document book.tex which uses package myTemplate.sty And now im trying to do teh same on Ubuntu 18.04. When i move all things to one folder (book.tex and myTemplate.sty and folder with images) then compilation is succesfull. But i would like to keep my foder structure as it is more clearly. So i tried to export TEXINPUTS:  export TEXTINPUTS=.:./TexBase/   but my compilation fail because of unfound many sty-files wchich are part of texlive-latex-extra that i already installed. When i UNSET this variable - it compiles ok. So my question is: Am i correctly set TEXINPUTS variable? Maybe i should add some other paths? What is the path to those "latex basic STY files"? Inequality involving Euler-Mascheroni constant I would like to solve the following problem from 'Real Analysis and Foundations' by S. Krantz.  Let $a_n = 1+\frac{1}{2} + \frac{1}{3} + \cdots + \frac{1}{n} - \log{n}$ and $\gamma$ be the Euler-Mascheroni constant. Show that $$\vert a_n - \gamma \vert \le \frac{C}{n}$$ for some universal constant $C&gt;0$.  I have no clue how to solve this problem. From searching various sites it seems that $C=\frac{1}{2}$ but I am not sure with this, too. Thanks in advance. How can I know when my screen was locked last time? Exist a log where I can look for that information? I want to know last days when my PC automatically locked the screen because was idle. How can I randomize order of elements in a list? I wrote a simple backup script which back ups my stuff on a remote server, everything is working great but I'd like to have some sort of report like "backup successful or not".  this is my script   # backup CHECK date1=`date +"%d.%m.%y - %H.%M"` host=`hostname` twdate=`date +"%d.%m"` performtw=`ls -la|grep "tw"|grep "$twdate" &gt; tmp1.txt` echo $performtw if cat tmp1.txt|grep "tw" then echo backup successfull printf "tw backup success!" | mail -s "tw backup check $date1 repor$ rm tmp1.txt else echo backup failure printf "sitename backup failure!" | mail -s "site backup check $date1 repor$ rm tmp1.txt fi exit   But this isn't working really well and I ask you if there's some simpler and more powerful way to do it? Basically it just needs to check if file exists with the name starting xyz and was created at date xyz. Request root privilege from within a script Calculate the area on a sphere of the intersection of two spherical caps Given a sphere of radius $r$ with two spherical caps on it defined by the radii ($a_1$ and $a_2$) of the bases of the spherical caps, given a separation of the two spherical caps by angle $\theta$, how do you calculate the surface area of that intersection?   To clarify, the area is that of the curved surface on the sphere defined by the intersection. At the extreme where both $a_1,a_2 = r$, we would be describing a spherical lune.   Alternatively define the spherical caps by the angles  $\Phi_1 = \arcsin(a_1/r)$ and $\Phi_2 = \arcsin(a_2/r)$. Multiple authors in one row with refmark, multiple affiliations in separated columns in another row I wonder how we can list author names in the following format in LaTeX.   I have 5 authors with 3 different affiliations. I am trying to list all author names with refmark in one row, and 3 affiliations with refmark in another row, but each in one separated column. It should look like this:          author1{1} author2{2} author3{1} author4{2} author5{3}            {1}department      {2}department        {3}department               school              school              school               email                email              email   I did saw some papers that have the above format, but cannot search for any guideline. IEEE guideline suggests another way to list authors, but sadly it does not look that neat          author1{1} author2{2} author3{1} author4{2} author5{3}                         {1} department, school                               email                         {2} department, school                               email                         {3} department, school                               email Pacman option to assume "yes" to every question? When installing software in debian systems we can put something like this:   sudo apt-get install -y chromium-browser  that way the installation occurs automatically, whitout asking to confirm installation [Y/n]. Can i do the same with pacman? Countability of disjoint intervals According this problem/solution set from an MIT class (http://ocw.mit.edu/courses/mathematics/18-100c-analysis-i-spring-2006/exams/exam1_sol.pdf), the assertion:  "Every collection of disjoint intervals in R is countable."  is True, because "every interval contains a rational number", and the rationals are countable.  It seems to me this should be False, with possible counterexample:  { [x,x] | x is an element of R}  ie the set of all singelton intervals on R. Why isn't this a valid counterexample? Random forest regression not predicting higher than training data I've noticed that when building random forest regression models, at least in R, the predicted value never exceeds the maximum value of the target variable seen in the training data. As an example, see the code below. I'm building a regression model to predict mpg based on the mtcars data. I build OLS and random forest models, and use them to predict mpg for a hypothetical car that should have very good fuel economy. The OLS predicts a high mpg, as expected, but random forest does not. I've noticed this in more complex models too. Why is this?   &gt; library(datasets) &gt; library(randomForest) &gt;  &gt; data(mtcars) &gt; max(mtcars$mpg) [1] 33.9 &gt;  &gt; set.seed(2) &gt; fit1 &lt;- lm(mpg~., data=mtcars) #OLS fit &gt; fit2 &lt;- randomForest(mpg~., data=mtcars) #random forest fit &gt;  &gt; #Hypothetical car that should have very high mpg &gt; hypCar &lt;- data.frame(cyl=4, disp=50, hp=40, drat=5.5, wt=1, qsec=24, vs=1, am=1, gear=4, carb=1) &gt;  &gt; predict(fit1, hypCar) #OLS predicts higher mpg than max(mtcars$mpg)       1  37.2441  &gt; predict(fit2, hypCar) #RF does not predict higher mpg than max(mtcars$mpg)        1  30.78899 I have just fitted a new screen to my iPhone 5s, and i need to restore it to factory settings.  One problem though, it's disabled for over 23,000,000 minutes and the home button doesn't work.  Does anyone know how I can restore it? When did the 5-foot square/hex become the standard unit of measurement in Dungeons & Dragons? How do I get the local machine name? How to force Logger.debug output in Play! framework specs2 tests? Design Review: 3.3V Logic to 12V Logic (Uni-directional and Bi-directional) I'm looking for feedback and improvements on my design below. Specific questions are at the end. I created this as an attempt to answer my own, . From my feedback there, it seems like I needed to be more clear in my requirements. These are screenshots from Eagle. If there's a better way to share, please let me know so I can correct it. Entire board  The overall purpose of this board is to translate between 12V logic, and 3.3V logic. The top portion of the board represents the 12V side. The LEDs are placeholders to indicate whether the 12V signal is HIGH or LOW. In practice, these would be replaced with more , requiring up to 3A. The switches are also placeholders, allowing one to manually turn the 12V signal on and off. They are only for test purposes, the &quot;real&quot; 12V signal would be coming as the output from other relays. The bottom half is the 3.3V side. This will be connected to a  (BBB). The board will connect to 2 output GPIO pins and 2 input GPIO pins of the BBB. Overall, I want to translate the 3.3V I/O from the BBB to the 12V signals on the other side (to control more relays and read their signals). I have designed 3 modules to control both directions individually, and together. 3V3_TO_12V Module  This module converts the 3.3V GPIO output from the BBB to a 12V signal on the other side. When the 3.3V signal is low, the 12V signal is low. When the 3.3V signal is high, the 12V signal is high. To do this, the 3.3V GPIO output is connect to a , which turns a  relay on and off. This switches the 12V power as output of the module to be used elsewhere. 12V_TO_3V3 Module  This module converts a 12V signal to 3.3V signal, to be read by a GPIO input from the BBB on the other side. When the 12V signal is low, the 3.3V signal is low. When the 12V signal is high, the 3.3V signal is high. To do this, the 12V signal simply turns a  relay on and off. This switches the 3.3V power to be read as input by the BBB. DUAL_12V↔3V3 Module  This module combines the previous two modules to create a bidirectional translation. If the 12V side is high, the 3.3V input to the BBB GPIO should be high. If the 3.3V output from the BBB GPIO is high, then the 12V side should be high too. It's similar to a logical OR, if either side is high, the corresponding signal on the other side should be high too. A single 12V signal has to be split into individual input and output signals on the 3.3V side for the BBB. Questions  Is the  and  relay combination overkill for having the BBB GPIO output control the 12V power line? I like the isolation and safety it provides, but it seems too much (in terms of cost and board space) Is there a better solution for the 12V to 3.3V conversion. I like the simplicity of the  relay switching a 3.3V signal, but it takes up lots of room. Does the DUAL_12V↔3V3 Module (which combines each translation direction) even make sense? This seems wasteful to use 2 relays and a high side driver, but I haven't found simpler solution that achieves the same result. Should I add pulldown resistors for the BBB GPIO inputs, or are the internal pulldown resistors good enough?  Any other feedback is welcome. I'm new to electronic design. Fibonacci sequence and Euclidean algorithm's connection.