Say I have 300 samples from a population containing two groups, A and B, and data for several variables. I have 150 from Group A and 150 from Group B. However, I know that Group A makes up roughly 20% of the population and group B makes up 80% and the two groups differ on the variables in question.  Is there a way to weight the PCA by cases to make it more representative of the population?  Would it be enough to just to do a weighted standardization?
After some searching, I find very little on the incorporation of observation weights/measurement errors into principal components analysis. What I do find tends to rely on iterative approaches to include weightings (e.g., ). My question is why is this approach necessary? Why can't we use the eigenvectors of the weighted covariance matrix?
I don't know what exactly it's called, by cache refresh I mean, refresh the page after clearing its cache. I don't want to clear the entire browser cache.  I can't seem to cache refresh my pages. In Firefox, I know it to be Shift+Refresh.  In Chrome, I've tried Ctrl+R, Ctrl+Refresh, Alt+Refresh, Shift+Refresh but none of them work. I'm wanting to parse a string into a nullable int in C#.  ie. I want to get back either the int value of the string or null if it can't be parsed.  I was kind of hoping that this would work  int? val = stringVal as int?;   But that won't work, so the way I'm doing it now is I've written this extension method  public static int? ParseNullableInt(this string value) {     if (value == null || value.Trim() == string.Empty)     {         return null;     }     else     {         try         {             return int.Parse(value);         }         catch         {             return null;         }     } }      Is there a better way of doing this?  EDIT:  Thanks for the TryParse suggestions, I did know about that, but it worked out about the same.  I'm more interested in knowing if there is a built-in framework method that will parse directly into a nullable int? What can a wizard take instead of a familiar at 1st level? The familiar is brilliant feature for a wizard, but not for a prestige multiclassing one. Such a wizard stops upgrading his familiar once getting off the main road. So if he still wants to utilize his familiar, he should take the obtain familiar feat, but this would made the basic familiar feature redundant.  So what options can a wizard take instead of gaining a familiar at 1st level? Can hypercomputation compute the impossible? There are things which are illogical/logically impossible (like saying that 2+2=4 and 2+2=5. Without changing anything in the axioms of mathematics or logic, this would be a contradiction and would be inconsistent and illogical/logically impossible.   There are other types of logic systems apart from classical logic, like paraconsistent logics or even trivialism, that allow these contradictions to occur, prove them as right and work with them.   We can make a paraconsistent or trivialist system and work with it. For example, with trivialism, in theory, we would be able to derive and state everything we would want (since literally everything, even including illogical/logically impossible inconsistencies and contradictions), but we as humans (or as brains), are limited and can't conceive everything we want (at least to what I know). Therefore, no matter how many trivialist models we create and how much time we would work with them, we would never find or conceive many illogical/logically things because they are just that: impossible. There are impossible things to describe and conceive. For example, Russel's set is the set of all sets that do not contain themselves. If Russel's set contains itself, then it cannot contain itself, since it only contains sets that don't contain themselves. But if Russel's set does not contain itself, then it must contain itself, since it contains all sets that don't contain themselves.  There are quite a few logic bombs like this. You cannot ever compute the contents of Russel's set, and there are more formal, mathematical ways to present it. All of them have in common that you can't actually compute what the set is, whether you do it by hand, in your head, or on a computer. It's just a statement that cannot be fully logically processed.  If you take every possible state the human brain can be in, none of them include the computation of Russel's Set's contents. That is, not only can the contents not be computed, they cannot even be represented. No stimulus can cause us to comprehend Russel's Set, since such comprehension is not possible to begin with. It does not have a solution. Even if we try to solve it using trivialism, we would just be able to write a solution that does not make sense and prove it has sense and it is the real solution, but we could not be able to have a solution that would make sense "outside" the realm of trivialism (for example in classical logic), even though, using trivialism, we could prove that such solution would have sense in whatever context and logic system.   But what about hypercomputational machines (for example oracle-like machines)? I've read about some models of hypercomputation which are compatible with paraconsistent or trivialism logics. I've also read there are some models of hypercomputation (particularly those oracle-like models which use a black box) where, essentially, the hypercomputer is an algorithm that cannot exist. It might be because such an algorithm is fundamentally forbidden by logic itself (which is hided in a black box). Would any of these be capable of computing/"conceiving" these impossible things I wrote before? Do you know of anything that would help? I'm looking for some help disproving an answer provided on a  I posted about computing the number of double square combinations for a given integer.    The original question is from the Facebook Hacker Cup       Source: Facebook Hacker Cup   Qualification Round 2011      A double-square number is an integer $X$   which can be expressed as the sum of   two perfect squares. For example, 10   is a double-square because $10 = 3^2 + 1^2$.   Given $X$, how can we determine the   number of ways in which it can be   written as the sum of two squares? For   example, $10$ can only be written as $3^2 + 1^2$   (we don't count $1^2 + 3^2$ as being different). On the other hand,   $25$ can be written as $5^2 + 0^2$ or as   $4^2 + 3^2$.      You need to solve this problem for $0 \leq X \leq 2,147,483,647$.      Examples:      $10 \Rightarrow 1$      $25 \Rightarrow 2$      $3 \Rightarrow 0$      $0 \Rightarrow 1$      $1 \Rightarrow 1$   In response to my original question about optimizing this for F#, I got the following response which I'm unable to confirm solves the given problem correctly.       Source:       Again, the number of integer solutions   of $x^2 + y^2 = k$ is four times the   number of prime divisors of $k$ which   are equal to $1 \bmod 4$.      Knowing this, writing a program which   gives the number of solutions is easy:   compute prime numbers up to $46341$ once   and for all.      Given $k$, compute the prime divisors of   $k$ by using the above list (test up to   $\sqrt{k}$). Count the ones which are   equal to $1 \bmod 4$, and sum. Multiply   answer by $4$.   When I go through this algorithm for $25$, I get $8$ which is not correct.          For each prime factor (pf) of $25$ ($5$, $5$ are prime factors of $25$)         if pf % $4$ = $1$ (true for both $5$'s), add $1$ to count      return $4$ * count (count would be $2$ here).          So for $25$, this would be $8$ I'm making a mini game (bomb squad) and the armor needs to be enchanted. I know that armor can be enchanted through command blocks and that is what I intend to do. I am wondering if it is possible to enchant armor twice in one command block or should I need multiple command blocks as I have done in the past? Size of files in Windows OS. (It's KB or kB?) One "kilobyte" (KB) is 1024 bytes in JEDEC-standard, whereas the definition has shifted, in most contexts, to mean 1000 bytes (kB) in accordance with SI. To resolve this difference, binary prefixes (kiB) are used.  So we have 3 choices for using prefixes - JEDEC, IEC (both in Binary), and Metric (in Decimal).  My questions are-   What prefix standard does Windows use in showing the file size? (surely it's not IEC standard) Why does Windows OS show sizes of files in KB (using a capital alphabet "K") when it's a small alphabet "k" for a Kilo in SI units?   A capital "K" represents Kelvin in SI system of units.  Am I missing something here in understanding? Question : $$\begin{align}a+b+c &amp;= 0\\ a^3 +b^3 +c^3 &amp;= 12\\ a^5 +b^5 +c^5 &amp;= 40\end{align}$$ Then , $a^4 + b^4 + c^4 = ?$  My try : As a common perspective I just went to find any trick related to it and my first step is as usual as a common man will think $3abc = 12$ and got $abc = 4$ After that I am unable to link it with any other equation Why CTRL + C multiple times I have recently noticed that I press CTRL + C more than once, even if I know that the file has been copied to the clipboard. But I press CTRL + X or CTRL + V only once.   Why do I do this? Is this only a problem for me, or is anybody else is facing it too? How can I determine the list of files in a directory from inside my C or C++ code?  I'm not allowed to execute the ls command and parse the results from within my program. Ubuntu with spyware? Richard Stallman states that Ubuntu "has installed surveillance code". See:   Is this true?   I agree with him that "Any excuse Canonical offers is inadequate....". Matching exact string with JavaScript How can I test if a RegEx matches a string exactly?  var r = /a/; r.test("a"); // returns true r.test("ba"); // returns true testExact(r, "ba"); // should return false testExact(r, "a"); // should return true I am a British national living in Spain and my passport is either lost or stolen. I noticed this two days ago when I was intending to take a trip to Salzburg. As it happens, I managed to travel using my UK Driver's Licence. I think a severe mistake was made, as was pointed out to me in Austria, but as they were Schengen Countries, apparently all that is needed is a proof of identity, not a 'travel document'.  My question, therefore, is this. I have business trips over the next three weeks taking me from Spain to Germany, Czech Republic, Austria, and Italy, then back to Germany, and then to the UK. If I obtain an Emergency Passport from the Consulate here in Barcelona, would this be valid as an identity document within Schengen, before I eventually 'cash it in', so to speak, as a travel document when I make my trip from Germany to the UK?  I am hoping so, as I don't fancy my chances of getting back to the UK in time to secure an appointment for a fast-track passport. I am going to call the consulate tomorrow, but would appreciate any advice or prior experience. How to write file into another In my  I was printing a double using cout that got rounded when I wasn't expecting it.  How can I make cout print a double using full precision? User group (company) page that shows summary of all user accounts belonging to the same company/user group How can I show that $x+y=z$ in the figure without using trigonometry? I have tried to solve it with analytic geometry, but it doesn't work out for me. UK Visa in an expired Nigerian passport - what to use? "Give him a box that everyone knows what it contains." "Give him a box that everyone knows what it contains."  Is this correct English? It sounds wrong to me. C# datetime parse issue