Community Profile

photo

Joao Ejarque


Active since 2013

Statistics

  • Thankful Level 1

View badges

Content Feed

View by

Question


How can I efficiently extract a max along two dimensions, from a 4 dimensional array, without writing a double loop?
I have the following loop. It picks values from a matrix A(nb,nd). For each vaue of this matrix A it constructs a matrix B = F...

10 years ago | 1 answer | 0

1

answer

Question


indexing into a matrix to eliminate a loop
This file generates an ergodic density matrix. I would like to get rid of the inner loop (over ii). The first line in the outer ...

10 years ago | 2 answers | 0

2

answers

Question


How can I avoid a simple loop where matrices are created and then summed?
P is a matrix of size (ny,ny); F0 is a matrix of size (nh,ny); Each row of P multiplies its respective column of F0, creating ...

10 years ago | 2 answers | 0

2

answers

Question


how to allocate elements of a vector into different rows in a matrix, preserving the column order?
Consider Z = zeros(4,2); X = [0.15 , 0.33]; P=[2 3]; I am looking for the simplest form of applying P to X and ...

10 years ago | 1 answer | 0

1

answer

Question


indexing into a matrix
I have a dataset. It is a matrix Z with say, N total observations (rows), and K variables (columns). However, the total N obser...

10 years ago | 0 answers | 0

0

answers

Question


What is the most compact way to update an index vector out of a cube?
I have 3 vectors each with n elements (n individuals). Two of them are exogenous state vectors y and r, both with n elements...

10 years ago | 1 answer | 0

1

answer