search for: kaniovsk

Displaying 16 results from an estimated 16 matches for "kaniovsk".

Did you mean: kaniovski
2005 Nov 22
4
the matrix of rows with specific row sums
...and have the following problem: given a matrix of ones and zeroes, say mdim=4 m<-matrix(round(runif(mdim^mdim)),mdim,mdim) how to construct the matrix of those rows of m, whose elements sum to 2. Contrary to the random matrix above, the actual matrix always has at least one such row. Serguei Kaniovski
2006 Oct 27
3
How to best divide table by table
Hi all, how can I divide two tables of the same dimension so that all names are preserved, ie do not become NA? I have "tab1" and "tab2", each having names in the first column. I want "tab3" with the same names and values "tab1/tab2". Thanks, Serguei
2005 Dec 05
5
What is wrong with this FOR-loop?
Hi, I have a more complex example, but the problem boils down to this FOR-loop not filling in the res-matrix run_rows<-seq(0,1,0.05) run_cols<-seq(0.3,0.6,0.05) res<-matrix(NA,length(run_rows),length(run_cols)) for(i in run_rows) { for(j in run_cols) { res[i,j]=i+j #niether the above, nor res[[i,j]]=i+j work, why? } } Thank you, Serguei
2005 Dec 03
1
Correlation matrix from a vector of pairwise correlations
...corr(1,2)=0.1, corr(1,3)=0.2, corr(2,3)=0.3, corr(3,4)=0.4 How can I construct the corresponding correlation matrix? I tried using the "combn"-function in "combinat" package: library(combinat) combn(c(0.1,0.2,0.3,0.4),2) , but to no avail... Thank you for your help, Serguei Kaniovski -- ___________________________________________________________________ ??sterreichisches Institut f??r Wirtschaftsforschung (WIFO) Name: Serguei Kaniovski Postadresse: Postfach 91 Tel.: +43-1-7982601-231 A-1103 Wien Fax : +43-1-7989386 Stand...
2006 Oct 09
1
Coefficients of a factorized polynomial
Hi all, starting from a vector "v[1:n]" I would like to compute the coefficients of the polynomial (1+x^v[1])*(1+x^v[2])*...*(1+x^v[n]). The following code works but is extremely slow for a large "n" due to, I believe, the polynomial being factorized. I wanted to try the package "polynom" command "unclass" but I could not figure out how to input a
2006 Mar 03
3
Two quick questions
...where all three are integers? 2. I have a dataframe by date and sector. I would like to add-up all entries for all variable with identical date and sector, replacing the original entries, i.e. emulate the STATA command "collapse (sum) var1 var2 var3, by(date sector)". Thank you, Serguei Kaniovski
2005 Nov 23
2
vector of permutated products
...to do without temp1 and temp2. To have something like result<-apply(permat*x-(permat-1)*x,1,prod) My problem is that permat*x does not produce permat*temp1 due to the way the element-by-element multiplication works in R. Can you help to simplify the above code? Thank you in advance, Serguei Kaniovski -- ___________________________________________________________________ Austrian Institute of Economic Research (WIFO) Name: Serguei Kaniovski P.O.Box 91 Tel.: +43-1-7982601-243 Arsenal Objekt 20 Fax: +43-1-7989386 1103 Vienna, Austria Mail: Serguei.Kaniovski at wifo.ac.at http://www.wif...
2005 Dec 06
1
Help on a matrix task
Hello, Being new to R, I am completely stuck with the following problem. Please help to find a general solution to the following matrix task: Given: N<-4 input_mat<-matrix(c(1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0),ncol=N)
2006 Nov 08
0
Solving a maximization problem using QUADPROD
Hello, here is an example from the manual. How to turn this minimization problem into maximization problem, i.e. -(0 5 0) %*% b - 1/2 b^T b? # Assume we want to minimize: -(0 5 0) %*% b + 1/2 b^T b # under the constraints: A^T b >= b0 # with b0 = (-8,2,0)^T # and (-4 2 0) # A = (-3 1 -2) # ( 0 0 1) # we can use solve.QP.compact as follows: # library(quadprog) Dmat <- matrix(0,3,3)
2005 Nov 29
1
Constraints in Quadprog
...bvec, meq=0, factorized=FALSE)" reads contraints using an element-by-element multiplication, i.e. Amat'*x, not using the matrix-product, i.e. Amat'%*%x, required for the sums on the left-hand-side of 1-6). I would very much appreciate a suggestion on this problem. Thank you, Serguei Kaniovski
2006 Jul 18
2
A contingency table of counts by case
...ot;, c. the first has "0" - the second has "0", d. both have "0". There will be choose(9,2) sums, denoted s_ij for 1<=i<j<=9, where i and j are running indices for an "id"-pair. Please help, this is way beyond my knowledge of R! Thank you, Serguei Kaniovski -- ___________________________________________________________________ Austrian Institute of Economic Research (WIFO) Name: Serguei Kaniovski P.O.Box 91 Tel.: +43-1-7982601-231 Arsenal Objekt 20 Fax: +43-1-7989386 1103 Vienna, Austria Mail: Serguei.Kaniovski at wifo.ac.at http://www.wif...
2006 Oct 03
1
Reshape into a contingency table/Fisher's test
...e the original format, ie John.Mike John.Jim John.Steve Mike.Jim Mike.Steve Jim.Steve with two columns containing the p-values of the tests. Thanks a lot, Serguei -- ___________________________________________________________________ Austrian Institute of Economic Research (WIFO) Name: Serguei Kaniovski P.O.Box 91 Tel.: +43-1-7982601-231 Arsenal Objekt 20 Fax: +43-1-7989386 1103 Vienna, Austria Mail: Serguei.Kaniovski at wifo.ac.at http://www.wifo.ac.at/Serguei.Kaniovski
2006 Oct 04
1
Optim: Function definition
...-x[2])-x[3]*sqrt(x[1]*(1-x[1])*x[2]*(1-x[2])))^2/fr[4]) } sval=rep(0.1,3) fr<-c(0,0.1,0.2,0.3) optim(sval,obj, method="BFGS")$par Thank you, Serguei -- ___________________________________________________________________ Austrian Institute of Economic Research (WIFO) Name: Serguei Kaniovski P.O.Box 91 Tel.: +43-1-7982601-231 Arsenal Objekt 20 Fax: +43-1-7989386 1103 Vienna, Austria Mail: Serguei.Kaniovski at wifo.ac.at http://www.wifo.ac.at/Serguei.Kaniovski
2006 Sep 22
3
Compiling a contingency table of counts by case
...the first has "x=0" - the second has "x=1", c. the first has "x=1" - the second has "x=0", d. both have "x=0", The difficulty is that the number of "names" and their identity changes from case to case. Thanks a lot for you help, Serguei Kaniovski -- ___________________________________________________________________ Austrian Institute of Economic Research (WIFO) Name: Serguei Kaniovski P.O.Box 91 Tel.: +43-1-7982601-231 Arsenal Objekt 20 Fax: +43-1-7989386 1103 Vienna, Austria Mail: Serguei.Kaniovski at wifo.ac.at http://www.wif...
2006 Dec 04
1
Count cases by indicator
...093/0473;1 093/0473;1 093/0473;1 093/0473;1 093/0473;1 093/0473;1 093/0499;0 093/0499;0 093/0499;1 093/0499;1 093/0499;1 093/0499;1 093/0499;1 093/0499;1 093/0499;1 -- ___________________________________________________________________ Austrian Institute of Economic Research (WIFO) Name: Serguei Kaniovski P.O.Box 91 Tel.: +43-1-7982601-231 Arsenal Objekt 20 Fax: +43-1-7989386 1103 Vienna, Austria Mail: Serguei.Kaniovski at wifo.ac.at http://www.wifo.ac.at/Serguei.Kaniovski
2005 Dec 04
4
Construct a data.frame in a FOR-loop
Say I have a FOR-loop for computing powers (just a trivial example) for(i in 1:5) { x<-i^2 y<-i^3 } How can I create a data.frame and a 3D plot of (i,x(i),y(i)), i.e. for each iteration Thanks, Serguei Kaniovski -- ___________________________________________________________________ ??sterreichisches Institut f??r Wirtschaftsforschung (WIFO) Name: Serguei Kaniovski Postadresse: Postfach 91 Tel.: +43-1-7982601-231 A-1103 Wien Fax : +43-1-7989386 Stand...