I have the code below which trains ARIMA models for a range of order combinations. I'm getting the error below in the step training the ARIMA models.  The code worked just fine with the hsales time-series provided for Hyndman's text book in the "fpp" package in R. If anyone can point out the issue or suggest how to solve it, I would be grateful.  Code:  library("forecast") library("tseries") library("sqldf") library("manipulate") library("dplyr") library("xts")  tsTrain &lt;- tsTrain tsTest &lt;- tsValidation  pvar&lt;-1:17 dvar&lt;-1:2 qvar&lt;-1:17  ##Creating All Combingations  OrderGrid&lt;-expand.grid(pvar,dvar,qvar)  ##Vectorize Suggestion  n &lt;- function(a,b,c) {Arima(tsTrain, order=c(a,b,c),method="ML")} mod_fit &lt;- do.call(Vectorize(n, SIMPLIFY=FALSE), unname(OrderGrid))   Error:  Error in optim(init[mask], armafn, method = optim.method, hessian = TRUE,  :    non-finite finite-difference value [3]    Data:  c(11, 14, 17, 5, 5, 5.5, 8, NA, 5.5, 6.5, 8.5, 4, 5, 9, 10, 11,  7, 6, 7, 7, 5, 6, 9, 9, 6.5, 9, 3.5, 2, 15, 2.5, 17, 5, 5.5,  7, 6, 3.5, 6, 9.5, 5, 7, 4, 5, 4, 9.5, 3.5, 5, 4, 4, 9, 4.5,  6, 10, NA, 9.5, 15, 9, 5.5, 7.5, 12, 17.5, 19, 7, 14, 17, 3.5,  6, 15, 11, 10.5, 11, 13, 9.5, 9, 7, 4, 6, 15, 5, 18, 5, 6, 19,  19, 6, 7, 7.5, 7.5, 7, 6.5, 9, 10, 5.5, 5, 7.5, 5, 4, 10, 7,  5, 12, 6, NA, 4, 2, 5, 7.5, 11, 13, 7, 8, 7.5, 5.5, 7.5, 15,  7, 4.5, 9, 3, 4, 6, 17.5, 11, 7, 6, 7, 4.5, 4, 4, 5, 10, 14,  7, 7, 4, 7.5, 11, 6, 11, 7.5, 15, 23.5, 8, 12, 5, 9, 10, 4, 9,  6, 8.5, 7.5, 6, 5, 8, 6, 5.5, 8, 11, 10.5, 4, 6, 7, 10, 11.5,  11.5, 3, 4, 16, 3, 2, 2, 8, 4.5, 7, 4, 8, 11, 6.5, 7.5, 17, 6,  6.5, 9, 12, 17, 10, 5, 5, 9, 3, 8.5, 11, 4.5, 7, 16, 11, 14,  6.5, 15, 8.5, 7, 6.5, 11, 2, 2, 13.5, 4, 2, 16, 11.5, 3.5, 9,  16.5, 2.5, 4.5, 8.5, 5, 6, 7.5, 9.5, NA, 9.5, 8, 2.5, 4, 12,  13, 10, 4, 6, 16, 16, 13, 8, 12, 19, 19, 5.5, 8, 6.5, NA, NA,  NA, 15, 12, NA, 6, 11, 8, 4, 2, 3, 4, 10, 7, 5, 4.5, 4, 5, 11.5,  12, 10.5, 4.5, 3, 4, 7, 15.5, 9.5, NA, 9.5, 12, 13.5, 10, 10,  13, 6, 8.5, 15, 16.5, 9.5, 14, 9, 9.5, 11, 15, 14, 5.5, 6, 14,  16, 9.5, 23, NA, 19, 12, 5, 11, 16, 8, 11, 9, 13, 6, 7, 3, 5.5,  7.5, 19, 6.5, 5.5, 4.5, 7, 8, 7, 10, 11, 13, NA, 12, 1.5, 7,  7, 12, 8, 6, 9, 15, 9, 3, 5, 11, 11, 8, 6, 3, 7.5, 4, 7, 7.5,  NA, NA, NA, NA, 6.5, 2, 16.5, 7.5, 8, 8, 5, 2, 7, 4, 6.5, 4.5,  10, 6, 4.5, 6.5, 9, 2, 6, 3.5, NA, 5, 7, 3.5, 4, 4.5, 13, 19,  8.5, 10, 8, 13, 10, 10, 6, 13.5, 12, 11, 5.5, 6, 3.5, 9, 8, NA,  6, 5, 8.5, 3, 12, 10, 9.5, 7, 24, 7, 9, 11.5, 5, 7, 11, 6, 5.5,  3, 4.5, 4, 5, 5, 3, 4.5, 6, 10, 5, 4, 4, 9.5, 5, 7, 6, 3, 13,  5.5, 5, 7.5, 3, 5, 6.5, 5, 5.5, 6, 4, 3, 5, NA, 5, 5, 6, 7, 8,  5, 5.5, 9, 6, 8.5, 9.5, 8, 9, 6, 12, 5, 7, 5, 3.5, 4, 7.5, 7,  5, 4, 4, NA, 7, 5.5, 6, 8.5, 6.5, 9, 3, 2, 8, 15, 6, 4, 10, 7,  13, 14, 9.5, 9, 18, 6, 5, 4, 6, 4, 11.5, 17.5, 7, 8, 10, 4, 7,  5, 9, 6, 5, 4, 8, 4, 2, 1.5, 3.5, 6, 5.5, 5, 4, 8, 10.5, 4, 11,  9.5, 5, 6, 11, 21, 9.5, 11, 13.5, 7.5, 13, 10, 7, 9.5, 6, 10,  5.5, 6.5, 12, 10, 10, 6.5, 2, 8, NA, 10, 5, 4, 4.5, 5, 7.5, 12,  22, 5, 8.5)
Could someone please explain the differences between the 3 fitting methods, method = c("CSS-ML", "ML", "CSS"), in Arima?  If I run the code below I get an error message, but if I specify method="ML" in Arima it runs fine.  So I was curious what the difference was between the 3 fitting methods.  Code with error:  library("fpp")  tsTrain &lt;- window(hsales,end=1989.99)  pvar&lt;-1:10 dvar&lt;-1:2 qvar&lt;-1:7  OrderGrid&lt;-expand.grid(pvar,dvar,qvar)  n &lt;- function(a,b,c) {Arima(tsTrain, order=c(a,b,c))} ModFit &lt;- do.call(Vectorize(n, SIMPLIFY=FALSE), unname(OrderGrid))   Fixed Code:  library("fpp")  tsTrain &lt;- window(hsales,end=1989.99)  pvar&lt;-1:10 dvar&lt;-1:2 qvar&lt;-1:7  OrderGrid&lt;-expand.grid(pvar,dvar,qvar)  n &lt;- function(a,b,c) {Arima(tsTrain, order=c(a,b,c),method="ML")} ModFit &lt;- do.call(Vectorize(n, SIMPLIFY=FALSE), unname(OrderGrid))
How to make a Rigid Body fall off a conveyor belt? I've created conveyor belt and and two objects with rigid body physics. But the first object won't fall and second object falls backwards.  How can I fix it? Similar to Lifepod 1993, but not it cp - cannot create regular file : permission denied I want copy to /lib/udev but gives error  cp -f /tmp/ok_pcscd_hotplug.sh /lib/udev  cp:cannot create regular file /lib/udev/ok_pcscd_hotplug : Permission denied   I am root , but I can't understand . what can I do ? Use of 'const' for function parameters How far do you go with const?  Do you just make functions const when necessary or do you go the whole hog and use it everywhere?  For example, imagine a simple mutator that takes a single boolean parameter:  void SetValue(const bool b) { my_val_ = b; }   Is that const actually useful?  Personally I opt to use it extensively, including parameters, but in this case I wonder if it's worthwhile?  I was also surprised to learn that you can omit const from parameters in a function declaration but can include it in the function definition, e.g.:  .h file  void func(int n, long l);   .cpp file  void func(const int n, const long l)   Is there a reason for this? It seems a little unusual to me. Impact of changing instances' passwords As part of a security policy, the company I work for has given me the task of changing the sa's and SQL Server Agent service accounts' passwords for several instances.  What's the possible impact of doing this? Is there anything in particular I should watch out for? Is there any whitepaper, guide or even blog post about this kind of task? What kind of 'backup' plan should I have in place in case anything goes wrong?  Any guidance is appreciated. Function pointers, Closures, and Lambda I am just now learning about function pointers and, as I was reading the K&amp;R chapter on the subject, the first thing that hit me was, "Hey, this is kinda like a closure." I knew this assumption is fundamentally wrong somehow and after a search online I didn't find really any analysis of this comparison.  So why are C-style function pointers fundamentally different from closures or lambdas? As far as I can tell it has to do with the fact that the function pointer still points to a defined (named) function as opposed to the practice of anonymously defining the function.  Why is passing a function to a function seen as more powerful in the second case, where it is unnamed, than the first where it is just a normal, everyday function that is being passed?  Please tell me how and why I am wrong to compare the two so closely.  Thanks. Topologist's sine curve is not path-connected GParted can't resize partition, but unallocated partition is available How do you set a default value for a MySQL Datetime column? How do you set a default value for a MySQL Datetime column?  In SQL Server it's getdate(). What is the equivalant for MySQL? I'm using MySQL 5.x if that is a factor. I am used to see timestamp everywhere by it's color. The recent timestamps are a little bit reddish everywhere. E.g. in Meta Stack Overflow:  Last edit:        Last seen:        But in Meta Stack Exchange they have same color everywhere even for recent time:  Last edit:        Last seen:         Please make it something like this: Syntax of Using Math Mode: Empty Lines (Beginner Question) I'm just starting to learn LaTeX. I tried typing \begin{equation*}  (math goes here)  \end{equation*}  and I got a whole bunch of errors. It seems LaTeX interpreted the empty line as the equation: when it saw nothing there, I guess it just ended math mode? It then said my other commands needed $'s so I assume that's what happened. When I typed \begin{equation*} (math goes here) \end{equation*}  everything was fine. So I'm confused. If LaTeX sees an empty line in an environment, does it just interpret this as me changing my mind, and deciding not to use the declared environment? What is the best way to get a sine wave from a square wave? Is there any way to set a MacBook Pro to not sleep when you close the lid? Let $1, \omega, \dots, \omega^{n-1}$ be the roots of the equation $z^n-1=0$, so that the roots form a regular $n$-gon in the complex plane. I would like to calculate $$ \prod_{j \ne k} (\omega^j - \omega^k)$$  where the product runs over all $j \ne k$ with $0 \le j,k &lt; n$.    My attempt so far  Noting that if $k-j = d$ then $\omega^j - \omega^k = \omega^j(1-\omega^d)$, I can re-write the product as $$ \prod_{d=1}^{\lfloor n/2 \rfloor} \omega^{n(n-1)/2}(1-\omega^d)^n$$  I thought this would be useful but it hasn't led me anywhere.  Alternatively I could exploit the symmetry $\overline{1-\omega^d} = 1-\omega^{n-d}$ somehow, so that the terms in the product are of the form $|1-\omega^d|^2$. I tried this and ended up with a product which looked like $$\prod_{j=0}^{n-1} |1 - \omega^j|^n $$  (with awkward multiplicative powers of $-1$ left out). This appears to be useful, but calculating it explicitly is proving harder than I'd have thought.  The answer I'm expecting to find is something like $n^n$.    My motivation for this comes from Galois theory. I'm trying to calculate the discriminant of the polynomial $X^n+pX+q$. I know that it must be of the form $ap^n+bq^{n-1}$ for some $a,b \in \mathbb{Z}$, and putting $p=0,q=-1$, the polynomial becomes $X^n-1$. This has roots $1, \omega, \dots, \omega^{n-1}$, so that $(-1)^{n-1}b$ is (a multiple of) the product you see above. An expression for $a$ can be found similarly by setting $p=-1,q=0$. What punctuation should follow after a list introduced by a colon? The whole department: John, Jeff, Jean, and the accountant [?] were thrown into jail. Combinatorial proof of $\sum_{i = 0}^{n} \binom{i}{r - 1} = \binom{n + 1}{r}$ and then use result to find a formula for $1^2 + 2^2 + \ldots + n^2$ How do I disable network manager permanently? I'm using Ubuntu 18.04.1 LTS. I want to disable network manager on an Ubuntu machine, because (1) I don't need it, (2) I prefer having hardcoded configuration, and (3) network manager regularly causes issues by changing the DHCP configuration. I tried to follow :  Stop network manager sudo systemctl stop NetworkManager.service  Disable network manager (permanently) to avoid it restarting after a reboot sudo systemctl disable NetworkManager.service   Despite this, the network manager is back again every time I reboot the machine. How can I make it go away? Fixed buffers and interior buffers are not working for a polygon that contains a hole I'm following the online qgis manual available on qgis website. I'm doing the step 21.11.3. ().   To make it simple : I have a raster converted to vector, so now it is a polygon (several polygons). I'm doing an interior buffer exactly how it is described in the manual. I didn't obtain the same result. I can see the interior buffer just in some polygons, not in all of them ->    The interior buffers appear just for those polygons, that don't contain a hole. I use qgis 2.18.3.  This is how i created the interior buffer ->    In green you see the input layer : suitable_terrain, in blue the output layer, the interior buffer.   It is not a problem of a projection. I use WGS84 UTM Zone 34S where the units are in meters. I did also the Check validity and i obtain the same result. Why do some AC adapters and power supplies generate a whining noise, and what can I do about it? I'm stuck with this integral  $\int\frac {\cos^4x}{\sin^3x} dx$    which I rewrote as  $\int \csc^3x \cos^4xdx$  then after using the half angle formula twice for $\cos^4x$ I got this  $\frac 14\int \csc^3x (1+\cos(2x))(1+\cos(2x))dx$   then after solving those products I got these integrals  $\frac 14 \{\int \csc^3xdx+2\int \csc^3x \cos(2x)dx + \int \csc^3x \cos^2(2x)dx\}$  I do know how to solve the $\int \csc^3xdx$ one but I'm totally lost on the other ones, any tips/help/advice would be highly appreciated! thanks in advance guys!