I would like to fit a model and the smallest predicted value must be zero. This is what I have done:  xx = c(.001,1,seq(5,50,5))*1e3 yy = c(0.0001,0.0378,0.1778,0.5422,1.2304,2.1918,3.575,5.1964,        7.2778,9.6814,12.4536,15.5136) dat = data.frame(x=xx,y=yy)  # see: http://stats.stackexchange.com/a/160575/86260 c.0 = min(yy) * .5  model.0 = lm(log(y - c.0) ~ x, data = dat) start = list(a=coef(model.0)[1], b=coef(model.0)[2], c=c.0) mod = nls(y ~ a * exp(b*x) + c, data = dat, start = start)  zero = predict(mod, list(x = 0)) print(paste('zero:', zero))  # Plot empirical vs. predict plot(dat$x/1e3,dat$y, xlab = 'Parameter (in thousands)',       ylab = 'Execution time (in seconds)', main = 'Service performance',      col = 'steelblue', type = 'o', pch = 19, lwd = 3) lines(dat$x/1e3, predict(mod, list(x = dat$x)), col = 'red',        lty = 2, lwd = 2) grid() legend('topleft', legend = c('Empirical data',         'Predicted from the model'), col = c('steelblue', 'red'),         lwd = 3, lty = c(1,2), pch = c(19,32), bty = 'n')   Which will outputs:  [1] "zero: -0.326332998543469"     As it can be seen, the predicted value for the parameter .001 must be zero (or as close as it is possible of).   How could I fit a model with such a constraints?    EDIT: an algebraic manipulation can be used to overcome this issue. (thank you @whuber)  The code now become:   xx = c(.001,1,seq(5,50,5))*1e3 yy = c(0.0001,0.0378,0.1778,0.5422,1.2304,2.1918,3.575,5.1964,        7.2778,9.6814,12.4536,15.5136) dat = data.frame(x=xx,y=yy)  # see: http://stats.stackexchange.com/a/160575/86260 a.0 = 0 model.0 = lm(log(y - a.0) ~ x, data = dat) start = list(a=coef(model.0)[1], b=coef(model.0)[2]) mod = nls(y ~ a * exp(b*x) - a, data = dat, start = start)  zero = predict(mod, list(x = 0)) print(paste('zero:', zero))  # Plot empirical vs. predict plot(dat$x/1e3,dat$y, xlab = 'Parameter (in thousands)',       ylab = 'Execution time (in seconds)', main = 'Service performance',      col = 'steelblue', type = 'o', pch = 19, lwd = 3) lines(dat$x/1e3, predict(mod, list(x = dat$x)), col = 'red',        lty = 2, lwd = 2) grid() legend('topleft', legend = c('Empirical data',         'Predicted from the model'), col = c('steelblue', 'red'),         lwd = 3, lty = c(1,2), pch = c(19,32), bty = 'n')   Which will outputs:  [1] "zero: 0"
I have some basic data on emission reductions and cost per car:  q24 &lt;- read.table(text = "reductions  cost.per.car     50  45     55  55     60  62     65  70     70  80     75  90     80  100     85  200     90  375     95  600     ",header = TRUE, sep = "")   I know that this is an exponential function, so I expect to be able to find a model that fits with:      model &lt;- nls(cost.per.car ~ a * exp(b * reductions) + c,           data = q24,           start = list(a=1, b=1, c=0))   but I'm getting an error:   Error in nlsModel(formula, mf, start, wts) :    singular gradient matrix at initial parameter estimates   I've read through  on the error I'm seeing and I'm gathering that the problem is probably that I need better/different start values (the initial parameter estimates makes a little more sense) but I'm not sure, given the data that I have, how I'd go about estimating better parameters.
Although many have attempted to explain the difference among \mathrm, \textrm, \textnormal and \text (and others?), I found them misleading.  See for example the LaTeX's Wiki \mathrm explanation   Why is it wrong? Let's try all of them within an article and a beamer and you'll see the difference and, therefore, error.  equation.tex  \begin{eqnarray*}   \int_1^9\! \cos{x} \,\mathrm{d}x &amp; &amp; \textrm{this is textrm}\   \sum_1^9 y                       &amp; &amp; \textsf{this is textsf}\   \prod_1^9 z                      &amp; &amp; \textnormal{this is textnormal}\   \bigcup_1^9 w                    &amp; &amp; \text{and this is just text} \end{eqnarray*}   article.tex  \documentclass{article} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb}  \begin{document}   \input {equation} \end{document}     And until here everything looks fine...  beamer.tex  \documentclass{beamer} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb}  \begin{document}   \begin{frame}     \input{equation}   \end{frame} \end{document}     And here we can clearly see that \mathrm does not behave as expected, i.e. does not provide a function aspect to the d. Does anyone know what am I supposed to use here instead? Just \text?? o.O  Moreover, I cannot see any difference between \textnormal and \text.  Finally, \textrm looks useless.. How can I integrate $$\ln \left( x+\sqrt{1+x^2} \right) $$   The problem is from IA Maron Calculus, Problem 4.3.17. The problem is under the heading 'Integration by parts'. I have tried it, but it just leads to 2 unsolvable integrals Use $\delta-\epsilon$ to show that $\lim_{n\to\infty} a^{\frac{1}{n}} = 1$? Hope this is a meaningful question, but I'm curious if is possible to show that   $$\lim_{n\to\infty} a^{\frac{1}{n}}=1, \text{where  }a&gt;0$$  using $\delta-\epsilon$ directly or other methods. One method that I am aware of is to use the following:     If $\{s_n\}$ is a nonzero sequence, then $\liminf\bigl|\frac{s_{n+1}}{s_n}\bigr|\le \liminf |s_n|^{\frac{1}{n}}\le \limsup |s_n|^{\frac{1}{n}}\le\limsup\bigl|\frac{s_{n+1}}{s_n}\bigr|$ Texture not appearing in render? I'm noticing a significant difference between when my objects are observable in the 3D View and when the objects are rendered.  Both objects have a material with toon settings and each have materials (incorrectly?) added to the object. the human mesh has separate textures for the head and body. The sword and the human mesh both have mapping > coordinate set to UV and Mapping > Map set to UVMap, however only the head texture seems to show up properly, and the sword texture doesn't show up at all. Number of lines in a file in Java I use huge data files, sometimes I only need to know the number of lines in these files, usually I open them up and read them line by line until I reach the end of the file  I was wondering if there is a smarter way to do that What is the difference between "lay" and "lie"? Checkout one file from Subversion Bridged adapter in Virtual Box - cannot obtain IP I have virtual box with RHEL installed. My virtual box is running on windows 7 64 -bit. I configured bridged connection, but when I am restarting network interfaces, I receive following error:  Determining IP information for eth1... failed   On Windows XP it works without problems. I disabled Windows Firewall and installed latest Virtual Box, still without success.   NAT is working without any problems. What did I missed?  UPDATE  Ouput of ifconfig -a is:  eth0      Link encap:Ethernet  HWaddr 08:00:27:B6:FC:69           inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0           inet6 addr: fe80::a00:27ff:feb6:fc69/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:430 errors:0 dropped:0 overruns:0 frame:0           TX packets:346 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:36520 (35.6 KiB)  TX bytes:31455 (30.7 KiB)  eth1      Link encap:Ethernet  HWaddr 08:00:27:C3:84:4A           inet6 addr: fe80::a00:27ff:fec3:844a/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:1464 errors:0 dropped:0 overruns:0 frame:0           TX packets:17 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:135419 (132.2 KiB)  TX bytes:4230 (4.1 KiB)  lo        Link encap:Local Loopback           inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:16436  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)   Output of route -n  Kernel IP routing table Destination     Gateway         Genmask         Flags Metric Ref    Use Iface 10.0.2.0        0.0.0.0         255.255.255.0   U     0      0        0 eth0 169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0 0.0.0.0         10.0.2.2        0.0.0.0         UG    0      0        0 eth0   Output of dhclient -v eth1 is:  Listening on LPF/eth1/08:00:27:c3:84:4a Sending on   LPF/eth1/08:00:27:c3:84:4a Sending on   Socket/fallback DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 6 (xid=0x6afb6c4c) DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 9 (xid=0x6afb6c4c) DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 15 (xid=0x6afb6c4c) DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 18 (xid=0x6afb6c4c) DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 13 (xid=0x6afb6c4c) No DHCPOFFERS received. No working leases in persistent database - sleeping.   Moreover the same machine with the same configuration works well on Windows XP. The problem is only on Windows 7. I'm running badblocks to check for bad segments on an external drive, and it's been about an hour and it has not yet finished. Now, I need to go and consider cancelling. Is this somehow risky? Should I avoid this?   Clearly, I will need to start again from scratch; I just want to know if this is somehow risky to abort midway. Background: I am currently employed by a start-up that, so far, is doing really well. As part of my contract, I have stock options that will come available on a typical vesting schedule. A quarter of my options are set to vest later this year. Also, the company is not public yet, and it may be several years before it is public / I could sell my shares of the company.  My question is, is there any reason I should exercise them as soon as they vest? As far as I know they don't expire as long as I work at my company (if I leave for any reason, then I only have 3 months to exercise).  I don't foresee leaving any-time soon, and if I did, I would have 3 months to make a final decision.  Is there any disadvantage to just letting the option stay an option for a while? Difference between block size and cluster size Unable to Enter a Country If I have a connecting flight through a country I am unable to enter. Can I retrieve my bags to recheck for my connect? K-Means clustering for mixed numeric and categorical data My data set contains a number of numeric attributes and one categorical. Say, NumericAttr1, NumericAttr2, ..., NumericAttrN, CategoricalAttr, where CategoricalAttr takes one of three possible values: CategoricalAttrValue1, CategoricalAttrValue2 or CategoricalAttrValue3. I'm using default . It works with numeric data only. So my question: is it correct to split the categorical attribute CategoricalAttr into three numeric (binary) variables, like IsCategoricalAttrValue1, IsCategoricalAttrValue2, IsCategoricalAttrValue3 ? recovering deleted file held open by apache? Suppose an apache log file gets deleted but it's held open by apache; then this is what I am doing:  pid=$(lsof | grep text.txt | awk '/deleted/ {print $2}') fd=$(lsof | grep text.txt | awk '/deleted/ {print $4}' | grep -oE "[[:digit:]]{1,}")  cp /proc/$pid/fd/$fd directorytobecopied/testfile.txt   This is what I am doing to recover the file and put it back where it was. Is there any simpler way of doing this because above code doesn't look good. Furthermore how do I know from where the file was deleted(directorytobecopied) so that I don't have to manually ask somebody where the file was located originialy and put it back there. Is sun revolving around certain mass in space with reference to some other galaxy? Every planet and satellite revolves around their mother planet and about their own axis as we know. So they are compacted as a system. Then why not sun? A company is any form of business whether it is small or large. Generally the term &quot;company&quot; indicates a particular kind of business dealing in a specific product. An organisation is the larger form and generally comprises of a number of companies.  Simply, a company is an organization, but an organization is not just a company. An industry is the combination of companies in same line of business. Firm, corporation and business  are synonyms of &quot;company&quot;. An Agency is a particular kind of company, which serves as an intermediary between clients (other companies or individuals).  Is this correct? Setting constraints causes the location of the constrained objects/bodies not be accessible I set up 2 bodies manually &amp; assigned Copy Location constraint to one with respect to another body. Then I set up the keyframe for the guiding body &amp; then I started to view the change in the location of the constrained body. What I noticed in the 3D viewport was the constrained object moves, but when I look into its real position the values are stagnant. Why is that? I was unable to find my answer in previously asked questions by other people !! How to interpret regression coefficients when response was transformed by the 4th root? I'm using fourth root (1/4) power transformation on my response variable, as a result of heteroscedasticity. But now I'm not sure how to interpret my regression coefficients.   I assume that I would need to take the coefficients to the fourth power when I back-transform (see below regression output). All of the variables are in units of dollar in millions, but I would like to know the change in dollar in billions.    While holding the other independent variable constant, a billion dollar change in fees, on average, leads to a change of 32 (or 32,000 dollars) in collections. I take 0.000075223 * 1000 (to get to billions) ^ 4 = 0.000032. Now do I multiply this number by 1 million or 1 billion (the original unit of the dependent variable is in millions)?  lm(formula = (Collections^(1/4)) ~ Fees + DIR)                   Estimate      Std. Error  t value            Pr(&gt;|t|) (Intercept)   2.094573355     0.112292375   18.653  0.0000000000000151 Fees        **0.000075223   **0.000008411    8.943  0.0000000131878713 DIR           0.000022279     0.000004107    5.425  0.0000221138881913 How can I obfuscate (protect) JavaScript? I came across this problem and I believe Lagrange's theorem is the key to its solution.  The question is:     Let $p$ be an odd prime. Prove that there is some integer $x$ such that $x^2 \equiv −1 \pmod p$ if and only if $p \equiv 1 \pmod 4$.   I appreciate any help.  Thanks.