Displaying 20 results from an estimated 500 matches similar to: "Using capture.output within a function"
2011 Apr 28
1
DLSODA error
Dear R-users,
I'm running an MLE procedure where some ODEs are solved for each iteration
in the maximization process. I use mle2 for the Maximum likelihood and
deSolve for the ODEs.
The problem is that somewhere along the way the ODE solver crashes and I get
the following error message:
DLSODA- Warning..Internal T (=R1) and H (=R2)
are
such that in the machine, T + H = T on the next
2011 Mar 31
0
dfsane arguments
Hi there,
I'm trying to solve 2 nonlinear equations in 2 unknowns using the BB
package.
The first part of my program solves 3 ODEs using the deSolve package. This
part works. The output is used as parameter values in the functions I need
to solve.
The second part is to solve 2 equations in 2 unknowns. This does not work. I
get the error message "unexpected end of input". So what
2006 Jun 06
1
Problems using quadprog for solving quadratic programming problem
Hi,
I'm using the package quadprog to solve the following quadratic programming problem.
I want to minimize the function
(b_1-b_2)^2+(b_3-b_4)^2
by the following constraints b_i, i=1,...,4:
b_1+b_3=1
b_2+b_4=1
0.1<=b_1<=0.2
0.2<=b_2<=0.4
0.8<=b_3<=0.9
0.6<=b_4<=0.8
In my opinion the solution should be b_1=b_2=0.2 und b_3=b_4=0.8.
Unfortunately R doesn't find
2006 Nov 07
1
gamm(): nested tensor product smooths
I'd like to compare tests based on the mixed model representation of additive models, testing among others
y=f(x1)+f(x2) vs y=f(x1)+f(x2)+f(x1,x2)
(testing for additivity)
In mixed model representation, where X represents the unpenalized part of the spline functions and Z the "wiggly" parts, this would be:
y=X%*%beta+ Z_1%*%b_1+ Z_2%*%b_2
vs
y=X%*%beta+ Z_1%*%b_1+ Z_2%*%b_2 + Z_12
2013 Mar 05
2
Issues when using interaction term with a lagged variable
Hi there!
Today I tried to estimate models using both plm and pgmm functions, with an
interaction between X1 and lag(X2, 1). And I notice two issues.
Let "Y=b_1 * X_1 + b_2 * X_2 + b_3 * X_1 * x_2 + e" be our model.
1) When using plm, I got different results when I coded the interaction
term with I(X1 * lag(X2, 1)) and when I just saved this multiplication X1 *
lag(X2, 1) in a
2010 Jan 19
1
change codes into loops
Hi,
See example.
for (i in 1:2) {
for (j in 1:3) {
b_1[i,j]<-rank(c(a1[i,j],a2[i,j],a3[i,j]))[1]
b_2[i,j]<-rank(c(a1[i,j],a2[i,j],a3[i,j]))[2]
b_3[i,j]<-rank(c(a1[i,j],a2[i,j],a3[i,j]))[3]
}
}
The inner codes is really repeated, so i want to change the inner codes
into loops. Take nn is from 1 to 3,
something like,
for (nn in 1:3) {
2011 Apr 16
1
spatstat regression troubles
Hi Everyone,
I am trying to figure out the spatstat package for the first time and am having some trouble. Unfortunately, I can't post my data set but I'll hopefully post enough details for some help.
I want to model the intensity of a spatial point process using 2 covariates from my data. After reading through the documentation, I have successfully created 2 "ppp" objects. The
2011 Dec 05
1
Summary coefficients give NA values because of singularities
Hello,
I have a data set which I am using to find a model with the most significant
parameters included and most importantly, the p-values. The full model is
of the form:
sad[,1]~b_1 sad[,2]+b_2 sad[,3]+b_3 sad[,4]+b_4 sad[,5]+b_5 sad[,6]+b_6
sad[,7]+b_7 sad[,8]+b_8 sad[,9]+b_9 sad[,10],
where the 9 variables on the right hand side are all indicator variables.
The thing I don't understand
2005 Oct 13
3
Do Users of Nonlinear Mixed Effects Models Know Whether Their Software Really Works?
Do Users of Nonlinear Mixed Effects Models Know
Whether Their Software Really Works?
Lesaffre et. al. (Appl. Statist. (2001) 50, Part3, pp 325-335)
analyzed
some simple clinical trials data using a logistic random effects
model. Several packages and methods MIXOR, SAS NLMIXED were employed.
They reported obtaining very different parameter estimates and
P
2011 Dec 07
1
Output table from for loop
Hi, this might be basic but can't get it to work and it is hampering my R
usage:
#the loop is checking variance of rows, and cutting out rows with
var>numVec[i]
#I define outMat as object names I want to output to (does this make sense?
how else
#can I define sequential numbered output?)
#numVec is numbers I use in the loop
head(Counts)
AN1 AN2 AN3 AN4 var
GENE1
2011 Jan 03
0
Greetings. I have a question with mixed beta regression model in nlme (corrected version).
*Dear R-help:
My name is Rodrigo and I have a question with nlme package
in R to fit a mixed beta regression model. I'm so sorry. In the last
email, I forgot to say that W is also a unknown parameter in the mixed
beta regression model. In any case, here I send you the correct formulation.
**
Suppose that:*
*j in {1, ..., J}* *(level 1)*
*i in {1, ..., n_j}* *(level 2)*
*y_{ij} ~
2012 Feb 29
2
How to replace the values in a column
Dear All,
I've been searching relevant topics about replacing values, none seemed to
be applicable to me...
I have a file with many many varieties, and want to replace some of them
into different names.
I tried various of ways, still don't know how to do that most efficiently..
Here is part of the example data:
Gen Rep
A_1 1
A_1 2
A_2 1
A_2 2
B_1 1
B_1
2011 Jan 03
1
Greetings. I have a question with mixed beta regression model in nlme.
*Dear R-help:
My name is Rodrigo and I have a question with nlme package
in R to fit a mixed beta regression model. The details of the model are:
Suppose that:*
*j in {1, ..., J}* *(level 1)*
*i in {1, ..., n_j}* *(level 2)*
*y_{ij} ~ Beta(mu_{ij} * phi_{ij}; (1 - mu_{ij}) * phi_{ij})
y_{ij} = mu_{ij} + w_{ij}
*
*with*
*logit(mu_{ij}) = Beta_{0i} + Beta_{1i} * x1_{ij} + b2 * x2_{ij}
2013 Oct 23
0
[LLVMdev] First attempt at recognizing pointer reduction
On Oct 23, 2013, at 3:10 PM, Renato Golin <renato.golin at linaro.org> wrote:
> On 23 October 2013 16:05, Arnold Schwaighofer <aschwaighofer at apple.com> wrote:
> In the examples you gave there are no reduction variables in the loop vectorizer’s sense. But, they all have memory accesses that are strided.
>
> This is what I don't get. As far as I understood, a
2013 Oct 23
2
[LLVMdev] First attempt at recognizing pointer reduction
On 23 October 2013 16:05, Arnold Schwaighofer <aschwaighofer at apple.com>wrote:
> In the examples you gave there are no reduction variables in the loop
> vectorizer’s sense. But, they all have memory accesses that are strided.
>
This is what I don't get. As far as I understood, a reduction variable is
the one that aggregates the computation done by the loop, and is used
2012 May 09
1
reception of (Vegan) envfit analysis by manuscript reviewers
I'm getting lots of grief from reviewers about figures generated with
the envfit function in the Vegan package. Has anyone else struggled to
effectively explain this analysis? If so, can you share any helpful
tips?
The most recent comment I've gotten back: "What this shows is which
NMDS axis separates the communities, not the relationship between the
edaphic factor and the
2006 Aug 24
1
lmer(): specifying i.i.d random slopes for multiple covariates
Dear readers,
Is it possible to specify a model
y=X %*% beta + Z %*% b ; b=(b_1,..,b_k) and b_i~N(0,v^2) for i=1,..,k
that is, a model where the random slopes for different covariates are i.i.d., in lmer() and how?
In lme() one needs a constant grouping factor (e.g.: all=rep(1,n)) and would then specify:
lme(fixed= y~X, random= list(all=pdIdent(~Z-1)) ) ,
that?s how it's done in the
2007 Mar 05
1
Heteroskedastic Time Series
Hi R-helpers,
I'm new to time series modelling, but my requirement seems to fall just
outside the capabilities of the arima function in R. I'd like to fit an
ARMA model where the variance of the disturbances is a function of some
exogenous variable. So something like:
Y_t = a_0 + a_1 * Y_(t-1) +...+ a_p * Y_(t-p) + b_1 * e_(t-1) +...+ b_q *
e_(t-q) + e_t,
where
e_t ~ N(0, sigma^2_t),
2012 Oct 11
2
model selection with spg and AIC (or, convert list to fitted model object)
Dear R Help,
I have two nested negative log-likelihood functions that I am optimizing
with the spg function [BB package]. I would like to perform model
selection on these two objective functions using AIC (and possibly
anova() too). However, the spg() function returns a list and I need a
fitted model object for AIC(), ICtab() [bbmle package], or anova().
How can I perform AIC-based model
2007 Apr 30
1
ROracle issues
Hi all -
I am trying to install ROracle for linux machines ... I have read the
INSTALL documentation and followed the directions for setting the paths
as follows:
export PATH=/app/oracle/product/10.2.0/db_1/bin:$PATH
[manthony@diamondback ~]$ export
LD_LIBRARY_PATH=/usr/lib:/usr/lib64:/lib:/app/oracle/product/10.1.0/db_1