Displaying 20 results from an estimated 2000 matches similar to: "derivative of atan(x) and similar functions"
2003 Aug 01
2
'format' problem
Dear R experts,
format(12345678, digits = 2)
gives
[1] "1.2e+07"
while
format(1234567, digits = 2)
gives
[1] "1234567"
but I'd like the last number to be represented as "1.2e+06" string too.
Where am I wrong?
Thanks,
Timur.
2005 Aug 16
2
Registration with Asterisk server
Dear Asterisk community,
sorry if I'm so stupid, but I couldn't register myself with Asterisk.
I created the [sip-incoming] context in the sip.conf:
[sip-incoming]
type = peer
username = elzhov
port = 5062 ; my kphone listens port 5062
host = 127.0.0.1
Then run Asterisk, and checked peers that are known for Asterisk:
*CLI> sip show peers
Name/username
2003 Feb 10
1
Zero rows/cols in the hessian matrix
Dear R experts!
I try to minimize a function with external C fitting function.
I get the hessian matrix. Here it is:
[,1] [,2] [,3] [,4]
[1,] 1.8816631 0 0.8859803 0
[2,] 0.0000000 0 0.0000000 0
[3,] 0.8859803 0 0.4859983 0
[4,] 0.0000000 0 0.0000000 0
Second and fourth rows/columns have zero values only. That's OK,
because that ones related
2003 Jan 17
1
Arguments of R- and C-side of internal functions
Dear R experts,
I looked at the body of, say, `optim' function and found
the call to the `.Internal', C optim function. It looks
like this:
.Internal(optim(par, fn1, gr1, method, con, lower, upper))
On the other hand, the C prototype of optim is:
SEXP do_optim(SEXP call, SEXP op, SEXP args, SEXP rho);
So, I guess that all the list of parameters passing in R are assigned
to
2003 Nov 12
1
problem with x11 and PS devices on different machines
Dear R help,
I run R at home and the work, I have Debian Linux on both machines and
the same 'r-base-core' deb packages installed. So I tried to run the
same R script, which plots graph in x11 device and then dump it to eps
file (x11 and eps you'll find attached). On the home machine there are
some stranges in x11 plot as well as in eps file. On the work machine
all the ok, despite
2002 Dec 06
2
Fitting 2D vs. 2D data with nls()
Dear R-experts!
I have y(x) data, dim(y) == dim(x) == c(2000, 2)
I'd like to fit them with nls:
fit.result <- nls ( y ~ f(x, p1, p2, p3),
start = list(p1 = ... , p2 = .. , p3 = ..)
)
Actually I want to fit y[,1] ~ x[,1] and y[,2] ~ x[,2]
*simulaneously*, with the same parameters set {p1, p2, p3}.
I tried to feed R tha above formula, R errors with:
2004 Mar 15
8
Simple numeric "as.is" question
I am reading a list of numbers from my clipboard, and have been
successful, except I can't make a histogram as R doesn't recognize my
variable as numeric. I know I need to use "as.is", but the specifics
escape me.
I have used x<-read.table("clipboard", header=F) to import from a txt
file. How do make this numeric? Thanks, J.
2003 Oct 30
2
'nls' and its arguments
Dear R experts!
I'd to fit data by 'nls' with me-supplied function 'fcn'.
1) I'd like 'fcn' to accept arbitrary arguments, i.e. I defined it
as f(...) {<body>}. (Ok, that's not actually impotant).
2) Second, I would NOT like to supply every parameter in the formula.
To illustrate this, let's look at the last example of 'nls' help
2004 Nov 09
4
R code debugging
Dear useRs,
it's quite difficult for me to find `Error:'s in my R code, because R does
say about error itself, but say nothing about its location, say, string
number and file with an error (which may be `source'd from another file).
Are there any option for turning of the similar feature, or R can not do
such a thing at all?
Thanks.
--
WBR,
Timur.
2004 Feb 03
5
lm coefficients
Dear R experts,
Excuse me if my question will be stupid...
I'd like to fit data with x^2 polynomial:
d <- read.table(file = "Oleg.dat", head = TRUE)
d
X T
3720.00 4.113
3715.00 4.123
3710.00 4.132
...
out <- lm(T ~ poly(X, 4), data = d)
out
Call:
lm(formula = T ~ poly(X, 2), data = d)
Coefficients:
(Intercept) poly(X, 2)1 poly(X, 2)2
2004 May 21
2
.First() in R 1.9.0
Dear R experts,
I just upgraded R from 1.8.1 to 1.9.0 version. My .First()
function in ~/.Rprofile contains x11() and par() functions.
.First <- function() {
x11(display = "", 8.0, 5.0)
par(las = 1, ...)
## ...
}
And, R claims now, on startup:
[hello messages skiped ...]
Error in .First() : couldn't find function "x11"
>
I commented
2005 Jul 22
1
asterisk captures sound device
Hello, dear Asterisk experts.
When I run Asterisk (CVS HEAD version), I'm not able to play music
anymore -- asterisk seems to capture sound device. Is it not a bug,
but a feature? That's unlike stable (1.0.7 and 1.0.9) versions, when
I can, say, run an IP telephone on the *same* machine and listen what
Asterisk' autoattendant says. Now I can't do that, I need Asterisk
and client
2024 Sep 05
3
BUG: atan(1i) / 5 = NaN+Infi ?
On 2024-09-05 4:23 p.m., Leo Mada via R-help wrote:
> Dear R Users,
>
> Is this desired behaviour?
> I presume it's a bug.
>
> atan(1i)
> # 0+Infi
>
> tan(atan(1i))
> # 0+1i
>
> atan(1i) / 5
> # NaN+Infi
There's no need to involve atan() and tan() in this:
> (0+Inf*1i)/5
[1] NaN+Infi
Why do you think this is a bug?
Duncan Murdoch
2024 Sep 05
2
BUG: atan(1i) / 5 = NaN+Infi ?
Dear R Users,
Is this desired behaviour?
I presume it's a bug.
atan(1i)
# 0+Infi
tan(atan(1i))
# 0+1i
atan(1i) / 5
# NaN+Infi
There were some changes in handling of complex numbers. But it looks like a bug.
Sincerely,
Leonard
[[alternative HTML version deleted]]
2024 Sep 05
2
BUG: atan(1i) / 5 = NaN+Infi ?
Perhaps
> Inf*1i
[1] NaN+Infi
clarifies why it is *not* a bug.
(Boy, did that jog some long dusty math memories :-) )
-- Bert
On Thu, Sep 5, 2024 at 2:48?PM Duncan Murdoch <murdoch.duncan at gmail.com>
wrote:
> On 2024-09-05 4:23 p.m., Leo Mada via R-help wrote:
> > Dear R Users,
> >
> > Is this desired behaviour?
> > I presume it's a bug.
> >
2010 May 05
1
testInstalledBasic question
Hi,
I'm currently in the process of writing an R-installation SOP for my
company. As part of that process I'm using the recommendations from the 'R
Installation and Administration' document, section 3.2, "Testing an
installation". This is done on an XP machine, using the latest binary of
2.11.0.
The binary is downloaded and then installed from the installer. I then
2005 May 16
1
branch cuts of atan()
Hi
the following gave me a shock:
> atan(2)
[1] 1.107149
> atan(2+0i)
[1] -0.4636476+0i
>
or, perhaps more of a gotcha:
> atan(1.0001+0i)
[1] -0.7853482+0i
> atan(0.9999+0i)
[1] 0.7853482+0i
>
evidently atan()'s branch cuts aren't where I thought they were.
Where do I look for documentation on this?
--
Robin Hankin
Uncertainty Analyst
National
2024 Sep 06
1
BUG: atan(1i) / 5 = NaN+Infi ?
I expect that atan(1i) = (0 + infinity i) and that atan(1i)/5 = (0 +
infinity i)/5 = (0 + infinity i).
Here's what I get in C:
(0,1) = (0, 1)
atan((0,1)) = (0, inf)
atan((0,1))/5 = (0, inf)
Note the difference between I*infinity = (0,1)*infinity =
(0*infinity,1*infinity) = (NaN,infinity)
and (0,infinity)/5 = (0/5,infinity/5) = (0,infinity).
The former involves multiplying 0 by infinity, which
2013 Dec 02
1
Days to solstice calculation
Hello,
I've come across a problem in developing a set of custom functions to calculate the number of hours of daylight at a given latitude, and the number of days a date precedes or secedes the summer solstice. I discovered an inconsistency concerning leap years between my derived values and those from the US naval databases. It seems as far as I can figure that my inconsistency arises either
2024 Sep 05
1
BUG: atan(1i) / 5 = NaN+Infi ?
> complex(real = 0, imaginary = Inf)
[1] 0+Infi
> Inf*1i
[1] NaN+Infi
>> complex(real = 0, imaginary = Inf)/5
[1] NaN+Infi
See the Note in ?complex for the explanation, I think. Duncan can correct
if I'm wrong.
-- Bert
On Thu, Sep 5, 2024 at 3:20?PM Leo Mada <leo.mada at syonic.eu> wrote:
> Dear Bert,
>
> These behave like real divisions/multiplications:
>