Displaying 20 results from an estimated 24 matches for "fval".
Did you mean:
_val
2017 Jul 13
2
Help with R script
Using Ulrik?s example data (and assuming I understand what is wanted), here is what I would do:
ex.dat <- c("FName: fname1", "Fval: Fval1.name1", "Fval: ", "FName: fname2", "Fval: Fval2.name2", "FName: fname3")
tst <- data.frame(x = ex.dat, stringsAsFactors=FALSE)
sp <- strsplit(tst$x, ':', fixed=TRUE)
chk <- unlist(lapply(sp, function(txt) txt[2] != ' '))...
2017 Jul 14
0
Help with R script
@Don your solution does not solve Vijayan's scenario 2. I used spread and
gather for that.
An alternative solution to insert mising Fval - picking up with Don's
newtst - is
newtst <- c("FName: fname1", "Fval: Fval1.name1", "FName: fname2", "Fval:
Fval2.name2", "FName: fname3", "FName: fname4", "Fval: fval4.fname4")
newtst_new <- vector(mode = "cha...
2011 Jun 24
4
How to capture console output in a numeric format
...at yields a character vector. I would like to extract the actual numeric values. Here is an example of what I am trying to do.
fr <- function(x) { ## Rosenbrock Banana function
on.exit(print(f))
x1 <- x[1]
x2 <- x[2]
f <- 100 * (x2 - x1 * x1)^2 + (1 - x1)^2
f
}
fvals <- capture.output(ans <- optim(c(-1.2,1), fr))
Now, `fvals' contains character elements, but I would like to obtain the actual numerical values. How can I do this?
Thanks very much for any suggestions.
Best,
Ravi.
-------------------------------------------------------
Ravi Varadhan...
2010 Jan 20
2
Error meaning
...2 <- function(pars)
{ ## parameters to estimate
alp <- pars[1]
b1 <- pars[2]
b2 <- pars[3]
rho <- pars[4]
f1 <- pars[1]*pars[2]
f2 <- pars[1]*(pars[1]+1)*pars[2]^2
f3 <- pars[1]*(pars[1]+1)*pars[3]^2
f4 <- pars[1]*pars[2]*pars[3](pars[1]+pars[4])
fval <- c(f1,f2,f3,f4)
## jacobian matrix
j11 <- pars[2]
j12 <- pars[1]
j13 <- 0
j14 <- 0
j21 <- (2*pars[1]+1)*pars[2]^2
j22 <- 2*pars[2]*pars[1]*(pars[1]+1)
j23 <- 0
j24 <- 0
j31 <- (2*pars[1]+1)*pars[3]^2
j32 <- 2*pars[3]*pars[1]*(pars[1]+1)
j33 <- 0
j34 <-...
2012 Sep 09
1
Solving a system of two equations
Hi,
I am trying to find a simple way to numerically solve a system of two
equations equal to zero with two unknowns (x_loc and y_loc). Here is a mock
data set and below it, the equations I need to solve.
theta<-c(180,135,90)/(2*pi)
x<-c(0,0,15)
y<-c(20,0,0)
0 =
-sum((y_loc-y)*(sin(theta)*(x_loc-x)-cos(theta)*(y_loc-y))/(((x_loc-x)^2+(y_loc-y)^2)^0.5)^3)
0 =
2016 Jun 27
2
xapian-letor: FeatureVector discussion
...s needs some discussion.
Presently, the FeatureVector class is defined as follows, with a fixed
number of feature count (19):
class FeatureVector::Internal : public Xapian::Internal::intrusive_base{
friend class FeatureVector;
double label;
double score;
std::map<int,double> fvals;
int fcount;
Xapian::docid did;
The two approaches that were discussed were:
1. Using enums as IDs for features in fvals.
2. Making fvals into a configurable vector of feature values.
The issues were that the first way would still assume an order in which the
features occur, and the seco...
2017 Jul 13
0
Help with R script
Hi Vijayan,
one way going about it *could* be this:
library(dplyr)
library(tidyr)
library(purrr)
ex_dat <- c("FName: fname1", "Fval: Fval1.name1", "Fval: ", "FName:
fname2", "Fval: Fval2.name2", "FName: fname3")
data.frame(x = ex_dat) %>%
separate(x, c("F1", "F2"), sep = ": ") %>%
filter(F2 != "") %>%
group_by(F1) %>%
mutat...
2017 Jul 13
2
Help with R script
Dear R-help Group
Scenario 1:
I have a text file running to 1000 of lines...that
is like as follows:
[922] "FieldName: Wk3PackSubMonth"
[923] "FieldValue: Apr"
[924] "FieldName: Wk3PackSubYear"
[925] "FieldValue: 2017"
[926] "FieldName: Wk3Code1"
[927] "FieldValue: "
[928] "FieldValue: K4"
[929] "FieldName:
2016 Jun 29
2
xapian-letor: FeatureVector discussion
...ependently of RankList. Therefore, eliminating the
need of maintaing a global qrel storage (map<string, map<string, int> >
qrel; in FeatureManager::Internal) and thus eliminating the need of
load_relevance(*) and getlabel(*) functions. The score in FeatureVector is
simply the label, and fvals will be returned by FeatureManager (by using
feature values obtained from each of the Feature sub-class).
While ranking, FeatureVector fvals will be computed similarly by
FeatureManager, while the score gets assigned later at the time of ranking.
> * when configuring the letor system either...
2008 Sep 12
2
[LLVMdev] Selection Condition Codes
...;0, 2>, SDTCisSameAs<0, 3> ]>;
def cmov_logical : SDNode<"INSTISD::CMOVLOG", SDTGenTernaryOp>;
let PrintMethod = "printCCOperand" in
def CCOp : Operand<i32>;
def CMOVLOG : InstFormat<(outs GPR:$dst), (ins GPR:$LHS, GPR:$RHS,
GPR:$TVAL, GPR:$FVAL, CCOp:$cond),
"$cond $LHS, $LHS, $RHS\ncmov_logical
$dst, $LHS, $TVAL, $FVAL",
[(set GPR:$dst, (selectcc GPR:$LHS,
GPR:$RHS, GPR:$TVAL, GPR:$FVAL, CCOp:$cond))]>;
Maybe I'm approaching this from the wrong way, bu...
2006 Sep 26
15
RE: Individual passwords for guest VNC servers ?
> Thanks all point about security, I''ll do as follows.
> I thought that the point was the following two.
>
>
> 1. Storage place of encrypted password
> Should I store it in /etc/xen/passwd ?
> Or, should I wait for DB of Xen that will be released in
> the future?
The xend life cycle management patches were posted by Alistair a couple
of months back.
2005 Jun 01
1
Bootstrap direction
Hi all,
I am trying to bootstrap a small data set into 1000 "pseudodatasets" and
then run an ANOVA on each one. Can anyone provide guidance on how I could
do this?
Thank you.
-Dan Janes
************************************************
Dan Janes, Ph.D.
Harvard University/OEB
26 Oxford St.
Cambridge, MA 02138
Office: 617-496-2375
Fax: 617-495-5667
Email: djanes at oeb.harvard.edu
2009 Oct 20
1
Buglet in optim() SANN
I think SANN method in optim() is failing to report that it has not
converged. Here is an example
genrose.f<- function(x, gs=NULL){ # objective function
## One generalization of the Rosenbrock banana valley function (n
parameters)
n <- length(x)
if(is.null(gs)) { gs=100.0 }
fval<-1.0 + sum (gs*(x[1:(n-1)]^2 - x[2:n])^2 + (x[2:n] - 1)^2)
return(fval)
}
xx<-rep(pi,10)
test<-optim(xx,genrose.f,method="SANN",control=list(maxit=1000,trace=1))
print(test)
Output is:
> source("tsann.R")
sann objective function values
initial val...
2012 May 08
1
Translation of Linear minimization probelm from matlab to r
Hi everyone, i?m a new user of R and i?m trying to translate an linear
optimization problem from Matlab into r.
The matlab code is as follow:
options = optimset('Diagnostics','on');
[x fval exitflag] = linprog(f,A,b,Aeq,beq,lb,ub,[],options);
exitflag
fval
x=round(x);
Where:
f = Linear objective function vector (vector of 45,rows)
A = Matrix for linear inequality constraints (3colums 45 rows matrix)
b = Vector for linear inequality constraints (3 rows vector)
Aeq = Matrix for li...
2005 Oct 13
3
Optim with two constraints
Hi R-list,
I am new to optimization in R and would appreciate help on the following
question. I would like to minimize the following function using two
constraints:
######
fn <- function(par,H,F){
fval <- 0.5 * t(par) %*% H %*% par + F%*% par
fval
}
# matrix H is (n by k)
# matrix F is (n by 1)
# par is a (n by 1) set of weights
# I need two constraints:
# 1. each element in par needs to be between 0 and 1
# 2. sum(par)=1 i.e. the elements in par need to sum to 1
## I try to u...
2009 Mar 23
4
newton method
Hi R-users,
Does R has a topic on newton's method?
Thank you for the info.
2005 Jun 13
0
Pseudodataset text file
...eived
code that bootstrapped my dataset and ran an ANOVA on each pseudodataset,
producing a histogram of F-values. Here is the code I received that
produces this F-histogram.
X <- data.frame(b=rnorm(2162),c =factor(rep(1:47,each=46)))
## linear fit with true values
lm0 <- lm(b~c,data=X)
Fvals <- numeric(1000)
for (i in 1:1000) {
X.boot <- X[sample(1:nrow(X),replace=TRUE),]
Fvals[i] <- anova(lm(b~c,data=X.boot))$"F value"[1]
}
hist(Fvals)
I am grateful for the assistance but the code does not provide what I
need. I need the 1000 pseudodatasets produced by t...
2007 Nov 22
3
anova planned comparisons/contrasts
...)
G3Mean = mean(Var[Group %in% G3])
MScontr = (nG1 * ((G1Mean - GrandMean)^2) +
nG2 * ((G2Mean - GrandMean)^2) +
nG3 * ((G3Mean - GrandMean)^2))/2
}
An <- anova(lm(Var ~ Group))
MSwithin = An[3]['Residuals',]
DegF = An$Df[length(An$Df)]
Fval = MScontr / MSwithin
Pval = 1 - pf(Fval, 1, DegF)
return (list(MS_contrasts = MScontr, MS_within = MSwithin,
F_value = Fval, P_value = Pval))
}
## The first two contrasts produce the same (+/- rounding error)
## p-values as obtained using contrasts()
MyContrast(sugars$length, sug...
2008 Sep 12
0
[LLVMdev] Selection Condition Codes
...nal move.
"setOperationAction(ISD::SELECT_CC , MVT::Other, Expand);"
should do the trick; that will prevent SELECT_CC instructions from
being introduced. This one is easy to miss.
> def CMOVLOG : InstFormat<(outs GPR:$dst), (ins GPR:$LHS, GPR:$RHS,
> GPR:$TVAL, GPR:$FVAL, CCOp:$cond),
The condition isn't properly an input... this seems likely to confuse
ISel. I'm not sure, though; I'm not really an expert on patterns, and
they can mess up in non-obvious ways.
> Maybe I'm approaching this from the wrong way, but I don't think this
> tran...
2008 Sep 12
2
[LLVMdev] Selection Condition Codes
...nal
move.
"setOperationAction(ISD::SELECT_CC , MVT::Other, Expand);"
should do the trick; that will prevent SELECT_CC instructions from
being introduced. This one is easy to miss.
> def CMOVLOG : InstFormat<(outs GPR:$dst), (ins GPR:$LHS, GPR:$RHS,
> GPR:$TVAL, GPR:$FVAL, CCOp:$cond),
The condition isn't properly an input... this seems likely to confuse
ISel. I'm not sure, though; I'm not really an expert on patterns, and
they can mess up in non-obvious ways.
> Maybe I'm approaching this from the wrong way, but I don't think this
> tran...