My breath was taken away by this. I tried to run my JAGS model with different number burn-in samples but it still takes the same amout of time!!   n.iter    n.burnin    time   saved iterations per chain  2000         1000     66s                         1000  5000         4000     64s                         1000 20000        19000     62s                         1000   n.chains was 2 and n.thin was 1. So in each of the 3 model runs, I had different burn-in period, but the same second stage (n.iter - n.burnin, i.e. 1000 iterations per chain). All 3 models run for the same period of time!!! Does this mean that the burn-in phase takes zero time?  This is really a strange result, doesn't correspond to how I supposed the MCMC works. I thought that the burn-in phase is exactly the same computation process as the second stage, with the only difference that the samples are discarded.  I have used  function to run JAGS.
121796
I found out that the function jags() in the R2jags package sometimes does not remove the burn in part even with the option n.burnin=##. Here is a very simple example in R (a simple linear model):  library(R2jags)  N &lt;- 1000 y &lt;- rnorm(N) x &lt;- rnorm(N) data &lt;- list("N", "y", "x")  inits &lt;- function(){list(beta0=rnorm(1), beta1=rnorm(1), tau=1)} parameters &lt;- c("beta0", "beta1", "tau")   the model m.bug is like this:  model{ for (i in 1:N){ y[i] ~ dnorm(mu[i], tau) mu[i] &lt;- beta0 + beta1*x[i] }  beta0 ~ dnorm(0, 0.00001) beta1 ~ dnorm(0, 0.00001) tau ~ dgamma(0.001, 0.001) sigma2 &lt;- 1/tau }   using "jags()" in R2jags package like this:  m &lt;- jags(data, inits, parameters, "m.bug",    n.chains=3, n.iter=2000, n.burnin=1000, n.thin=1)   My question:  In the output of m, the posterior estimates are based on the right number of interations (1000), but if we check the traceplot (using traceplot(m)), the burnin part seems still there(e.g. the first few values for "tau" are not converged). Why?  and there is only one progress bar (uaually two, one for burn-in, one for the rest).  also, if I change n.iter=2000, n.burnin=1000 to n.iter=2001000, n.burnin=2000000  the elapsed time does not change, which is "too fast" for so many iterations.  ps. I used R version 2.15.2 and R2jags version 0.03-08
113449
As documented in the blog post , on x86 systems, Java's System.nanoTime() returns the time value using a  specific counter. Now consider the following case I use to measure time of a call:  long time1= System.nanoTime(); foo(); long time2 = System.nanoTime(); long timeSpent = time2-time1;   Now in a multi-core system, it could be that after measuring time1, the thread is scheduled to a different processor whose counter is less than that of the previous CPU. Thus we could get a value in time2 which is less than time1. Thus we would get a negative value in timeSpent.  Considering this case, isn't it that System.nanotime is pretty much useless for now?  I know that changing the system time doesn't affect nanotime. That is not the problem I describe above. The problem is that each CPU will keep a different counter since it was turned on. This counter can be lower on the second CPU compared to the first CPU. Since the thread can be scheduled by the OS to the second CPU after getting time1, the value of timeSpent may be incorrect and even negative.
39640
Page 146 of the PHB has the table for getting in and out of armour (1 to 5 minutes to doff, depending on the type).  Now the Heat Metal (PHB pg. 250) says;     Choose a manufactured metal object, such as a metal weapon or a suit of heavy or medium metal armour, that you can see within range. You cause the object to glow red-hot. Any creature in physical contact with the object takes 2d8 fire damage when you cast the spell. Until the spell ends, you can use a bonus action on each of your subsequent turns to cause this damage again. If a creature is holding or wearing the object and takes the damage from it, the creature must succeed on a Constitution saving throw or drop the object if it can.   (Emphasis mine)  I imagine a creature can't just drop a suit of armour it's wearing, otherwise what's the point of having the don/doff time rules, and it drops the object only if it fails the saving throw. Even if Heat Metal only targets one piece of the armour, the obvious choice would be the shirt/breastplate if you can see it because there's other things a creature would have to take off before that.  So, is the creature trapped in their red-hot burning armour, potentially taking the extra damage for the 1 minute duration of the spell, or is there something I'm missing?  If there's strict RAW on taking armour off in less than a minute, I'll take it, but I'll happily accept answers that simply make sense provided there's an in-game time frame (1 action, 1 round, or whatever) given as well. As for the type of armour I'm just looking at whatever's in the PHB (chainmail, half plate, full plate, breastplate, chain shirt), I don't know of any specific sub-categories or the exact size and shape.  This is of course assuming the creature tries to take of it's armour, it may not give a damn and take it like a man, but from an RP perspective I reckon it would feel like a  so I'm going with "they try to get out as quickly as possible".
46312
I've come across a very good text on Bayes/MCMC. IT suggests that a standardisation of your independent variables will make an MCMC (Metropolis) algorithm more efficient, but also that it may reduce (multi)collinearity. Can that be true? Is this something I should be doing as standard.(Sorry).  Kruschke 2011, Doing Bayesian Data Analysis. (AP)  edit: for example       &gt; data(longley)      &gt; cor.test(longley$Unemployed, longley$Armed.Forces)  Pearson's product-moment correlation       data:  longley$Unemployed and longley$Armed.Forces       t = -0.6745, df = 14, p-value = 0.5109      alternative hypothesis: true correlation is not equal to 0       95 percent confidence interval:      -0.6187113  0.3489766       sample estimates:       cor       -0.1774206        &gt; standardise &lt;- function(x) {(x-mean(x))/sd(x)}      &gt; cor.test(standardise(longley$Unemployed), standardise(longley$Armed.Forces))  Pearson's product-moment correlation       data:  standardise(longley$Unemployed) and standardise(longley$Armed.Forces)       t = -0.6745, df = 14, p-value = 0.5109       alternative hypothesis: true correlation is not equal to 0       95 percent confidence interval:       -0.6187113  0.3489766        sample estimates:        cor       -0.1774206    This hasn't reduced the correlation or therefore the albeit limited linear dependence of vectors.  What's going on?  R
74911
I just installed a new chain on my 2002 Trek 2200 Road Bike.  The old chain was a Shimano 9 speed that I installed 18 months and about 5000 miles ago.  It had stretched modestly and was full of winter cruft/grime.  The new chain is a SRAM 9 speed, my first time using the gold snap ring system.  I followed instructions and made sure I have the same link count as the chain that came off the bike.  The cassette was new with the old chain, so it has about 5000 miles on it and doesn't appear to have significant wear.  After installation and a clean/wipe/lube/wipe, I took it for a 15 mile easy ride at about 15-16 mph.  It shifts perfectly and I didn't have to make any adjustments to either derailleur.  Three times, however, when putting it under stain (once on a modest hill climb, once starting from a stop sign in a fairly big gear, and once on an acceleration coming out of a sharp turn) it skipped several teeth and caused my foot to slam down hard.  On the hill, it actually hurt as I had my weight off the saddle (not really standing) and I came down hard on the inside of my thigh.  I think all three were on the right side (power train side) pedal stroke, and I don't think they were all in the same gear.  I'm pretty sure it was the rear cassette that skipped, not the front chainring, but it did happen really fast each time.  I will also say that it's not like these were the only three times I put substantial pressure on the pedals in the ride - I wasn't going hard, but I wasn't being tentative or anything.  Also, in case it's relevant, it was cold, about 40 degrees F or about 4 degrees Centigrade.    My question:  Is this going to get me hurt, or will the new chain 'settle in' over a few rides?  I searched here and pretty much got confirmation of what I had previously thought, that you always get a new chain when you get a new cassette, but you should be able to get a few chains out of each cassette.  Thanks!
103013
How is the FluentWait is different from WebDriverWait? I am using WebDriverWait having the polling interval set to : 500 miliseconds. Still, WebDriverWait returns after some delay (i.e. 2 - 3 seconds after the element load is completed)? Any opinion here?
21230
Framework: From RMT, eigenvalues have a semicircle distribution for symmetric matrices each with i.i.d normally distributed entries as the size of the matrix grows. The restrictions on i.i.d have recently been shown to not matter so we can proceed nevertheless. Example: If we take a covariance matrix of all stock tickers beginning in A comparing the average daily return over a period of time (or any process with no underlying relation), with each entry we can assume lognormal distribution forming a, lets say, 10000 by 10000 symmetric matrix. Over a duration of time we get a sequence of such matrices. Each of the entries we assume to be i.i.d since the stocks have 'nothing' to do with each other (although a weaker results holds for non-i.i.d entries). Now this series of matrices forms a chain of covariance matrices tending towards the underlying covariance matrix of the entire history of the stocks (if we sampled correctly). Random Matrix Theory implications: We known from RMT that once we decompose these matrices into their eigenvalues, the eigenvalues tend to the semicircle distribution. Since this distribution is continuous, there's a spread in results i.e. there is some underlying variance to the eigenvalue decomposition of covariance matrices. Conclusion: Thus when we use covariance matrices shouldn't there be some sort of hypothesis test that's able to filter out this underlying distribution, similar to comparing normal distributions where we need to account for variance when comparing two mean values. This would be dependent on how i.i.d the random variables are, the size of the matrix, the number of samples taken, and the mean/variance of the random variables themselves. What would be weird about this hypothesis test is that we'd expects as $n$ gets larger so does the error bound, captured by the asymptotic relationship between the size and convergence to the semicircle distribution. TLDR: Is there some sort of hypothesis testing for PCA, or any eigenvalue method, that filters out the underlying tendency of random matrices to share similar eigen-distributions? Similar to how when you compare the mean of two normal distributions you need to perform a hypothesis test to account for the variance. Edit - Solution: I found this paper  which seems quite promising although it'll take a few days for me to fully understand. It seems like this is an on-going area of research. Any further comments or recommendations are always appreciated.
19386
I place leaves on my trees with emitter particle systems. Then, to make a forest, I place those trees with another emitter (or hair) particle system.   Problem is particles of particles don't work, I only get the trunks without leaves in my forest.  Following this question : , which solution takes ages (I use about 500 000 leaves per tree), I tried to write a python script, but comes to the same problem. Searching on google, I found Brecht saying it comes from the naming of object (leave.001, leave.002 .... leave.500000) which after 1000 iterations becomes pretty slow and after 10000 extremely slow (so naming 2000 object is much slower than twice the time of naming 1000 of them). Anyway, that step is useless, blender needs one big mesh with all leaves to allow instancing it, not 500000 objects with one linked mesh.  So question is how can I convert all the particles to one unique object in one step (or at least avoid it to take 28 hours every time) ?
32432
Somehow I happened to swap out 14 GB of memory. After having killed the culprit, I have tons of free memory again, so I thought I could  again. So with 5 GB out of 32 GB used and 14 GB of swap space used, I ran swapoff -a.... and 4 hours later about half of the work was finished.  This means less that 1 MB/s, while I can easily copy 200 MB/s. My swap is encrypted but so are all normal partitions and with  it leads to no noticeable CPU load (and filling the swap space took only a few minutes). I see that there's no special reason to optimize swapoff, however I wonder how it could get that slow?    Just adding some more data: My main memory is 32 GB and I have 32 GB swap space on each of 4 harddisks (surely an overkill, but who cares?). The whole swap space can be  (decrypted and) read in less than 5 minutes:  time -p sudo sh -c 'for i in /dev/mapper/cryptswap?; do md5sum $i &amp; done; wait' 014a2b7ef300e11094134785e1d882af  /dev/mapper/cryptswap1 a6d8ef09203c1d8d459109ff93b6627c  /dev/mapper/cryptswap4 05aff81f8d276ddf07cf26619726a405  /dev/mapper/cryptswap3 e7f606449327b9a016e88d46049c0c9a  /dev/mapper/cryptswap2 real 264.27   Reading a part of a partition can't be slower than reading it all. Yet reading about 1/10th of it takes about 100 times longer.  I observed that during swapoff both the CPU was mostly idle (maybe 10% of one core) and so were the disks ("measured" by the LEDs). I also saw that the swap spaces were turned off one after the other.
118208
How to assign a different color / material to each inflow object in one simulation (bake)?    In the following example we tried to mix two inflows and experience the mixing between the two fluids. However, as bake starts there is only one domain object as fluid (object!) which does not respect color / material assigned to inflow objects!
45283
Is there a reason, beyond historical reasons, that three phases has become the dominant number of phases?  I am aware of the advantages against one phase and two phase, namely the reduced amount of conductor needed, and that motors can provide torque when stalled (and less pulsation).  Is this solely due to diminishing returns, with only a small increase in smoothness of torque application, at the cost of increased complexity (increased number of wires (albeit of smaller CSA)).  To be clear, the phases are all evenly distributed, that is, five phases separated by 72 degrees.
116483
I am new to MCMC and reading a  regarding Gibbs sampling. However, there are two parts in the paper I cannot understand and get stuck. The first part is equation 2.3 in page 168. It says that if $X^{'}_{j}$ is drawn from the process of Gibbs sampling, $X^{'}_{j}\sim f(x|Y^{'}_{j}=y^{'}_{j})$. It further claims under &quot;general conditions,&quot; the distribution of $X^{'}_{j}$ converges to $f(x)$ as $n\rightarrow\infty$. Can anyone help explain what these general conditions are and why/how this statement is true. The second part is at the beginning of page 169, expression 2.9 says $\hat{f(x)}=\frac{1}{m}\sum^{m}_{i=1}f(x|y_{i})$, and the theory behind this equation is $E[f(x|Y)]=\int f(x|y)f(y)dy$. This confuses me because my understanding about monte carlo integration is that for example, $E[X]=\frac{1}{m}\sum^{m}_{i=1}X_{i}$ is true due to the law of large number that $\frac{X_{i}}{m}$ converges to $X_{i}\times p(X_{i})$ when $m\rightarrow\infty$. However, I don't see how equation 2.9 can be explained by the concept of monote carlo integration. Can anyone explain the intuition or math behind this equation? Thanks! EDIT 1 (My Answer/Thought for Part 2) I have thought about this question, and since no one responds yet, I will try my answer first and see whether someone has a better explanation. For the second part, instead of using $f(x|y_{i})$, let's focus on the density of a specific value $x^{a}$, which is $f(x^{a}|y_i)$. For simplicity, now assume $y_i$ is randomly drawn from a density $f(y)$ instead of $f(y|x_i)$ but the result could be generalized to $f(y|x_i)$. Both $f(x|y_i)$ and $f(y)$ are know distribution. Now we first randomly draw a $y_i$ from $f(y)$ and once we have $y_i$, we further randomly draw a $x_i$ from $f(x|y_i)$. Suppose we do this process $n$ time, and $n\rightarrow\infty$. Given a specific $y^{a}$ and $x^{a}$, we do know the value of $f(x^{a}|y^{a})$, which is just the density of $x^{a}$ cnditional on $y^{a}$. In other words, by Monte Carlo integration, for a given set of $y_i$'s and $x^{a}$, we can dervive that $\frac{1}{n}\sum^{n}_{i=1}f(x^{a}|y_i)\approx\int f(x^{a}|y_i)f(y_i)dy_i=\int f(x^{a}|y)f(y)dy=\int \dfrac{f(x^{a},y)}{f(y)}f(y)dy=\int f(x^{a},y)dy=f(x^{a})$ We can do the same process to dervie $f(x^{b})$, $f(x^{c})$, and etc. In the end, we will have $f(x^{a})$, $f(x^{b})$, $f(x^{c})$, ..., which all together constrcut $f(x)$. Therefore, $\hat{f(x)}=\frac{1}{m}\sum^{m}_{i=1}f(x|y_{i})$.
30106
My script takes separate 3D feature classes, calculates a field, appends to a target feature class, and then deletes the originals. This is a huge data processing task of over 4700 mass point feature classes appending to a single one. I know it was a big mistake to put so many feature classes into SDE, but given they're in there now, I've got to deal with them there (yes, the sheer fc count is bringing SDE performance to its knees--hence my urgency).  Early on it worked great, in that the merged result showed valid z-values. I was able to build a terrain and it looked great. I'd been running this in the background for weeks, and have just noticed z-values of 0 in the output, where the originals were not 0! Oh no!!! I'm certainly glad I still have the file-based originals!  Pseudocode:     An in_memory feature class is created from a z-aware template      For each fc in the feature dataset:            It is appended to the empty in_memory fc          The TILE_ID field is calculated using a portion of the name of the source fc           It is then appended to the target SDE fc          The in_memory feature class is emptied          Each processed fc is then deleted     When I initially posted, I was curious if it was my use of in_memory that caused this trouble. I had not initially been using it, and only switched to it because performance was far too slow otherwise, and WAY faster in_memory. To find where trouble started, I ran the Add XY Coordinates tool, which proved the trouble started with in_memory use. At that time I had also switched from CalculateField_management to da.UpdateCursor, so that's likely the bigger reason for the performance enhancement. I will now change my code to avoid in_memory.
4146
I need to get execution time in milliseconds.  I originally asked this question back in 2008. The accepted answer then was to use  However, we can all agree now  that using the standard  API is more appropriate. I am therefore changing the accepted answer to this one.
84214
The circuit is an altered Joule Thief of my design that is driven by an AA or AAA battery. I’m observing the current at the battery anode with my DMM in series. (Extech EX330) This circuit is extremely efficient (In relation to other Joule Thief I've build.) and does some weird stuff - like, it needs a pushbutton sometimes.    Measurements: It is drawing 9.21 mA DC and 6.48 mA AC in series with the battery. It shows 1.364 VDC and 0.010 VAC in parallel with the battery. Output on the LED is 2.572 VDC and 0.011 VAC with no measurable frequency. (with my DMM at least) All measurements are taken with the same configuration and voltage.    But how is it drawing AC and DC and how do I calculate power consumption? --> Could it be because the emitter pin of the NPN is directly connected to ground? --> Or is the circuit just "switching on and off"?     Download schematic:  (I tried to simulate the circuit in LTspice. Thanks for making me aware of this amazing program, Sredni Vashtar!)     What the pushbutton is used for: The pushbutton is used to "kickstart" the oscillation when it wont start by itself. For example: I have to manually "oscillate" using this button to start the circuit if the capacitor is too big and battery voltage is low. Pushing the button releases the energy in the transformer into the capacitor. If it reaches LED forward voltage the circuit keeps oscillating on it's own. It does work without manual intervention when then capacitor in parallel with the LED is not too big, like &lt;5000 µF, and it's a fresh battery.    . Thank you for your answers! I'm learning so much! :D
47015
recently wrote an  on  in collisionless , where at least one topic discussed confused me.  Besides discussing the issue of how a process can be microscopically  and macroscopically , he mentions something regarding a "entropy-preserving relaxation mechanism" that is irreversible.  Am I missing something?  I think the article is suggesting that something can preserve entropy but still be irreversible.  This begs the following questions:   Are  and irreversibility synonymous? Or are they distinct entities each with their own fundamental properties?
91762
I want to duplicate particle system(shift D), and make different Render objects. But after i change Object, it makes the same change in both particle systems ( original and duplicated). Somehow it's still linked.. ?