Displaying 10 results from an estimated 10 matches for "lesuperh".
2005 Apr 20
2
fSeries Technical Analysis rsiTA problem
fSeries Technical Analysis rsiTA problem
Hello,
I?m trying to use the rsiTA() function but keep getting this error:
>rsiTA(tsx,14)
Error in "[.timeSeries"(close, 1:(length(close) - 1)) :
only 0's may be mixed with negative subscripts
Here?s is the first three lines of my data:
>tsx[1:3,]
close
2004-04-18 20:00:00 8702.82
2004-04-19
2006 Jul 14
3
Generating random normal distribution with mean 0 and standard deviation 1
Hello,
This must be really simple, but I can't find it on R Site search. I need to
generate a random normally distributed series with mean 0 and sd 1. In
Matlab, this code is randn(n).
The closest I found is runif(20,-1,1) but this forces a maximum and a
minimum, and there's no way to specify a standard deviation of 1.
>sd(runif(20,-1,1))
[1] 0.578164
2006 Jun 19
2
saving rounded numbers as a new variable in a dataframe
A basic question, but one that eludes me. I have created a new variable
$numurder, which I have rounded off. I want to save the rounded off version
of this variable to an existing datafile called 'ngri.csv' .
numurder <-c((murder*no.of.cases)/100)
[[1]]
[1] 48.952 112.073 182.160 974.610 122.140 663.432 150.856 18.988
137.925 198.045 68.930 203.148 30.056 100.955
2006 Jul 27
2
Vector extracted from a matrix. How can I specify dimensions in as.matrix?
Transpose vector extracted from a matrix
Hello,
I am doing a recursive analysis that uses every line (vector) of a matrix in
a loop. In the model, I need to transpose those vectors that are extracted
from a matrix.
Using simple vectors (no matrix involved) the transpose function works fine:
simplevector <-matrix(1:3,3,1)
tsimplevector <-t(simplevector) #transposed
dim(simplevector)
2005 May 11
1
PDF Arial, Helvetica and Pagemaker 7.0
Hello,
I can generate PDF documents and they look good on acrobat reader. However,
when I import the PDFs in Pagemaker 7.0 (on windows2K), I get an error
message saying it does not recognize the Helvetica font.
I got this from ?pdf:
family
the font family to be used, one of "AvantGarde", "Bookman", "Courier",
"Helvetica", "Helvetica-Narrow",
2006 Oct 20
1
Cardinality constraint
Hello,
How do I implement a cardinality constraint with constrOptim?
I want to minimize (least square) a%*%x = 4
subject to
x1<2
x2<1
x3<4
count(x1, x2, x3)= 2 (cardinality constraint)
Is there a way to specify binary integer variables with constrOptim?
Here's my code so far:
a <-matrix(1:3,1,3)
fr <- function(x) {
(a%*%x-4)^2
}
2005 Apr 19
1
timeSeries Date Warning messages: Set timezone to GMT!
Hello, I must be doing something wrong that's very obvious. But I just
don't see it.
I changed my Windows Time Zone to GMT and my Financial Center to Montreal.
But I still get several warnings.
>Sys.timezone()
[1] "GMT Daylight Time"
>myFinCenter
[1] "Montreal"
>Sys.timeDate()
[1] "Montreal"
[1] [2005-04-19 10:55:02]
Warning messages:
1: Set
2005 Jun 01
1
Problem with fPortfolio
Hello,
I hesitate to call this a bug, because I could have forgotten something
important, but the MarkowitzPortfolio example in fPortfolio does not work
for me. Here's my code:
> library(fPortfolio)
>
>xmpPortfolio("\nStart: Load monthly data set of returns > ")
> data(berndtInvest)
> # Exclude Date, Market and Interest Rate columns from data
2006 Jun 21
4
help on ploting various lines
Dear All,
I tried to plot a variety of lines(curves) on same figure. What I did is,
plot(x=x1,y=y1)
lines(x=x2,y=y2)
lines(x=x3,y=y3)
...
In my data, the maximum of y1 is much smaller than those maximums of other y vectors. So, in the figure I got, there are some curves which are not complete, I mean, they were cut off at the maximum of y1 at the y axis. Could anybody point out some right
2012 Sep 18
4
add reference lines (or grid) in background
Dear all,
Is there a simple way to add reference lines in background? I am trying with
abline() or grid() but the lines, since they are executed after the plot
function, are draw on top. How can I draw such lines beneath the main plot?
Here is an example:
x<-rnorm(100)
boxplot(x)
abline(h=c(-1,0,1))
grid(NA, 4, lwd = 2)
regards,
Luigi Marongiu, MSc
[[alternative HTML