Why can $R^2$ be negative in a multiple regression that doesn't have an intercept ($\hat{\beta}_0 = 0$)? I saw this answer () that said that $R^2$ can be negative if it's defined as $1-\frac{SSR}{SST}$. SSR is the sum of squared residuals which is defined as  \begin{align} SSR &amp;= \displaystyle\sum\limits_{i=1}^n (y_i - \hat{y}_{i})^2 \\ &amp;= \displaystyle\sum\limits_{i=1}^n (y_i - \hat{\beta_1} x_{i1}   - \hat{\beta_2} x_{i2} - \ldots - \hat{\beta_k} x_{ik}     )^2 \\ \end{align}  when theres no intercept, and SST is the total sum of squares, or   \begin{align} SST &amp;= \displaystyle\sum\limits_{i=1}^n (y_i - \bar{y})^2 \\ \end{align}  Also SSE, or the explained sum of squares, is  \begin{align} SSE &amp;= \displaystyle\sum\limits_{i=1}^n (\bar{y} - \hat{y}_i)^2 \end{align}  in the notation of my book. I just got to the section in my textbook that mentions this too and I'm confused. Why is this true?  Here's what I could work out. I know that  \begin{align} R^2 &amp;= 1-\frac{SSR}{SST} \\ \end{align}  So for $R^2 &lt; 0$, we need $\frac{SSR}{SST} &gt; 1$. Here's what I worked out:  \begin{align} SSR &amp;&gt; SST \\ \displaystyle\sum\limits_{i=1}^n (y_i - \hat{y}_{i})^2 &amp;&gt; \displaystyle\sum\limits_{i=1}^n (y_i - \bar{y}_{i})^2 \\ \end{align}  Here's the proof I tried to work out:  \begin{align} SSR &amp;&gt; SST \\ SSR &amp;&gt; \displaystyle\sum\limits_{i=1}^n (y_i - \bar{y})^2 \\ &amp;&gt; \displaystyle\sum\limits_{i=1}^n \left[ (y_i - \hat{y}_i) - (\bar{y} - \hat{y}_i)\right]^2 \\ &amp;&gt; \displaystyle\sum\limits_{i=1}^n (y_i - \hat{y}_i)^2 - 2\displaystyle\sum\limits_{i=1}^n (y_i - \hat{y}_i)(\bar{y} - \hat{y}_i) - \displaystyle\sum\limits_{i=1}^n (\bar{y}_i - \hat{y}_i)^2 \\ &amp;&gt; SSR - 2\bar{y}\displaystyle\sum\limits_{i=1}^n (y_i - \hat{y}_i) + 2\displaystyle\sum\limits_{i=1}^n \hat{y}_i(y_i - \hat{y}_i) - \displaystyle\sum\limits_{i=1}^n (\bar{y} - \hat{y}_i)^2 \\ &amp;&gt; SSR - 2\bar{y}\displaystyle\sum\limits_{i=1}^n (y_i - \hat{y}_i) + 2\displaystyle\sum\limits_{i=1}^n \hat{y}_i(y_i - \hat{y}_i) - SSE \\ 0 &amp;&gt; -2\bar{y}\displaystyle\sum\limits_{i=1}^n (y_i - \hat{y}_i) + 2\displaystyle\sum\limits_{i=1}^n \hat{y}_i(y_i - \hat{y}_i) - SSE \\ SSE &amp;&gt; -2\bar{y}\displaystyle\sum\limits_{i=1}^n (y_i - \hat{y}_i) + 2\displaystyle\sum\limits_{i=1}^n \hat{y}_i(y_i - \hat{y}_i) \\ \end{align}  This is where I get stuck. Is the proof on the right path, or is there a mistake before I got stuck? Hints would be great.  I'm starting to get why this is the case logically. SSR is the sum of the squares of the distances from the points to the regression line, while SST is the sum of the squares of the distances from the points to a line drawn through $\bar{y}$. $R^2$ is negative because $SSR &gt; SST$, which means that because we impose the limitation that the regression line MUST pass through the origin, our regression line is an even worse fit than if we just drew a horizontal line at $y =\bar{y}$ and used that. The distances from the points to the regression line are higher than the distances from the points to the line at $\bar{y}$ (ok thhe sum of squares of the distances is larger). Is that the right logic?
Negative R squared contradicts ssa/sst? I understand from this question -    that the R squared value of a linear regression model can be negative if the intercept is constrained. And this makes sense if you define R squared as -   $$R^2 = 1-\frac{SSE}{SST}$$  One says $SSE&gt;SST$. But then,  $$SST = SSA + SSE $$ Total Sum of squares  = Sum of squared errors + Sum of squared residual. And with this we get -  $$R^2 = \frac{SSA}{SST}$$ And now it is hard to imagine how $R^2$ can be negative. Aren't SSA and SST >0 always?
pkexec command in a .desktop file I made a .desktop file for Androxyde's Flashtool (utility for Sony Xperia devices that I have to open with an executable file in its folder) that requires root privileges to use fastboot utilities. I used to make it work with gksu, but I'm on Ubuntu 15.04 and gksu is now old.  I tried to modify the exec line from Exec=gksu /home/natasha/FlashTool/FlashTool to Exec=pkexec /home/natasha/FlashTool/FlashTool Then, I read about pkexec doesn't allow to run X11 applications and so I override in this way:      The problem now is: It asks me the password but the Flashtool's GUI doesn't start. BUT if I execute that command in terminal, the program starts without problems. What can I do? There is a restriction on setting your birthday:     Oops! There was a problem updating your profile:   - Birthday must be after 1920/01/01   I realize the number of 90 year old users is small, but shouldn't the restriction be a bit more relaxed, such as larger than any ?  Either 120 or 150 seems appropriate.  For example, my grandfather turns 90 next year (and just barely misses the current cutoff), but I can't imagine he's the only one around that age who is computer literate and still active enough to be interested in (the increasingly broad range of) SE sites.  I don't think he has contributed yet (mostly because of the comment restriction, I'd see him commenting before asking or answering), but I have emailed him with links that I know he's read.  Incidentally, the error message is wrong: birthday must be after 1919/12/31 and using the next day is accepted. "'key' is not valid for passed 'access_token', token not found" when trying to login using Google on Android SE app The isomorphism $\mathbb{Z}[i]/(a+bi) \cong \Bbb Z/(a^2+b^2)\Bbb Z$ is , when the integers $a$ and $b$ are coprime. But what happens when they are not coprime, say $(a,b)=d&gt;1$?      — For instance if $p$ is prime (which is not coprime with $0$) then $$\mathbb{Z}[i]/(p) \cong \mathbb{F}_p[X]/(X^2+1) \cong \begin{cases} \mathbb{F}_{p^2} &amp;\text{if } p \equiv 3 \pmod 4\\ \mathbb{F}_{p} \times \mathbb{F}_{p} &amp;\text{if } p \equiv 1 \pmod 4 \end{cases}$$ (because $-1$ is a square mod $p$ iff $(-1)^{(p-1)/2}=1$).  — More generally, if $n=p_1^{r_1} \cdots p_m^{r_m} \in \Bbb N$, then  each pair of integers $p_j^{r_j}$ are coprime, so that by CRT we get $$\mathbb{Z}[i]/(n) \cong \mathbb{Z}[i]/(p_1^{r_1}) \times \cdots \times \mathbb{Z}[i]/(p_m^{r_m})$$  I was not sure how to find the structure of $\mathbb{Z}[i]/(p^{r}) \cong (\Bbb Z/p^r \Bbb Z)[X] \,/\, (X^2+1)$ when $p$ is prime and $r&gt;1$.  — Even more generally, in order to determine the structure of $\mathbb{Z}[i]/(a+bi)$ with $a+bi=d(x+iy)$ and $(x,y)=1$, we could try to use the CRT, provided that $d$ is coprime with $x+iy$ in $\Bbb Z[i]$. But this is not always true: for $d=13$ and $x+iy=2+3i$, we can't find Gauss integers $u$ and $v$ such that $du + (x+iy)v=1$, because this would mean that $(2+3i)[(2-3i)u+v]=1$, i.e. $2+3i$ is a unit in $\Bbb Z[i]$ which is not because its norm is $13 \neq ±1$.  — I was not able to go further. I recall that my general question is to known what $\mathbb{Z}[i]/(a+bi)$ is isomorphic to, when $a$ and $b$ are integers which are not coprime (for instance $a=p^r,b=0$ or $d=(a,b) = a^2+b^2&gt;1$).  Thank you for your help! Asking users to accept answer when they comment that it answers their question Why does the symbol for the multiplication operation change shape? Why does the "$\times$" used in arithmetic change to a "$\cdot$" as we progress through education? The symbol seems to only be ambiguous because of the variable $x$; however, we wouldn't have chosen the variable $x$ unless we were already removing $\times$ as the symbol for multiplication. So why do we? I am very curious. It seems like $\times$ is already quite sufficient as a descriptive symbol. Using past tense when referencing a still-true fact Regular expression: match start or whitespace Conditionally Rendering Visualforce element based on user profile I have a controller extension and want to use the Tabbed view to get rid of the Chatter caused endless scrolling.      public class UserProfileGetter {     public UserProfileGetter(ApexPages.StandardController controller) {      String userProfileName = [select u.Profile.Name, id, UserType from User u where u.id = :Userinfo.getUserId()].Profile.Name;      system.debug('Profile===================='+userProfileName);      }    }   When I run the debug it shows my Profile as 'System Administrator' correctly.  My VF page code:  &lt;apex:page standardController="Account" extensions="UserProfileGetter" showHeader="true" tabStyle="account" &gt;   &lt;apex:tab label="Opportunities" name="Opportunities" id="tabOpp" rendered="{userProfileName!='Chatter Content'}"&gt;          &lt;apex:relatedList subject="{!account}" list="opportunities" /&gt;       &lt;/apex:tab&gt;        &lt;/apex:tabPanel&gt; &lt;/apex:page&gt;   So the logic for render I want is - if the user profile name isn't Chatter Content, render. But if I have this logic in the page it won't render for anyone, including me. Ideas? Thanks  Amending - to query other variable on the user, a checkbox called "Admin Team" to display the tab for Account Teams related list, I query for both like this:  public class UserProfileGetter {     public String userProfileName {         get {             return [                     select Profile.Name                     from User                     where Id = :Userinfo.getUserId()                     ].Profile.Name;         }     }     public boolean userAdminTeam {         get {             return [                     select Admin_Team__c                     from User                     where Id = :Userinfo.getUserId()                     ].Admin_Team__c;         }     }      public UserProfileGetter(ApexPages.StandardController unused) {     }   }   And then I use like this:   &lt;apex:tab label="Account Team" name="Account Team" id="Act" rendered="{!userAdminTeam}"&gt;   Thanks all. Do I need a transit visa to collect and re-check my luggage at Istanbul Ataturk airport? I'm Egyptian and flying to Cairo from Tbilisi, via Istanbul. The first flight Tbilisi-Istanbul is on Atlasjet, then from Istanbul to Cairo I am flying on Egyptair. For that, I have to recheck in at Istanbul to my Egyptair flight  Will I need to pass passport control at Istanbul airport to collect my bags and check in on Egyptair? Will I need a transit visa for that? Or it can be all done through neutral zone? I have a 250G disk on my Mac with around 100G in use. But the system reports only around 20G of free space. I'm using macOS 10.13.2. I have the problem at least since the upgrade to High Sierra, but probably also before.  "About This Mac" --> "Storage" reports that "System" is using around 180G. But if I check the complete disk, it looks like that:  $ sudo du -cxhd 1 /   0B    /.HFS+ Private Directory Data 1.0K    /home 4.3G    /usr 4.2G    /.Spotlight-V100 1.0K    /net  34G    /nix   0B    /.PKInstallSandboxManager   0B    /.PKInstallSandboxManager-SystemSoftware 2.6M    /bin   0B    /Network 1.1M    /sbin 3.8G    /Library   0B    /.Trashes 6.5G    /System 476K    /.fseventsd du: /private/var/db/ConfigurationProfiles/Store: Operation not permitted du: /private/var/folders/z7/[...]/0/SafariFamily: Operation not permitted du: /private/var/folders/z7/[...]/0/com.apple.LaunchServices.dv: Operation not permitted du: /private/var/folders/z7/[...]/0/com.apple.nsurlsessiond: Operation not permitted du: /private/var/folders/z7/[...]/0/com.apple.routined: Operation not permitted du: /private/var/folders/zz/[...]/0/com.apple.nsurlsessiond: Operation not permitted 8.0G    /private 8.6M    /.DocumentRevisions-V100   0B    /.vol  32G    /Users  11G    /Applications 207M    /opt 5.0K    /dev 4.0K    /Volumes   0B    /cores 104G    / 104G    total   df also says that only 20G are available:  $ df -h / Filesystem     Size   Used  Avail Capacity iused               ifree %iused  Mounted on /dev/disk1s1  234Gi  211Gi   20Gi    92% 4019132 9223372036850756675    0%   /   Any tool I was using (Finder, Disk Inventory X, etc.) shows more or less the same numbers like df and du.  Output of mount:  $ mount /dev/disk1s1 on / (apfs, local, journaled) devfs on /dev (devfs, local, nobrowse) /dev/disk1s4 on /private/var/vm (apfs, local, noexec, journaled, noatime, nobrowse) map -hosts on /net (autofs, nosuid, automounted, nobrowse) map auto_home on /home (autofs, automounted, nobrowse)   I read and tested many, many things like:         ... but with no success. So what could consume more than 100G of disk space without showing up in any tool?  Update  Running „First Aid“ in recovery mode:   What does this error message mean?  error: btn:1: invalid key order (1) oid 440198 / oxid 114577 fsroot tree is invalid.   Update 2018-01-25  Another report of the same error:  (but no answers, yet)  I'm pretty sure this file system error is the root cause for the missing disk space. But I have no idea how to fix that. I was hoping that 10.13.3 would maybe solve it, but it didn't change anything. I guess I need to reinstall... How to programmatically bind a (dependency) property of a control that's inside a DataTemplate? Pure virtual destructor in C++ I have a sprite that moves from waypoint to waypoint. It turns to face its velocity vector, but not instantly (there's a rotation speed).  The problem I'm having is, from one direction to another, the sprite will often turn in wild, unnecessary ways instead of appearing like you might expect a car to appear (turn such that the minimum delta in angle occurs).  Right now I'm using the following formula to calculate the rotation float for the current velocity:  MathHelper.PiOver2 + -Math.Atan2(anotherVector.Y - vector.Y, -(anotherVector.X - vector.X));   And then I lerp the current rotation by the new rotation by the rotation speed (10f):  rotation = MathHelper.Lerp(rotation, targetRotation, 10f * (float)gameTime.ElapsedGameTime.TotalSeconds);   But unfortunately, it's causing the sprite to spin in wild directions before reaching the correct angle. Any suggestions? Why is there a B in my flair? This was originally noticed and fixed back around the beginning of July. As of August 1, this problem seems to have returned. New bug report is here:   I just happened to notice that my SO flair has some sort of a B icon right before my username (instead of the expected site icon) Snapshot of the unknown icon:    My current (live) flair for monitoring:  It currently showing up like this for all users on all sites, but not on Combined or Meta flairs. For example Jon Skeet flair on programmers:    Live flair: $\mathbb{R}$ \ $\mathbb{Q}$ and $\mathbb{R}^2\setminus\mathbb{Q}^2$ disconnected? Arrangements of a,a,a,b,b,b,c,c,c in which no three consecutive letters are the same Q: How many arrangements of a,a,a,b,b,b,c,c,c are there such that  $\hspace{5mm}$ (i). no three consecutive letters are the same?  $\hspace{5mm}$ (ii). no two consecutive letters are the same?  A:(i). 1314. ${\hspace{5mm}}$ (ii). 174.  I thought of using the General Principle of Inclusion and Exclusion along with letting $p_i$ denote a property that.. , and doing so, I will evaluate $E(0)$, which gives us the number of arrangements without any of the properties.   How do I go about doing that? I am trying to use the method stated above in solving this question, but I am unable to generalize the properties $p_i$. Split string into sentences using regex "EOL while scanning single-quoted string"? (backslash in string) What is the difference between DX format and FX format lenses, and which to choose for what purpose? What is the difference between DX format and FX format lenses, and which to choose for what purpose?  What are the pros and cons of both?