Displaying 20 results from an estimated 2000 matches similar to: "ifthen() question"
2010 Mar 04
0
ifthen() question -- whoops--ifelse()
OK, I got it figured out. I was not keying into a length greater than 1, so:
# I added this object and placed it into the iftelse statement:
lid <- sum(match(id, st[i], nomatch = 0))
out$var.g[i]<-ifelse(lid ==1, meta$var.g[id==st[i]],
aggs(g=g[id==st[i]],
n.1= n.1[id==st[i]],
n.2 = n.2[id==st[i]], cor)[2])
#full
2011 Sep 08
1
predict.rma (metafor package)
Hi
(R 2.13.1, OSX 10.6.8)
I am trying to use predict.rma with continuous and categorical variables. The argument newmods in predict.rma seems to handle coviariates, but appears to falter on factors. While I realise that the coefficients for factors provide the answers, the goal is to eventually use predict.rma with ANCOVA type model with an interaction.
Here is a self contained example
2012 Nov 22
1
help in M-estimator by R
hi guys and gals ... How are you all ...
i have to do something in robust regression by R programm , and i have some
problems as following:
*the first :*
suppose
w(r) =1/(1 r^2) and r <- c(7.01,2.07,7.061,5.607,8.502,54.909,12.222)
and i want to exclude some values from r so that (abs(r)>4.9 )...
after ,i want to used (w) to get on coefficients beta0 and beta1 (B1 <-
2008 Oct 03
1
Error message in ifthen else
Hi,
I came across the below error when I try to do ifelse condition:-
Error in "[<-"(`*tmp*`, test, value = rep(yes, length = length(ans))[test])
:
incompatible types
What I am trying to accomplish is :-
for(x in 1:ncol(filterpred)){
sumno<-sum(filterpred[no,x])
sumyes<-sum(filterpred[yes,x])
ifelse(sumno==0 && sumyes !=0,
2012 Jul 03
2
EM algorithm to find MLE of coeff in mixed effects model
I have a general question about coefficients estimation of the mixed model.
I simulated a very basic model: Y|b=X*\beta+Z*b +\sigma^2* diag(ni);
b follows
N(0,\psi) #i.e. bivariate normal
where b is the latent variable, Z and X are ni*2 design matrices, sigma is
the error variance,
Y are longitudinal data, i.e. there are ni
2007 Apr 09
1
R:Maximum likelihood estimation using BHHH and BFGS
Dear R users,
I am new to R. I would like to find *maximum likelihood estimators for psi
and alpha* based on the following *log likelihood function*, c is
consumption data comprising 148 entries:
fn<-function(c,psi,alpha)
{
s1<-sum(for(i in 1:n){(c[i]-(psi^(-1/alpha)*(lag(c[i],-1))))^2*
(lag(c[i],-1)^((-2)*(alpha+1))
)});
s2<- sum(for(m in 1:n){log(lag(c[m],-1)^(((2)*alpha)+2))});
2016 Aug 19
3
multiple domain and winbind use default domain
Hello
I'm preparing a new fileserver, based on jessie + sernet 4.2.10
packages. the server is bound to a forest, "AD" where users account are
stored, and subdomains "PSI" for computers and some local accounts
The Active directory forest is managed by 2008R2 servers, with rfc2307
attributs filled for accounts.
I'm using "winbind use default domain" because
2009 Aug 12
1
psi not functioning in nlrob?
Hi all,
I'm trying to fit a nonlinear regression by "nlrob":
model3=nlrob(y~a1*x^a2,data=transient,psi=psi.bisquare,
start=list(a1=0.02,a2=0.7),maxit=1000)
However an error message keeps popping up saying that the function
psi.bisquare doesn't exist.
I also tried psi.huber, which is supposed to be the default for nlrob:
model3=nlrob(y~a1*x^a2,data=transient,psi=psi.huber,
2010 May 24
2
How to set parameters constraints in a function?
Dear R list,
I have a function specifying my log-likelihood, and now I need to set the
constraint that *alpha > kappa*, could anyone help me with setting this in
my function?
the function is defined as follows:
mll <- function(param){
n <- length(x)
psi <- numeric(n)
psi[1] <- 1.0
a0 <- exp(param[1]); a1 <-exp(param[2]); b1 <- exp(param[3]); *alpha *<-
2011 Apr 10
1
MLE where loglikelihood function is a function of numerical solutions
Hi there,
I'm trying to solve a ML problem where the likelihood function is a function
of two numerical procedures and I'm having some problems figuring out how to
do this.
The log-likelihood function is of the form L(c,psi) = 1/T sum [log (f(c,
psi)) - log(g(c,psi))], where c is a 2xT matrix of data and psi is the
parameter vector. f(c, psi) is the transition density which can be
2019 Feb 27
2
RFC: Getting ProfileSummaryInfo and BlockFrequencyInfo from various types of passes under the new pass manager
Hi all,
To implement more profile-guided optimizations, we’d like to use
ProfileSummaryInfo (PSI) and BlockFrequencyInfo (BFI) from more passes of
various types, under the new pass manager.
The following is what we came up with. Would appreciate feedback. Thanks.
Issue
It’s not obvious (to me) how to best do this, given that we cannot request
an outer-scope analysis result from an inner-scope
2012 Jul 18
1
How does "rlm" in R decide its "w" weights for each IRLS iteration?
Hi all,
I am also confused about the manual:
a. The input arguments:
wt.method are the weights case weights (giving the relative importance of
case, so a weight of 2 means there are two of these) or the inverse of the
variances, so a weight of two means this error is half as variable?
w (optional) initial down-weighting for each case.
init (optional) initial values for the
2019 Mar 13
2
RFC: Getting ProfileSummaryInfo and BlockFrequencyInfo from various types of passes under the new pass manager
Overall seems fine to me.
On 3/11/19 8:12 PM, Hiroshi Yamauchi wrote:
> Here's a revised approach based on the discussion:
>
> - Cache PSI right after the profile summary in the IR is written in
> the pass pipeline. This would avoid the need to insert
> RequireAnalysisPass for PSI before each non-module pass that needs it.
> PSI can be technically invalidated but unlikely
2009 Aug 17
2
Newbie that don't understand R code
I got some R code that I don't understand.
Question as comment in code
//where is t comming from, what is phi inverse
rAC <- function(name, n, d, theta){
#generic function for Archimedean copula simulation
illegalpar <- switch(name,
clayton = (theta < 0),
gumbel = (theta < 1),
frank = (theta < 0),
BB9 = ((theta[1] < 1) | (theta[2] < 0)),
GIG = ((theta[2] < 0) |
2019 Mar 13
1
RFC: Getting ProfileSummaryInfo and BlockFrequencyInfo from various types of passes under the new pass manager
On 3/14/19 2:04 AM, Hiroshi Yamauchi wrote:
>
>
> On Wed, Mar 13, 2019 at 2:37 PM Fedor Sergeev <fedor.sergeev at azul.com
> <mailto:fedor.sergeev at azul.com>> wrote:
>
>>
>> - Add a new proxy ModuleAnalysisManagerLoopProxy for a loop pass
>> to be able to get to the ModuleAnalysisManager in one step and
>> PSI through it.
>
2007 Oct 13
2
the use of the .C function
Dear All,
could someone please shed some light on the use of the .C or .Fortran function:
I am trying load and running on R the following function
// psi.cpp -- psi function for real arguments.
// Algorithms and coefficient values from "Computation of Special
// Functions", Zhang and Jin, John Wiley and Sons, 1996.
//
// (C) 2003, C. Bond. All rights reserved.
//
//
2011 Nov 18
1
number of items to replace is not a multiple of replacement length
Hi all, following is my R -code and shows the error given below
> n <- 100
> k<-2
> x1 <-c(1, 3);x2 <- c(2,5)
> X <- matrix(c(0,0), nrow = 2, ncol = n)
> for(i in 1:k)
+ X[i, ] <- mh1.epidemic(n,x1[i],x2[i])
Error in X[i, ] <- mh1.epidemic(n,x1[i],x2[i]):
number of items to replace is not a multiple of replacement length
> psi <-t(apply(X, c(1,2),
2019 Mar 04
2
RFC: Getting ProfileSummaryInfo and BlockFrequencyInfo from various types of passes under the new pass manager
On 3/4/19 10:49 PM, Hiroshi Yamauchi wrote:
>
>
> On Mon, Mar 4, 2019 at 10:55 AM Hiroshi Yamauchi <yamauchi at google.com
> <mailto:yamauchi at google.com>> wrote:
>
>
>
> On Sat, Mar 2, 2019 at 12:58 AM Fedor Sergeev
> <fedor.sergeev at azul.com <mailto:fedor.sergeev at azul.com>> wrote:
>
>
>
> On 3/2/19 2:38 AM,
2008 Sep 06
1
Help use try function with boot
Hi R users,
Is is possible for me to use the try function with boot? I would to do
the bootstraping with a nonlinear model(it works well when R < 1000).
But it does not work very well (when R is large) thus I try to use
"try" to resolve. I put the try function in two cases:
case1: put the try in front of the boot
> c1.try<-try(boot(c1data, statistic = c1.fun,
2019 Mar 04
2
RFC: Getting ProfileSummaryInfo and BlockFrequencyInfo from various types of passes under the new pass manager
On Sat, Mar 2, 2019 at 12:58 AM Fedor Sergeev <fedor.sergeev at azul.com>
wrote:
>
>
> On 3/2/19 2:38 AM, Hiroshi Yamauchi wrote:
>
> Here's a sketch of the proposed approach for just one pass (but imagine
> more)
>
> https://reviews.llvm.org/D58845
>
> On Fri, Mar 1, 2019 at 12:54 PM Fedor Sergeev via llvm-dev <
> llvm-dev at lists.llvm.org>