This question is related to a more symbolic formulation of the problem. Here I will post code in R I tried out so far: calcCorrSums &lt;- function (data, corrMat,  oldMean, oldVar, N) {   newData  = matrix(NA, nrow(data), ncol(data))     for (i in 1:nrow(data)) {     for (j in 1:N) {        xs = 0           for (k in 1:N) {         r = corrMat[j,k]         xs = xs + r * (data[i,k]-oldMean[k]) / oldVar[k]       } #for k        newData[i,j] = (xs  + oldMean[j]) * oldVar[j]     } # j    } # for i    return (newData) }  This function generates a dataset without random errors. It is called by the function below, which after this calculation adds the random errors to each data point:  getNextStepData &lt;- function (data,corrMat, N) {    oldStat  = calcVarMeanAndVariances(data,N)    newData = calcCorrSums(data,corrMat, oldStat$m, oldStat$v, N)    newStat = calcVarMeanAndVariances(newData,N)      for (i in 1:N)  {        errVar = oldStat$v[i] - newStat$v[i]      if (errVar&lt;=0) {        stop(sprintf(&quot;Error: errVar = %f for var[%i]&quot;,errVar,i))      }       errSd = sqrt(errVar)      for (p in 1:nrow(data)) {        err = getRand(errSd)        newData[p,i] = data[p,i] + err      } #for p    } # for i      return (newData)  }  The problem is: my first simulations can replicate the structure of the correlation matrix somehow, but not close enough. So something still seems to be wrong. An example of the original correlation matrix:   0.80 0.20 0.00 0.00 0.20   0.20 0.50 0.00 0.00 0.00   0.00 0.00 0.70 0.20 0.00   0.00 0.00 0.20 0.50 0.00   0.20 0.00 0.00 0.00 0.40  Here is the correlation matrix derived from new data:    0.94  0.14  0.01  0.02  0.16    0.18  0.77  0.02  0.01 -0.01   -0.02  0.04  0.85  0.14 -0.03    0.01  0.03  0.16  0.78 -0.03    0.20 -0.01 -0.02 -0.01  0.76  The simulation was done with 1000 cases ( = nrows of data). The initial data were generated with the MASS library, which could replicated the dataset almost perfect. Thank you for any help!
Assume a p x n data matrix  (e.g. p independent samples of n variables). The n variables are correlated according to a correlation matrix $\rho$. Now if you consider the data matrix as some state t (t=time)  and based on this state I would like to calculate the next timestep (t+1). Therefore the correlation matrix would be allowed to have values &lt; 1 in the diagonal, which means that the diagonal elements would indicate the influence from each variable $x_{p,i}[t]$ on $x_{p,i}[t+1]$. So I would be interested to find a function f like this: $x_{p,i}[t+1] = f(x_{p,i}[t],\rho)$ so that the p x n data matrix  consisting of the $x_{p,i}[t+1]$ replicates the $\rho_{ij}$ (except the diagonal element). f should be something like this: $x_{i,j}[t+1] = \sum_{(k=1\ldots n)}\rho_{i,k} \cdot x_{kj}[t] + e_{i,j}.$ This means specifically, I not only want to calculate a data matrix, that replicates the correlation matrix as such, but also to let each observation be depending on its own state and linear dependent on the previous state of all the intercorrelated variables of its own state. For ease one can assume that the p variables are distributed normal and $e_{ij}$ are independent and distributed with mean$(e_{i,j}) = 0 $. Then for a numerical simulation it would be interesting  to find a formula to calculate the variance/standard deviation of each of the j variables (sd($e_{[.,j]} = ?).$ Thank you for any help!
How do I use the Natural Earth SQLite DB with QGIS? I just downloaded the Natural Earth data in SQLite format from . I had assumed that this would be a SpatiaLite database, but it appears not to be! QGIS is failing to recognize it as a spatial database. OGR supposedly supports reading geometries even when stored in a plain SQLite database, but maybe QGIS doesn't use OGR for SpatiaLite?  The SQLite database does have geometry_columns and spatial_ref_sys tables. Is there some way to convert it to a full SpatiaLite database? Are the units of the quotient ring $\mathbb{F}_2[x]/\langle x^k+1 \rangle$ known in general, where $\mathbb{F}_2$ is the finite field with two elements? I'm specifically interested in the case where $k$ is divisible by two, such as say $k=8$, or $k=12$.  If so, can they be constructed easily? I'd be grateful if you could provide a few examples. I'm transitioning a Drupal 6 site to Drupal 8.1 so following the official instructions, I set up a new install in its own directory. Since this is only one site, I followed the instructions to put my database credentials in sites/default/default.settings.php after the declaration of the $databases array.  Running drush --status returns the following.  Drush version          :  8.1-dev                                           Drush temp directory   :  /tmp                                              Drush configuration    :                                                    Drush alias files      :                                                    Drupal root            :  /media/psf/Home/apps/newp                         Drupal Settings File   :  MISSING   Since this Drupal is 8.1-dev that must mean I need to upgrade it. Since this is a global install using Composer, I run composer global update.     Your requirements could not be resolved to an installable set of   packages drush/drush dev-master requires codegyre/robo ~1.0.0-beta1   Checking the drush-ops page on github doesn't show any anomalies like this nor my Google search.   What am I overlooking? "Your python3 install is corrupted" I want to upgrade from Ubuntu 16.04.5 LTS to 18.04, so ran sudo do-release-upgrade. After downloading and extracting bionic.tar.gz I get:  Can not upgrade   Your python3 install is corrupted. Please fix the '/usr/bin/python3' symlink.   I saw  and so I did sudo ln -sf /usr/bin/python3.6 /usr/bin/python3 thinking that it would be a similar problem. But that didn't work (still same error message).  I have a few python versions:  $ ls /usr/lib | grep python python2.7 python3 python3.5 python3.6  $ update-alternatives --display python3 python3 - auto mode   link best version is /usr/bin/python3.6   link currently points to /usr/bin/python3.6   link python3 is /usr/bin/python3 /usr/bin/python3.5 - priority 1 /usr/bin/python3.6 - priority 2   How do I fix python3? Are there consequences to stamps in my passport that are not from border control? Why is "women" pronounced the way it is? As far as I know, it is the only word where wo is pronounced as wee. What is the reason for this? Does it have to do with the origin of the word? bash regex with quotes? I'm using Ubuntu 13.04 and I have ASUS X550V laptop. This is my rfkill list:  0: asus-wlan: Wireless LAN     Soft blocked: no     Hard blocked: no 1: asus-bluetooth: Bluetooth     Soft blocked: no     Hard blocked: no 2: phy0: Wireless LAN     Soft blocked: no     Hard blocked: yes 3: hci0: Bluetooth     Soft blocked: no     Hard blocked: no   Before you start going: Hey, just turn on your hardware switch, dummy... my hardware switch is Fn + F2 and it works perfectly fine on my Windows boot. But, on my Ubuntu boot it does nothing... All the other Fn + F_ combos work (turn off the touchpad, screen turn off, screen brightness, sound) and they give some kind of visual indicator when I press it.  My lshw log:  *-network DISABLED                 description: Wireless interface                 product: AR9485 Wireless Network Adapter                 vendor: Atheros Communications Inc.                 physical id: 0                 bus info: pci@0000:03:00.0                 logical name: wlan0                 version: 01                 serial: 24:0a:64:28:b4:25                 width: 64 bits                 clock: 33MHz                 capabilities: pm msi pciexpress bus_master cap_list rom ethernet physical wireless                 configuration: broadcast=yes driver=ath9k driverversion=3.8.0-19-generic firmware=N/A latency=0 link=no multicast=yes wireless=IEEE 802.11bgn                 resources: irq:17 memory:f7900000-f797ffff memory:f7980000-f798ffff When he was just a professor, Dumbledore taught Transfiguration. As Headmaster what was he doing all day? In the 6th movie he was diligently looking for Horcruxes, but what about the other times?  When Fred and George pass the Maurader's Map to Harry they note that Dumbledore is pacing in his office. "He does that a lot" one of them says. Did Dumbledore just endless pace in his office as Headmaster, afraid to leave it for fear someone would know that he produced no work?   Sure, every year he had to go find a new DADA teacher, but most of those it seemed he did through correspondence. Horace Slughorn was the only one that seemed to resist. Dumbledore's 6th year may have been the only one where he earned his paycheck. How do I make an HTML text box show a hint when empty? I want the search box on my web page to display the word "Search" in gray italics. When the box receives focus, it should look just like an empty text box. If there is already text in it, it should display the text normally (black, non-italics). This will help me avoid clutter by removing the label.  BTW, this is an on-page  search, so it has no button. Parameterize an SQL IN clause Whenever my cheese gets too old and has a bit of blue/white mold on the side, I'm not sure whether I should throw it completely out or not. Is it safe to eat if I cut off the edge? Should I cut a bit off of all the sides just to be safe?  I'm particularly interested in the answer for cheddar cheese, but answers about other cheese are welcome. Solutions of $x^2 \equiv 1 \pmod N$ Who can use magic scrolls? I'm confused about who can use scrolls in 5e. In the DMG, p139 under Magic Item Categories: Scrolls, it states that:     Any creature that can understand a written language can read the   arcane script on a scroll and attempt to activate it.   This implies that anyone can try to cast a spell using a scroll. However, on p.200 in the Spell Scroll entry it states that:     If the spell is on your class's spell list, you can use an action to read the scroll and cast its spell without having to provide any of the spell's components. Otherwise, the scroll is unintelligible.   Then there is the bit about a DC 10 + scroll spell level ability check if the spell is higher than a spell slot that you can cast.     If the spell is on your class's spell list but of a higher level than you can normally cast, you must make an ability check using your spellcasting ability to determine whether you cast it successfully. The DC equals 10 + spell's level. On a failed check, the spell disappears from the scroll with no other effect.    So, which is it? Can anyone who can read a language use a scroll (like a fighter) if they make an arcana check, or just a PC with that specific spell in their spell list (only spell casters)? Playstation Plus for PS4 on multiple Console accounts? Financial proof to get a Schengen visa to France I am planning to apply for a Schengen visa to visit France. I have an attestation d'acceuil, but the visa requires I submit bank statement for the past 3 months. I can get this statement, but the problem is that my company has been paying my salary in cash for the past months, and I place the money into the account by myself.  Can I submit the following?   my accounting book (current account)  letter from the bank stating that I have money in it payslips for the past 3 months   Will that satisfy the financial requirements for the visa? Could you help me to point out the differences in the following sentences. for me both sentences imply same meaning.      The Restaurant , offers a broad range of locally caught fresh seafood,   prime steak and meat dishes      The Restaurant , offers a wide range of locally caught fresh seafood,   prime steak and meat dishes Like the title says, can a matrix in $\mathbb{R}$ have a minimal polynomial that has coefficients in $\mathbb{C}$?  I have a feeling the answer is yes because the characteristic polynomial can have coefficients in $\mathbb{C}$ and so I don't see any reason why not, I was merely asking in case there was some sneaky proof that proves that this cannot happen. Zoom in/out on click in OpenLayers 3? How to identify the process that's sending error messages to terminal?