search for: byrows

Displaying 20 results from an estimated 1248 matches for "byrows".

Did you mean: byrow
2004 Oct 29
1
[rmetasim] Need help deciphering this error msg... targeted to those who use rmetasim...
Hello, I am trying to do some simulation using the rmetasim package and I've run to this problem. --beginning of error msg-- Error in "[<-"(`*tmp*`, slice[l, ], slice[l, ], value = c(0.200000002980232, : number of items to replace is not a multiple of replacement length --end of error msg-- Here is the script I used. --script starts here-- ## load 'rmetasim'
2010 Jan 19
0
Macualay Duration code in a Functional Form - Please Help
# I have written this code in Notepad++ and copied here. ## ONS - PPA    Duration = function(par_value, coupon_rate, freq_coupon, tenure, ytm) { macaulay_duration  =   NULL modified_duration    =   NULL freq_coupon_new    =   NULL if(freq_coupon <= 0) {     freq_coupon_new = 365 } if(freq_coupon > 0 & freq_coupon <= 1) {     freq_coupon_new = 12 } if(freq_coupon > 1 &
2017 Sep 28
3
building random matrices from vectors of random parameters
Suppose I have interest in a matrix with the following symbolic structure (specified by 3 parameters: sa, so, m): matrix(c(0,sa*m,so,sa),2,2,byrow=T) What I can't figure out is how to construct a series of matrices, where the elements/parameters are rnorm values. I'd like to construct separate matrices, with each matrix in the series using the 'next random parameter value'.
2011 Oct 01
2
Entering data into a multi-way array?
Hello: I am a novice R user, but I have been working my way through the manuals / tutorials, ... I have R / Deducer up and running, and know the basics. I want to analyze a microarray (gene expression) dataset. I need to input the data into R as a multidimensional (multi-way) array, something on the order of 15,000 x 3 x 8 x 2 [genes x replicates x time points x treatments] I've
2017 Sep 20
1
How to use depmix for HMM with intial parameters
Hello, I have initial parameters for HMM model and I want to use depmixS4 package. The parameters are in the form intial_prob_matrix=matrix(c(0.07614213, 0.45177665, 0.47208122), nrow=1, ncol=3, byrow = TRUE) transition_matrix=matrix(c(0.46666667,0.46666667,0.06666667, 0.06741573,0.5617978,0.37078652, 0.02173913,0.3478261,0.63043478), nrow = 3, ncol =
2002 Feb 07
2
FW: layout and piechart diameter problem (PR#1300)
Third try... > -----Original Message----- > From: Warnes, Gregory R > Sent: Tuesday, February 05, 2002 4:12 PM > To: 'R-bugs' > Subject: layout and piechart diameter problem > > > I've been using layout to create some graphics pages which include pie > charts. (NB: No piechart arguments please, the main chart on the page is > a proper bar chart
2010 May 22
2
Fast Matrix Computation
Hi, I have two (large) matrices A and B of dimensions (m,n) and (p,n) respectively. I'd like to see if the is a fast way to compute a new matrix C with dimension (m*p,n) in which each row in C is found by applying some function f to each pair of rows (x,y) where x is a row in A and y is a row in B. For example, if A <- matrix(c(1, 2, 3, 4, 5, 6), byrow=TRUE, ncol=3) B <- matrix(c(7,
2012 Sep 26
1
Creating x*y different contigency tables
Dear all, I am trying to construct 25x31 different matrices of 2x2 dimension. Here is the problem: we have the following matrix matrix(c(54+s0, 43+s1, 56-s0, 67-s1), nrow=2, ncol=2, byrow=T) the values for s0 and s1 are c(0:24) and c(0:31), respectively. I wrote the following code without the desired results
2012 Aug 06
2
Splitting Data Into Different Series
Dear R Community, I'm trying to write a loop to split my data into different series. I need to make a new matrix (or series) according to the series code. For instance, every time the "code" column assumes the value "433" I need to save "date", "value", and "code" into the "dados433" matrix. Please take a look at the following
2017 Jul 05
4
expand gridded matrix to higher resolution
Hi all, (if me email goes out as html, than my email client don't do as told, and I apologies already.) We need to downscale climate data and therefore first need to expand the climate from 0.5deg to the higher resolution 10min, before we can add high resolution deviations. We basically need to have the original data at each gridcell replicated into 3x3 gridcells. A simple for loop can do
2011 Mar 01
2
Entering table with multiple columns & rows
Hi, I'm having difficulty with getting a table to show with multiple rows and columns. Below is the commands that I've typed in and errors that I am getting. Thank you. Laura Table trying to enter: Diet: Binger-yes: Binger-No: Total: None 24 134 158 Healthy 9 52 61 Unhealthy 23 72 95 Dangerous 12 15 27 >
2005 Oct 07
1
Matrix calculations in R--erroneous?
Does anyone know how -log(x) can equal 743 but -log(x+0)=Inf? That's what the following stream of calculations suggest: Browse[2]> -log ( 1e-323+yMat2 - yMat1 * logitShape(matrix(parsList$Xs, nrow = numXs, ncol=numOfCurves), matrix(means, nrow = numXs, ncol=numOfCurves, byrow=TRUE), matrix(sigmas, nrow = numXs, ncol=numOfCurves, byrow=TRUE)) )[5,9] [1] Inf Yet: Browse[2]>
2011 Nov 27
1
generating a vector of y_t = \sum_{i = 1}^t (alpha^i * x_{t - i + 1})
Dear R-help, I have been trying really hard to generate the following vector given the data (x) and parameter (alpha) efficiently. Let y be the output list, the aim is to produce the the following vector(y) with at least half the time used by the loop example below. y[1] = alpha * x[1] y[2] = alpha^2 * x[1] + alpha * x[2] y[3] = alpha^3 * x[1] + alpha^2 * x[2] + alpha * x[3] ..... below are
2008 Jun 21
2
Generating groupings of ordered observations
Dear List, I have a problem I'm finding it difficult to make headway with. Say I have 6 ordered observations, and I want to find all combinations of splitting these 6 ordered observations in g groups, where g = 1, ..., 6. Groups can only be formed by adjacent observations, so observations 1 and 4 can't be in a group on their own, only if 1,2,3&4 are all in the group. For example,
2012 Feb 17
2
(subscript) logical subscript too long in using apply
Dear ALL I have this function in R: func_LN <- function(data){ med_ge <- matrix(c(rep(NA,nrow(data)*ncol(data))), nrow = nrow(data), ncol=ncol(data), byrow=TRUE) T <- matrix(c(rep(NA,length(n)*ncol(data))), nrow = length(n), ncol=ncol(data), byrow=TRUE) Tdiff<- matrix(c(rep(NA,length(n)*ncol(data))), nrow = length(n), ncol=ncol(data), byrow=TRUE) T1<- c(rep(NA,ncol(data)))
2002 Apr 26
1
optim or nlm with matrices
Hi, I have the following hypothetical optimization problem: -det(t(x-A%*%x1)%*%(x-A%*%x1)) where A,x,x1 are matrices. A coefficients and x and x1 are variable matrices or vectors. I tried to apply optim and nlm functions but I kept receive the following massage: Error in A%*%x1 : non-conformable arguments. The massage appears even the -det() can be calculated and the dimensions are checked. here
2012 Dec 19
2
probability of binary data
Hi, how are you? I am trying to replicate the binary data f(2) function in the attached document by starting with the simple example found below: observed <- matrix(c(0, 1, 0, 0, 1, 1, 1, 0, 0),3,3,byrow=TRUE) data <- matrix(c(1, 1, 0, 0, 1, 0, 0, 0, 1),3,3,byrow=TRUE) f2 = sum(probability of the matrix element where the matrix element is present in both the observed and the
2004 Sep 30
2
pointsize in png graphics
Dear all, I'm trying to produce 2 png files, one consisting of an image plot and a color-table (also an image plot) and the other one consisting of 4 image plots and a color table. I'd like the color table to be exactly the same. The way I proceded is the following: for one plot and the color-table png(file = png.file, width = 650, height = 800, pointsize = 16) layout(matrix(c(1, 2),
2007 Sep 04
3
variable format
Okay, I want to do something similar to SAS proc format. I usually do this... a <- NULL a$divisionOld <- c(1,2,3,4,5) divisionTable <- matrix(c(1, "New England", 2, "Middle Atlantic", 3, "East North Central", 4, "West North Central", 5,
2013 Mar 18
2
Loop or some other way to parse by data generated values when it is not linear
I'm sorry for the really vague subject line but I am not sure how to succinctly describe what I am doing and what the problem is. But, here goes: 1. I have data with two-way data with frequencies. Below is an example, though in reality I am looking at about 10 different variables that I am crossing so the values of X1 and X2 change. X1 and X2 are place holders. Here's the dataset