Displaying 20 results from an estimated 200 matches similar to: "distances from points to line"
2008 Feb 15
2
Softmax in nnet
Hi R help,
I run my data in nnet with skip layer, factor response (with 0 & 1
values) and explicitly put softmax=T to compare the result of the
default nnet with no softmax specification. I assume this should give
me the same result. I got the result the default one, but not the
softmax version and I got the error message that I did not quite
understand.
test6.nn.skipT.softm.Yfac <-
2008 Jan 07
1
Avoiding FOR loops
useR's,
I would like to know if there is a way to avoid using FOR loops to perform
the below calculation.
Consider the following data:
> x
[,1] [,2] [,3]
[1,] 4 11 1
[2,] 1 9 2
[3,] 7 3 3
[4,] 3 6 4
[5,] 6 8 5
> xk
Var1 Var2 Var3
1 -0.25 1.75 0.5
2 0.75 1.75 0.5
3 1.75 1.75 0.5
4 2.75 1.75 0.5
5 3.75 1.75
2012 Jan 06
1
lme model specification problem (Error in MEEM...)
Dear all,
In lme, models in which a factor is fully "contained" in another lead to
an error. This is not the case when using lm/aov.
I understand that these factors are aliased, but believe that such
models make sense when the factors are fitted sequentially. For example,
I sometimes fit a factor first as linear term (continuous variable with
discrete levels, e.g. 1,2,4,6), and
2011 Jun 14
1
Expand DF with all levels of a variable
Dear list,
I would like to expand a DF with all the missing levels of a variable.
a <- c(2,2,3,4,5,6,7,8,9)
a.cut <- cut(a, breaks=c(0,2,6,9,12), right=FALSE )
(x <- data.frame(a, a.cut))
# In 'x' the level "[0,2)" is "missing".
AddMissingLevel <- function(xdf) {
xfac <- factor( c("[0,2)", "[2,6)", "[6,9)",
2012 Dec 06
1
Fuction Error
I'm calling a list of symbols and then using a function to build a data
frame from that symbol list. It works great until I introduce this index
symbol from yahoo '^GSPC'. When and index symbol is introduced I get and
error which is below.
> Data <- symbolFrame(symbols)
Error in get(S) : object '^GSPC' not found
Since R does not like the ^ in front of a name it
2012 Feb 08
2
need help with understanding coxph encoding
Hi, in coxph,
coxph(Surv(time, status)~x,data=alm).
How to encode x? For example, if x has two groups, the treatment group and
control group. if I encode them as 1 and 2. Is the HR results
treatment/control? What if I encode them as 0 and 1. I am confused with how
survival package works for HR. What should I do to get a treatment/control
HR?
Thank you.
--
View this message in context:
2011 Mar 12
3
pass character vector in instrument field of get.hist.quote function
I am new to R so I apologize if my question is trivial. I have not been able
to figure out whether what I want to do is even possible.
I have a data frame of stock ticker symbols which I store into R space from
a txt file as follows:
tickers <- read.csv("stocks.txt", header=FALSE, sep=",")
tickers <- tickers[1] / the tickers are stored in the first column
>
2009 Sep 27
1
Clustering with R - efficient processing of large sparse data sets (text data)
I checked the R procedure HCLUST (hierarchical clustering) but it
looks like it requires a full triangular n x n similarity matrix as
input, where n = number of observations. The number of variables is
200.
My data set has n = 50,000 observations (keywords), and I use ad-hoc
similarity measures, not available in R, to measure keyword
similarity. Here, the vast majority of the n x n similarities
2002 Jan 09
6
Samba PDC problem
Easy one.
I have win98 clients that login and connect to the shares fine. My problem
is the user home directory, each user can see their folders and can even
open them but they cannot save to their home directory. Each users home dir
is setup as 0700 (-rwx------), as are the files and subdir's, which I
believe is Read, Write, Execute for the owner of the file. What am I
missing?
Chris.
2007 Aug 31
2
memory.size help
I keep getting the 'memory.size' error message when I run a program I have
been writing. It always it cannot allocate a vector of a certain size. I
believe the error comes in the code fragement below where I have multiple
arrays that could be taking up space. Does anyone know a good way around
this?
w1 <- outer(xk$xk1, data[,x1], function(y,z) abs(z-y))
w2 <- outer(xk$xk2,
2008 Jul 29
3
finding a faster way to do an iterative computation
useR's,
I am trying trying to find out if there is a faster way to do a certain
computation. I have successfully used FOR loops and the apply function to
do this, but it can take some time to fully compute, but I was wondering if
anyone may know of a different function or way to do this:
> x
[1] 1 2 3 4 5
> xk
[1] 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
I want to do:
2006 Aug 30
1
Optimization
Dear R-list,
I'm trying to estimate the relative importance of 6 environmental variables
in determining clam yield. To estimate clam yield a previous work used the
function Yield = (A^a*B^b*C^c...)^1/(a+b+c+...) where A,B,C... are the
values of the environmental variables and the weights a,b,c... have not been
calibrated on data but taken from literature. Now I'd like to estimate the
2007 Aug 28
1
alternate methods to perform a calculation
Consider a data frame (x) with 2 variables, x1 and x2, having equal values.
It looks like:
x1 x2
1 1
2 2
3 3
Now, consider a second data frame (xk):
xk1 xk2
0.5 0.5
1.0 0.5
1.5 0.5
2.0 0.5
0.5 1
1.0 1
1.5 1
2.0 1
0.5 1.5
1.0 1.5
1.5 1.5
2.0 1.5
0.5 2
1.0 2
1.5 2
2.0 2
I have written code to calculate some differences between these
2008 Jun 21
1
converting an R function into VBA
Hi everyone,
I want to convert an R function into VBA for calculating the eigenvectors and eigenvalues of a matrix using the "Power Method". The function is:
PowerMethod <- function(x, tolerance) {
my.mat <- var(x[,-1], na.method="available")
matSize <- dim(my.mat)[1]
eigenVec <- matrix(NA, nrow=matSize, ncol=matSize)
eigenVal <- rep(NA,
2011 Apr 08
11
How to rename rpool. Is that recommended ?
Hello,
I have a situation where a host, which is booted off its ''rpool'', need
to temporarily import the ''rpool'' of another host, edit some files in
it, and export the pool back retaining its original name ''rpool''. Can
this be done ?
Here is what I am trying to do:
# zpool import -R /a rpool temp-rpool
# zfs set mountpoint=/mnt
2007 Jan 15
1
Client shutdown options?..
Greetings:
I have what might be an oddball question.
Is there any way to configure the times at which clients initiate their
shutdown sequences? I have a domain controller in my setup that I would
have shut down if the UPS have been on backup for any more than a minute,
whereas the rest of the servers I would shut down on a low battery
condition.
I also have a use for such flexibility in our
2009 Jun 04
1
Using WinBUGS from R: A Multi-Way Array Problem
Please suggest a way out to the following problem.
I have a T by n data matrix (say Y) where coulmns are time series of length
T.
To do some analysis in WinBUGS I need to construct my data as follows.
yy<-rep(Y,k) ## this will be a vector
Yk<-array(yy,dim=c(T,n,k)) ## data array
Here the definition of dim indices is
first index: T rows
second index: n columns
third index: for kth T by n
2011 Jan 31
2
Missing at random
R users:
Thanks in advance
How to generate missing at random (MAR)?
assaedi76@yahoo.com
Thanks
[[alternative HTML version deleted]]
2008 Mar 11
2
glm.fit: "fitted probabilities numerically 0 or 1 occurred"
Hi,
could anyone explain to me what this warning message
exactly means and what the consequences are?
Is it due to the fact that there are very extreme
observations / outliers included or what is the reason
for it?
Thanks so much,
Werner
Machen Sie Yahoo! zu Ihrer Startseite. Los geht's:
2003 Oct 28
2
outer function problems
I'm pulling my hair (and there's not much left!) on this one. Basically I'm
not getting the same result t when I "step" through the program and evaluate
each element separately than when I use the outer() function in the
FindLikelihood() function below.
Here's the functions:
Dk<- function(xk,A,B)
{
n0 *(A*exp(-0.5*(xk/w)^2) + B)
}
FindLikelihood <-