Displaying 20 results from an estimated 3059 matches for "sin".
Did you mean:
in
2005 May 05
2
problem with plot() and R 2.1.0
The following line when pasted into an R Console window causes Windows XP to flash a blue screen
and then restart.
R version 2.1.0
>plot(x=c(1:100000),y=sin(c(1:100000)), type="l")
Windows XP SP2
I installed the precompiled version of R 2.1.0
This isn't the data I was originally trying to graph, but a way to reproduce the error I observed.
Plotting without the sin() did not reproduce the error.
I realize this might be unique to my s...
2010 Dec 20
2
Sine Regression in R
Hi everyone,
I am trying to fit a sine function on one year of wind data. I have two
questions below.
Looking around on the net I managed to get the following:
Sine Equation: y = a + b * sin( c + d*x )
b is the amplitude, c is the phase shift, d is something deal with
periodicty of data*.*
This can be linearised by sin( c+dx ) =...
2003 Jul 23
6
window function
Dear Sebastian and all,
This is a Japanese to live in Japan.
I have a question.
Ogg's window functon is
f(x)=sin(1/2*pi*sin^2((x+0.5)/n*pi)) for 0 <= x < n
But I cannot understand why this window function satisfys
the equation
f^2(x)+f^2(x+n/2)=2
which is for MDCT's perfect signal reconstruction.
reference:
Analysis/Synthesis Filter Bank Design Based on Time Domain Aliasing Cancellation
John P....
2007 Sep 03
4
sin(pi)?
Dear all,
I found something strange when calculating sin of pi value
sin(pi)
[1] 1.224606e-16
pi
[1] 3.141593
sin(3.141593)
[1] -3.464102e-07
Any help and comment should be appreciated.
Regards
Nguyen
____________________________
Nguyen Dinh Nguyen
Garvan Institute of Medical Research
Sydney, Australia
2010 Jun 24
1
help, bifurcation diagram efficiency
Hello all -
This code will run, but it bogs down my computer when I run it for finer and
finer time increments and more generations. I was wondering if there is a
better way to write my loops so that this wouldn't happen. Thanks!
-Tyler
#################
# Bifurcation diagram
# Using Braaksma system of equations
# We have however used a Fourier analysis
# to get a forcing function similar to
# cardiac action potential...
#################
require(odesolve)
# We get this s_of_t function from Maple ws
s_of_t = function(t)
{
(1/10) * (( (1/2) + (1/2) * (sin((1/4)*pi*t)...
2010 Nov 15
2
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
In http://llvm.org/docs/tutorial/LangImpl4.html#jit there's an example that optimizes calls to functions without side effects. Specifically,
ready> extern sin(x);
ready> extern cos(x);
ready> def foo(x) sin(x)*sin(x) + cos(x)*cos(x);
Read function definition:
define double @foo(double %x) {
entry:
%calltmp = call double @sin(double %x)
%multmp = fmul double %calltmp, %calltmp
%calltmp2 = call double @cos(double %x)
%...
2013 Mar 21
1
plot and save as png
Hi A.K
This is working
layout(matrix(c(1,2,3,4), 4, 1, byrow = TRUE))
plot(sin, -pi, 10*pi)
plot(sin, -pi, 20*pi)
plot(sin, -pi, 30*pi)
plot(sin, -pi, 40*pi)
dev.off()
but if I add this line
png(filename = "fname.png", width = 900, height = 600, units = 'px')
no plot is generated.
where is the problem?.
thanks
veepsirtt
> png(filename = "fname...
2008 Oct 26
0
orthographic projection of ellipsoids
...I think I'm on the wrong track from the start. Is there an obvious
analytical parametrisation of such projections? Any comments are
welcome.
Many thanks,
baptiste
>
> rotM3d <- function(theta=0, phi=0, psi=0){ # 3D rotation matrix
> a11 <- cos(psi)*cos(phi) - cos(theta)*sin(phi)*sin(psi)
> a12 <- cos(psi)*sin(phi) + cos(theta)*cos(phi)*sin(psi)
> a13 <- sin(psi)*sin(theta)
> a21 <- -sin(psi)*cos(phi) - cos(theta)*sin(phi)*cos(psi)
> a22 <- -sin(psi)*sin(phi) + cos(theta)*cos(phi)*cos(psi)
> a23 <- cos(psi)*sin(theta)
> a31 <-...
2012 Feb 13
3
fit data to y~A+B*sin(C*x)
I want to fit discrete data that was measured on a wavegenerator.
In this minimal example i generate some artificial data:
testsin <- 2+ 5 * sin(1:100) #generate sin data
testsin <- testsin+ rnorm(length(testsin), sd = 0.01) #add noise
mydata <- list(X=1:100, Y=testsin) # generate mydata object
nlmod <- nls(X ~ A+B*sin(C* Y), data=mydata, start=list(A=2, B=4, C=1), trace=TRUE)
# this nls fit fails.
Who can he...
2015 Nov 30
1
Inconsistency in treating NaN-results?
As a side note, Splus makes sin(x) NA, with a warning, for
abs(x)>1.6*2^48 (about
4.51e+14) because more than half the digits are incorrect in sin(x)
for such x. E.g.,
in R we get:
> options(digits=16)
> library(Rmpfr)
> sin(4.6e14)
[1] -0.792253849684354
> sin(mpfr(4.6e14, precBits=500))
1 'mpfr' number...
2008 Aug 21
1
max and min with the indexes in a zoo object (or anything else that could solve the problem)
library(zoo)
library(chron)
t1 <- chron("1/1/2006", "00:00:00")
t2 <- chron("1/31/2006", "23:45:00")
deltat <- times("00:15:00")
tt <- seq(t1, t2, by = times("00:15:00"))
d <- sample(33:700, 2976, replace=TRUE)
sin.zoo <- zoo(d,tt)
#there are ninety six reading in a day
d.max <- rollapply(sin.zoo, width=96, FUN=max)
d.min <- rollapply(sin.zoo, width=96, FUN=max)
this is about what I would like to do. I want to be able to get the
max for one day and then also get the index that coincides with this...
1997 May 09
2
R-alpha: R-0.49 / S-plus: "default argument evaluation" bugs and woes
There is a problem with 'default argument evaluation'
when I use an existing function name as argument name :
sintest <- function(x, y = 2, sin= sin(pi/4))
{
## Purpose: Test of "default argument evaluation"
## -------- Fails for R-0.49. Martin Maechler, Date: 9 May 97.
c(x=x, y=y, sin=sin)
}
## R-0.49:
R> sintest(1)
##> Error in sintest(1) : recursive default argument reference...
2007 Nov 27
3
[LLVMdev] Other Intrinsics?
> > Do you have plans to add other intrinsics? I'm curious as to why there
> > is an llvm.sin intrinsic and an llvm.cos intrinsic, but no llvm.atan
> > intrinsic. Why is there an llvm.pow intrinsic but no llvm.log
> > intrinsic?
>
> Intrinsics get added on demand. Generally there has to be a good reason
> to add them. llvm.sin was implemented (for example) to al...
2010 Nov 15
0
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
Hi Rob,
You need to set attribute ReadOnly on the sin / cos functions, using Function::addFnAttr(Attribute) for example.
Best regards,
--
Arnaud de Grandmaison
-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Rob Pieke
Sent: Monday, November 15, 2010 11:41 AM
To: llvmdev at cs.uiuc....
2015 Nov 26
2
Inconsistency in treating NaN-results?
This question is more out of curiosity than a complaint or suggestion, but
I'm just wondering.
The behavior of R on calculations that result in NaN seems a bit
inconsistent.
# this is expected:
> 0/0
[1] NaN
# but this gives a warning
> sin(Inf)
[1] NaN
Warning message:
In sin(Inf) : NaNs produced
# and this again does not
> exp(NaN)
[1] NaN
Conceptually, I like to think that R computes over the real line augmented
with NaN, Inf, -Inf, NaN, and NA (which is technically also NaN). As far as
I know, this set is closed under R'...
2011 Nov 05
1
3-D ellipsoid equations
+
Hello,
The parametric equations of an ellipsoid can be written in terms of spherical coordinates. The three spherical coordinates are converted to Cartesian coordinates by
X=a cos (α) sin(θ)
Y=b sin(α) sin(θ)
Z=c cos(θ)
for α and θ
The parameter α varies from 0 to 2 π and θ varies from 0 to π . Here ( X o , Y o ,Z o ) is the center of the ellipsoid, and θ is the angle of rotation. I need to come up with an expression for the ellipsoid expressed parametrically as the path o...
2017 Feb 06
3
Kaleidoscope tutorial: comments, corrections and Windows support
...uot;Type *DoubleTy = Type::getDoubleTy(TheContext);"?
- "Function *TheFunction = TheModule->getFunction(Proto->getName());"
The new getName method is unexpected, the tutorial user has to lookup
and copy the definition from the full listing.
3.5. Driver Changes and Closing Thoughts
- "When you quit the current demo"
-> "When you quit the current demo (by sending an EOF
via CTRL+D on Linux or CTRL+Z and ENTER on Windows)"
(Windows users normally don't send EOF characters so they
usually don't know this shortcut)
4.3....
2010 Jun 02
4
Draw text with a box surround in plot.
text() can draw text on a plot.
Do we have a way/function to draw text with a box surround it?
Thanks,
-james
2011 Jan 20
1
Generating time progressing line for Google Earth
Dear,
I am trying to visualise a time-progressing line (it's supposed to
represent spread patterns) using brew package and Google Earth.
The idea is to have a function which takes start and end point
geographic coordinates, as well as number of intervals to chop the path
up, and returns the collection of points segmenting this line.
Unfort...
2004 Feb 02
1
Robust nonlinear regression - sin(x)/x?
You reall have only one parameter in your model, c = a/b. You can't
identify both a and b from your model, therefore, you should fit the
linear model: lm(z ~ c* sin(x)/x)
Ravi.
----- Original Message -----
From: cstrato <cstrato at aon.at>
Date: Monday, February 2, 2004 2:28 pm
Subject: [R] Robust nonlinear regression - sin(x)/x?
> Dear all
>
> Since I did not receive any answer to my general question (?),
> let me ask a concrete question...