Hi all,
Is there a way to do a matrix multiplication in a faster way?
I am making a product of a matrix (composed of a lot of dummy variables) and a
vector, and is there any way to make it faster?
The simple X %*% y takes too long a time.
I know using sparse matrix would help, but don't kno
Hi,
Is it possible to assign to an array with different dimensions?
That is to say, supposing a three dimensional array,
the third dimension of the array has matrices of different sizes?
> array
, , 1
[1] [2] [3]
[1] 111
, , 2
[1] [2] [3]
[1] 111
[2] 11
they are and work with
> them. This is probably where most of your time is being spent. So if
> you start with matrices and leave the dataframes out of the main loop
> you will probably see an increase in performance.
>
> 2009/11/2 parkbomee :
> > This is the Rprof(
st" 9.64 1.7 9.64 1.7
"exp"7.12 1.2 7.12 1.2
"as.data.frame.integer" 5.98 1.0 8.10 1.4
> To: bbom...@hotmail.com
> CC: jholt...@gmail.com; r-help@r-project.org
> Subject
time trying to
> optimize the function than just running the current version even if it
> is "slow" (slow is a relative term and does not hold much meaning
> without some context round it).
>
> On Sat, Oct 31, 2009 at 11:36 PM, parkbomee wrote:
> >
> >
ith(DF, {
> >ind <- choice == 1
> >n <- tapply(value[ind], time[ind], sum)
> >d <- tapply(value, time, sum)
> >n / d
> > })
> >
> >
> > I hope it helps.
> >
> > Best,
> > Dimitris
> >
> >
>
Hi all,
I am trying to figure out a way to improve my code's efficiency by avoiding the
use of loop.
I want to calculate a conditional mean(?) given time.
For example, from the data below, I want to calculate
sum((value|choice==1)/sum(value)) across time.
Is there a way to do it without using a
hotmail.com
> CC: r-help@r-project.org
> Subject: Re: [R] Efficient way to code using optim()
> From: gpet...@uark.edu
>
>
> Unless this is a homework problem, you would be much better off using
> glm().
>
> Giovanni
>
> > Date: Fri, 30 Oct 2009 12:23:45 -0700
&g
Hi all,
I am trying to estimate a simple logit model.
By using MLE, I am maximizing the log likelihood, with optim().
The thing is, each observation has different set of choice options, so I need a
loop inside the objective function,
which I think slows down the optimization process.
The data
Hi everyone,
I am running this fixed effects model in R.
The thing is, my own code and the canned routine keep returning different
estimates for the fixed effects factors and intercept.
(The other variables' estimates and R^2 are the same!!! weird!!)
I attach my own code, just in case.
I am pre
10 matches
Mail list logo