Displaying 20 results from an estimated 1000 matches similar to: "Caching computation in rails?"
2005 Mar 26
2
ActiveRecord help needed
Hello, my name is Magnus and I am a RoR-newbie. I am trying to get the
grip of ActiveRecord but I am having trouble to find good examples.
I have been looking at this:
http://wiki.rubyonrails.com/rails/show/AccessControlListExample
Where you can find this Model code:
require ''active_record''
class Permission < ActiveRecord::Base
has_and_belongs_to_many :roles
end
2010 Dec 06
1
waldtest and nested models - poolability (parameter stability)
Dear All,
I'm trying to use waldtest to test poolability (parameter stability) between
two logistic regressions. Because I need to use robust standard errors
(using sandwich), I cannot use anova. anova has no problems running the
test, but waldtest does, indipendently of specifying vcov or not. waldtest
does not appear to see that my models are nested. H0 in my case is the the
vector of
2006 Jul 17
1
sem: negative parameter variances
Dear Spencer and Prof. Fox,
Thank you for your replies. I'll very appreciate, if you have any ideas concerning the problem described below.
First, I'd like to describe the model in brief.
In general I consider a model with three equations.
First one is for annual GRP growth - in general it looks like:
1) GRP growth per capita = G(investment, migration, initial GRP per
2011 Jan 16
1
\examples{} in Rd file
[Hope this is the right list where to send...]
An attempt to update package 'mnormt' involves the addition of a
small new function called 'pd.solve'. When I come to the package
checking stage, an error occurs in parsing pd.solve.Rd.
The full transcript of the outcome is copied below (it includes details
on my installation) but the critical point is where the \examples{}
section
2011 Jul 09
2
Meta-analysis with zero values for mean and sd. Continuous data.
Hi,
I want to do a meta-analysis with count data for treatement/control cases.
Mi problem is that I need to use zero values (an informative zero value) for
the mean and standard deviation for one of the treatement, but R has a
problem: "Studies with zero values for sd.e or sd.c get no weight in
meta-analysis". I can agroup the case by Family (byvar=Family).
¿Can you help me? Thanks!
2012 Aug 07
2
Error using ddply inside user-defined function
Hi All,
I *think* it's ddply because the function recognizes vr1, etc, in other
parts of the function.
Here's some code:
# create dataset
PROV.PM.FBCTS <- c(0.00 ,0.00, 33205.19, 25994.56, 23351.37, 26959.56
,27632.58, 26076.24, 0.00, 0.00 , 6741.42, 18665.09 ,18129.59 ,21468.39
,21294.60 ,22764.82, 26076.73)
FBCTS.INV.TOT <- c(0 , 0, 958612, 487990, 413344, 573347,
2010 Jan 31
3
combining data frames in a list - how do I add breaks?
I'm a week-old R user, and have become stuck trying to create usable CSV
outputs for post-processing. I am using the package Rioja, which provides
small datasets of results. I am running several analyses in a loop and
iteratively adding the results to a *list* ("combined"). Within each
iteration I use the following:
> combined[[i]] <- performance(fit)
With two iterations I
2017 Aug 23
1
cross validation in random forest using rfcv functin
Hi all,
I would like to do cross validation in random forest using rfcv function. As the documentation for this package says:
rfcv(trainx, trainy, cv.fold=5, scale="log", step=0.5, mtry=function(p) max(1, floor(sqrt(p))), recursive=FALSE, ...)
however I don't know how to build trianx and trainy for my data set, and I could not understand the way trainx is built in the package
2012 Jul 31
1
about changing order of Choleski factorization and inverse operation of a matrix
Dear All,
My question is simple but I need someone to help me out.
Suppose I have a positive definite matrix A.
The funtion chol() gives matrix L, such that A = L'L.
The inverse of A, say A.inv, is also positive definite and can be
factorized as A.inv = M'M.
Then
A = inverse of (A.inv) = inverse of (M'M) = (inverse of M) %*%
(inverse of M)'
= ((inverse of
2011 Apr 19
4
Simple question about symbols()
I'm new to R and i'm having some trouble with a bubble chart.
Basically I have 3 series (a,b,c), but the third one is a binnary variable
(assumes only 0 or 1 to the entire data).
How can I use these binnary information to make 2 different colours in a
bubble chart?. I.e., I'm using this code:
symbols(inv$a, inv$b, circles=radius, inches=0.35, fg="white",
bg="red",
2010 Jan 07
1
faster GLS code
Dear helpers,
I wrote a code which estimates a multi-equation model with generalized
least squares (GLS). I can use GLS because I know the covariance matrix of
the residuals a priori. However, it is a bit slow and I wonder if anybody
would be able to point out a way to make it faster (it is part of a bigger
code and needs to run several times).
Any suggestion would be greatly appreciated.
Carlo
2012 Jun 15
2
Looking for Speed in a Toy Simulation Example
Dear List Members
I used to play around with R to answer the following question by
simulation (I am aware there is an easy explicit solution, but this is
intended to serve as instructional example).
Suppose you have a poker game with 6 players and a deck of 52 cards.
Compute the empirical frequencies of having a single-suit hand. The
way I want the result structured is a boolean nosimulation
2009 Jan 30
3
Matlab inv() and R solve() differences
I submit the following matrix to both MATLAB and R
x= 0.133 0.254 -0.214 0.116
0.254 0.623 -0.674 0.139
-0.214 -0.674 0.910 0.011
0.116 0.139 0.011 0.180
MATLAB's inv(x) provides the following
137.21 -50.68 -4.70 -46.42
-120.71 27.28 -8.94 62.19
-58.15 6.93 -7.89 36.94
8.35 11.17 10.42 -14.82
R's solve(x) provides:
261.94 116.22 150.92 -267.78
116.22 344.30 286.68
2002 Dec 25
2
inv.logit (package boot) (PR#2394)
Full_Name: Ole Christensen
Version: 1.6.1
OS: linux-gnu
Submission from: (NULL) (130.225.18.176)
In package boot :
> inv.logit(800)
[1] NaN
where it should have been 1.
The problem is caused by exp(x) returning Inf when x is large.
One way of fixing the problem [there may be better ways] would be to include the
line
out[x > 709] <- 1
in inv.logit()
Cheers Ole
>
2008 Nov 06
1
trouble with for loop
Hello,
I'm having two similar problems with for loop and I would appreciate
any help or comment.
I want to use "for loop" to calculate series of initial values for an
optimization problem. But
some initial values have my function quit due to problems like
calculating the inverse of singular
matrices. I don't want to make my program check determinants and skip it if it
is
2001 Apr 09
4
fastest R platform
Hello, everyone! I picked up R several months ago and have adopted it
as my choice for statistical programming. Coming from a Java
background, I can honestly say that R is not only free, it is better
tha S-plus: the lexical scope in R makes it very simple to simulate
Java's object model. For this, I encourage everyone to read the artcle:
Robert Gentleman and Ross Ihaka (2000) "Lexical
2011 Aug 04
1
Running a column loop through the Moran.I function.
Dear R users,
I have two data frames that consist of statistical information for most
countries around the world. One dataframe consists of the latitude and
longitude ("coord.csv") of each country, while the other consists of 100's
of different attributes ("countryattri.csv") for each country (like, GDP,
Population, etc.). The data is organized with a header and then
2017 Aug 23
2
cross validation in random forest rfcv functin
Hi all,
I would like to do cross validation in random forest using rfcv function. As the documentation for this package says:
rfcv(trainx, trainy, cv.fold=5, scale="log", step=0.5, mtry=function(p) max(1, floor(sqrt(p))), recursive=FALSE, ...)
however I don't know how to build trianx and trainy for my data set, and I could not understand the way trainx is built in the package
2003 Jul 06
1
Conditional Distribution of MVN variates
Hi Folks,
Given k RVs with MVN distribution N(mu,S) (S a kxk covariance matrix),
let (w.l.o.g.) X1 denote the first r of them, and X2 the last (k-r).
Likewise, let mu1 and mu2 denote their respective expectations.
Then, of course, the expectation of X2 given X1=x1 is
mu2 + S21*inv(S22)*(x1 - mu1)
and the covariance matrix of X2 given X1=x2 is
S22 - S21*inv(X11)*S12
where Sij is the
2007 Mar 15
1
asterisk n-way call problem
Hi,
i am using the n-way-call dialplan solution found on voip-info. i have
added its entry in applicationmap of features.conf file. the problem
is......its not working. to activate the n-way call i dial *0 but nothing
happens. i have played around with dtmf and codec settings but no success.
the extensions and sip configuration is below if you want to have a look. I
dont have any clue why its not