search for: inv

Displaying 20 results from an estimated 264 matches for "inv".

Did you mean: int
2013 Jan 11
0
Manual two-way demeaning of unbalanced panel data (Wansbeek/Kapteyn transformation)
...lt;- 1 D1<-data.frame() for(t in tim){ D1<-rbind(D1,I_N) } D1<-data.matrix(D1[as.vector(table(i.ind,t.ind))==1,]) D2<-data.frame() for(i in nam){ D2<-rbind(D2,I_T) } D2<-data.matrix(D2[as.vector(table(t.ind,i.ind))==1,]) D<-data.matrix(cbind(D1,D2)) Q<-I-D%*%ginv(crossprod(D))%*%t(D)#fQ(D1)-fQ(D1)%*%D2%*%ginv(t(D2)%*%fQ(D1)%*%D2)%*%t(D2)%*%fQ(D1) Q } ############################## library(plm) library(lmtest) data(Grunfeld) y_i<-Grunfeld$inv-ave(Grunfeld$inv,index=Grunfeld$firm) y_t<-Grunfeld$inv-ave(Grunfeld$inv,index=Grunfeld$year) y_it<-(...
2010 Dec 06
1
waldtest and nested models - poolability (parameter stability)
...dtest recognize the nesting. Here's the lines I run: (BTW, I try to use robust standard errors because what I normally use (glm.binomial.disp) to correct for overdispersion does not converge for the unpooled model. But this is another story....) # poolability for leva.fin03.d # pooled model inv.log.leva.base = glm(mix.au.bin ~ cat.gap.tot + leva.fin03.d + ... + sud0nord1, data = inv.sub.au, family = binomial, maxit = 1000) # I deleted almost all variables to make the line more readable # overdispersed pooled model - NOT THE PROBLEM NOW inv.log.leva.base.disp = glm.binomial.disp(inv.log...
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{} secti...
2006 Jul 17
1
sem: negative parameter variances
...ies. 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 capita, spatial lag on GRP growth + some additional explanatory variables to control for regional disparities), where spatial lag on GRP growth in year t is simply spatial weights matrix W(n*n) (weights - are inverse square distances between regional centers;...
2005 Mar 24
3
Caching computation in rails?
...n rails? Simple example: factorial modulus a large number input: integer x output: factorial( x ) % 12345678901234567 I want it so that if it computes factorial of N once, it will not have to compute for N again. code: class SiteController < ApplicationController caches_action :factorial, :inv def examine @inv = @params[''inv''] @outv = factorial @inv.to_i end def factorial( inv ) y=1 while (inv > 0) do y*=inv inv-=1 end (y % 12345678901234567) end end I am running in production mode so caching should be enabled.
2010 Jan 31
3
combining data frames in a list - how do I add breaks?
...s 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 get the following list, as output to a CSV: object.RMSE object.R2 object.RMSE.1object.R2.1 WA.inv 0.321543059 0.86388897 0.350494954 0.882600618 WA.cla 0.345947482 0.86388897 0.373078015 0.882600618 WA.inv.tol 0.308649941 0.874585589 0.336975196 0.89148291 WA.cla.tol 0.330038831 0.874585589 0.356895789 0.89148291 Obviously if I run thousands of iterations this continues on to the...
2012 Aug 28
4
predict.lm(...,type="terms") question
Hello all, How do I actually use the output of predict.lm(..., type="terms") to predict new term values from new response values? I'm a chromatographer trying to use R (2.15.1) for one of the most common calculations in that business: - Given several chromatographic peak areas measured for control samples containing a molecule at known (increasing) concentrations, first
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 -358.30 150.92 286.68 252.96 -334.09 -267.78 =358.30 -334.09 475.22 inv(x)*x = I(4)...
2011 Jul 09
2
Meta-analysis with zero values for mean and sd. Continuous data.
...up the case by Family (byvar=Family). ¿Can you help me? Thanks! > datos<-read.table(file="datos_totales.csv",head=TRUE,sep=",",dec=",") > datos[10:20,] Study ControlN ControlMean ControlSD TreatedN TreatedMean TreatedSD Family 10 Ali.Gmb.S1.Inv 3 893.3333 180.36999 3 1213.33333 410.52812 Capitellidae 11 Ali.Gmb.S2.Inv 3 640.0000 348.71192 3 666.66667 220.30282 Capitellidae 12 Ali.Gmb.S3.Inv 3 426.6667 184.75209 3 920.00000 628.64935 Capitellidae 13 Ali.Cul.S1.Ver 3 213.3333...
2012 Aug 07
2
Error using ddply inside user-defined function
...cause 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, 870307, 552681 , 0, 0 , 163831 , 400161 , 353000, 358322 , 489969, 147379, 1022769) FBCTS.REC.TOT <- c(0 , 0, 1638818 ,297119 , 299436 ,414164 , 515735, 529001 , 0, 0 , 427341 , 625893 ,437854 , 407091, 425119 ,...
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 > version _ platform i686-...
2004 Jul 12
6
proportions confidence intervals
Dear R users this may be a simple question - but i would appreciate any thoughts does anyone know how you would get one lower and one upper confidence interval for a set of data that consists of proportions. i.e. taking a usual confidence interval for normal data would result in the lower confidence interval being negative - which is not possible given the data (which is constrained between
2011 Apr 19
4
Simple question about symbols()
...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", xlab="aa", ylab="bb", add=TRUE) and i want the bg color to be red if c=1 and blue if c=0. thanks, Murilo -- View this message in context: http://r.789695.n4.nabble.com/Simple-question-about-symb...
2010 Jan 07
1
faster GLS code
...# matrix of exogenous #### MODEL ESTIMATION ### # build the big X matrix needed for GLS estimation: X <- kronecker(diag(1,3),x) Y <- c(y) # stack the y in a vector # residual covariance matrix for each observation covar <- kronecker(sigma,diag(1,N)) # GLS betas covariance matrix inv.sigma <- solve(covar) betav <- solve(t(X)%*%inv.sigma%*%X) # GLS mean parameter estimates betam <- betav%*%t(X)%*%inv.sigma%*%Y ----- end of code ----
2005 Jul 08
5
Help with Mahalanobis
...with R from 'iris' data? Well, I think that the basic soluction to calculate this distances is: # # --- Begin R script 1 --- # x = as.matrix(iris[,1:4]) tra = iris[,5] man = manova(x ~ tra) # Mahalanobis E = summary(man)$SS[2] #Matrix E S = as.matrix(E$Residuals)/man$df.residual InvS = solve(S) ms = matrix(unlist(by(x, tra, mean)), byrow=T, ncol=ncol(x)) colnames(ms) = names(iris[1:4]) rownames(ms) = c('Set', 'Ver', 'Vir') D2.12 = (ms[1,] - ms[2,])%*%InvS%*%(ms[1,] - ms[2,]) print(D2.12) D2.13 = (ms[1,] - ms[3,])%*%InvS%*%(ms[1,] - ms[3,]) print(D2.13)...
2001 Apr 09
4
fastest R platform
...nd Graphical Statistics, 9, 491-508. I have coded a simulation program which runs at 1/5 the speed of minimum usability on a Pentium 700 PC (windows me). I have spent quite some time trying to optimize the program. So my question is: on which platform does R run the fastest? I would be willing to invest on a faster platform. Thanks in advance. My program follows in case someone can help me improve it. Thanks. Jason # Liao and Lipsitz (2001) # A REML type estimate of variance components in generalized linear mixed models # This program runs on R. It does not run on S-plus. rm(list=ls(all=...
2011 Apr 03
0
Avoiding loops in creating a coinvestment matrix
Hi, I am working on a dataset in which a number of venture capitalists invest in a number of firms. What I am creating is an asymmetric matrix M in which m(ij) is the volume (sum) of coinvestments of VC i with VC j (i.e., how much has VC i invested in companies that VC j also has investments in). The output should look like the "coinvestments" matrix produced wi...
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 M)')'%*% (inverse of M)', i.e. if define B = transpose of (inverse of M...
2009 Dec 11
2
Regularized gamma function/ incomplete gamma function
...ou could help me with: Given the regularized gamma function Reg=int_0^r (x^(k-1)e^(-x))dx/int_0^Inf (x^(k-1)e^(-x))dx ; 0<r<Inf (which is eventually the ratio of the Incomplete gamma function by the gamma function), does anyone know of a package in R that would evaluate the derivative of the inverse of Reg with respect to k? I am aware that the function "Rgamma.inv" of the package "Zipfr" evaluates the inverse of Reg and I'm wondering wether there is a function that would evaluate the derivative of the inverse.. Alternatively, a good numerical integration package/...
2012 Apr 25
2
GFI en modelos estructurales con lavaan
Se ha borrado un adjunto en formato HTML... URL: <https://stat.ethz.ch/pipermail/r-help-es/attachments/20120425/dafc9a68/attachment.html>