Displaying 20 results from an estimated 45 matches for "xnew".
Did you mean:
new
2012 Jul 02
0
Fit circle with R
...Mxx*Myy - Mxy*Mxy;
Mxz2 = Mxz*Mxz;
Myz2 = Myz*Myz;
A2 = 4*Cov_xy - 3*Mz*Mz - Mzz;
A1 = Mzz*Mz + 4*Cov_xy*Mz - Mxz2 - Myz2 - Mz*Mz*Mz;
A0 = Mxz2*Myy + Myz2*Mxx - Mzz*Cov_xy - 2*Mxz*Myz*Mxy + Mz*Mz*Cov_xy;
A22 = A2 + A2;
epsilon=1e-12;
ynew=1e+20;
IterMax=20;
xnew = 0;
# Newton's method starting at x=0
epsilon=1e-12;
ynew=1e+20;
IterMax=20;
xnew = 0;
iter=1:IterMax
for (i in 1:IterMax){
yold = ynew;
ynew = A0 + xnew*(A1 + xnew*(A2 + 4.*xnew*xnew));
if (abs(ynew) > abs(yold)){
print('...
2010 Nov 09
2
Help with Iterator
...g is my "Iterator". When I try to write a new function with
itel, I got error.
This is what I have:
> supDist<-function(x,y) return(max(abs(x-y)))
>
> myIterator <- function(xinit,f,data=NULL,eps=1e-6,itmax=5,verbose=FALSE) {
+ xold<-xinit
+ itel<-0
+ repeat {
+ xnew<-f(xold,data)
+ if (verbose) {
+ cat(
+ "Iteration: ",formatC(itel,width=3, format="d"),
+ "xold: ",formatC(xold,digits=8,width=12,format="f"),
+ "xnew: ",formatC(xnew,digits=8,width=12,format="f"),
+ "\n"...
2007 Jan 26
2
Using functions within functions (environment problems)
...rom lme4:
lmerWrapper <- function(formula, data, family = gaussian, method =
c("REML",
"ML", "PQL", "Laplace", "AGQ"), control = list(), start = NULL,
subset, weights, na.action, offset, contrasts = NULL, model =
TRUE,
...)
{
xNew <- runif(0,1, length(data[,1]))
fNew <- sample(1:4, length(data[,1]), replace = T)
data <- as.data.frame(cbind(data, xNew, fNew))
formula <- update(formula, .~. + xNew + (1|fNew))
out <- lmer (formula = formula, data = data, family = family,
method =
method, w...
2006 Jan 26
2
Prediction when using orthogonal polynomials in regression
...quot;l"); lines(x, d$fitted.values, col="blue") # Fits great!
all.equal(as.numeric(d$coefficients[1] + m %*% d$coefficients[2:5]),
as.numeric(d$fitted.values))
What I would like to do now is to apply the estimated model to do
prediction for a new set of x points e.g.
xnew <- seq(0,5,.5)
We know that the predicted values should be roughly sin(xnew). What I
don't know is: how do I use the object `d' to make predictions for
xnew?
--
Ajay Shah http://www.mayin.org/ajayshah
ajayshah at mayin.org...
2013 Oct 31
1
Extracting values from a ecdf (empirical cumulative distribution function) curve
Hi R users,
I am a new user, still learning basics of R. Is there anyway to extract y
(or x) value for a known x (or y) value from ecdf (empirical cumulative
distribution function) curve?
Thanks in advance.
Mano.
[[alternative HTML version deleted]]
2001 May 23
1
Passing a string variable to Surv
...alues with the following headers:
timeM1 statusM1 xM1 timeM2 statusM2 xM2 timeM3 statusM3 xM3
1
2
3
4
5
6
Where M1,M2, M3 hve no similarity except they have a max string length
of 7. Examples are mcw0045, adl0003, lei0101.
Now, what I want to do is
Function(M1, M2, M3, datafile)
{
xnew <- readtable(datafile)
name1 <- paste("time",M1",sep"")
name2 <- paste(status",M1,sep"")
name3 <- paste("x",M1,sep"")
fit1 <- survfit(Surv(name1,name2)~name3,data=xnew)
.
.
repeat for M2 and M3...
2005 Jan 27
0
Xnews
Hi all,
I've been running Xnews through Wine for the past 2-3 years but I find
myself unable to run it correctly under any version of Wine past 20031112,
everything past it makes it unreliable, or simply dosn't work at all. Main
issues lie with windows management & input processing.
Any1 having same problem or know how...
2005 Oct 04
3
Problem reading in external data and assigning data.frames within R
...le question ... I'm a
new user. I can't understand why R flips the sign of all data values
when reading in external text files (tab delimited or csv) with the
read.delim or read.csv functions. The signs of data values also seem
to be flipped after assigning a new data.frame from within R (xnew <--
edit(data.frame()). What am I doing wrong?
Any help would be greatly appreciated. Thanks in advance.
-- Nate
-----------------------------
Nathan Dieckmann
Department of Psychology
University of Oregon
Eugene, OR 97403
(541) 346-4963
ndieckma at darkwing.uoregon.edu
2010 Apr 22
1
Convert character string to top levels + NAN
Dear all,
I have several character strings with a high number of different levels.
unique(x) gives me values in the range of 100-200.
This creates problems as I would like to use them as predictors in a coxph
model.
I therefore would like to convert each of these strings to a new string
(x_new).
x_new should be equal to x for the top n categories (i.e. the top n levels
with the highest
2007 Jul 22
1
Package design, placement of legacy functions
I have a function XOLD() from a nearly verbatim port of legacy
FORTRAN in a package. I have remplemented this function as XNEW()
using much cleaner native R and built-in functions of R. I have
switched the package to the XNEW(), but for historical reasons would
like to retain the XOLD() somewhere in the package directory
structure. An assertion through a README or other will point to this
historical function and...
2006 Jul 21
1
No config file
I am using Wine 0.9.15 to run a newsreader called Xnews. I have found
several sites with Wine configurations for Xnews, but all of the sites
I've found refer to modifying the "$HOME/.wine/config" file. The version
of Wine I am using doesn't use a config file - it uses system.reg and
user.reg. Can I use the modifications from the...
2010 Nov 18
3
sweep by levels of a factor
...s from each
of
other columns for each level of the factor. That is, in the example, to go
from the first matrix below to the second. I know SWEEP will take out means,
but I want to do this for each level of the factor.
f x
1 2
1 0
2 0
2 4
2 2
f xnew
1 1
1 -1
2 -2
2 2
2 0
Thanks
[[alternative HTML version deleted]]
2005 Sep 06
2
Predicting responses using ace
...of R and I'm working right now with the ACE function
from the acepack library. I Have a question: Is there a way to predict
new responses using ACE? What I mean is doing something similar to the
following code that uses PPR (Projection Pursuit Regression):
library(MASS)
x <- runif(20, 0, 1)
xnew <- runif(2000, 0, 1)
y <- sin(x)
a <- ppr(x, y, 2)
ynew <- predict(ppr, xnew)
Any help would be much appretiated, Thanks in advance,
Luis Pineda
2008 Dec 05
3
Logical inconsistency
Dear colleagues
Please could someone kindly explain the following inconsistencies I've discovered when performing logical calculations in R:
8.8 - 7.8 > 1
> TRUE
8.3 - 7.3 > 1
> TRUE
Thank you,
Emma Jane
[[alternative HTML version deleted]]
2005 Dec 29
2
How to fit all points into plot?
Hi,
I have a problem when I want to add new points (or a
new line) to the graph. Some points (or parts of the
line) are not shown on the graph because they lie
beyond the scale of the axis. Is there a way to
overcome this so all points (or the entire line) are
shown on the graph? Here's an example of my problem:
colors = c("red", "blue")
plot(x=rnorm(100,0,1),
2005 Feb 13
2
row equality.
I think that this is an easy one...
I have a matrix where each row is an (x,y,z) triplet. Given a potential
(xnew,ynew,znew) triplet I want to know if the matrix already contains a
row with the new values (the space already has that point). I can do it
using a for loop, but I would like to know if there is anyway in which I
can do it without the for loop.
I do it now like this (this algorithm appears to be...
2006 Aug 17
2
getting sapply to skip columns with non-numeric data?
...columns.
Some columns are numeric, some are not.
I wish to create a function to calculate the mean and
standard deviation of each numeric column, and then
?bind? the column mean and standard deviation to the
bottom of the dataframe.
e.g.
tempmean <- apply(data.frame(x), 2, mean, na.rm = T)
xnew <- rbind(x,tempmean)
I am running into one small problem
what is the best
way to have sapply ?skip? the non-numeric data and
return NA?s?
2013 Mar 29
3
if clause in data frame
Hi,
final<-data.frame()
?? for (m1 in 4:10) {
?????? for (n1 in 4:10){?
?????????? for (x1 in 0: m1) {
????????????? for (y1 in 0: n1) {
final<- rbind(final,c(m1,n1,x1,y1))
res}}}}
?final1<-within(final,{flag<-ifelse(x1/m1>y1/n1, 1,0)})
?head(final1)
#? m1 n1 x1 y1 flag
#1? 4? 4? 0? 0??? 0
#2? 4? 4? 0? 1??? 0
#3? 4? 4? 0? 2??? 0
#4? 4? 4? 0? 3??? 0
#5? 4? 4? 0? 4??? 0
#6? 4? 4?
2013 Jun 08
1
splitting a string column into multiple columns faster
Hello!
I have a column in my data frame that I have to split: I have to distill
the numbers from the text. Below is my example and my solution.
x<-data.frame(x=c("aaa1_bbb1_ccc3","aaa2_bbb3_ccc2","aaa3_bbb2_ccc1"))
x
library(stringr)
out<-as.data.frame(str_split_fixed(x$x,"aaa",2))
out2<-as.data.frame(str_split_fixed(out$V2,"_bbb",2))
2011 Jun 14
2
Need script to create new waypoint
...ith assuming a constant movement during the time interval). The 'time distance' bewteen WP3 and WPnew is (120-73) 47 seconds and the 'time distance' between WPnew and WP4 is (153-120) 33 seconds (whereas total time interval between WP3 and WP4 is 80 seconds). WPnew (with coordinates Xnew,Ynew) should then be located at 80/33*100=41.25% from WP3: Xnew = X3 + (X4-X3)*41.25% and Ynew= Y3 + (Y4-Y3)*41.25%
2) Calculate the average location (average of x3,y3 and x4,y4), at which to create a new waypoint at 2 minutes.
3) A simpler alternative is that the location of the 'closer...