Community Profile

# ektor

Last seen: Today Active since 2012

#### Content Feed

View by

Question

slice sampler with constraints
Dear all, I have a function logPDF=@(x) logpost_1(x, y, lam0, gam0); x1 = slicesample(gam,kk,'logPDF',logPDF); where ...

ungefär 2 år ago | 0 answers | 0

### 0

Question

How can I impose restrictions on a function @
Dear all I have a compicated function logPDF=@(x) set_up(x, a,y); under the restriction x+a<0.999. How can I impose th...

ungefär 2 år ago | 0 answers | 0

### 0

Question

Using the function in 'logmvnpdfFS'
Dear all, I have been trying to run a matlab code using the function 'logmvnpdfFS' . But I get Undefined function 'logmvnpdf...

ungefär 2 år ago | 1 answer | 0

### 1

Question

eye and speye in Kron within matlab
Dear all, I want to ask if B=[1 2; 3 4]; A=kron(eye(2),B); and B=[1 2; 3 4]; A=kron(speye(2),B); are the same. It ...

ungefär 2 år ago | 0 answers | 0

### 0

Question

using a loop within a loop in matlab
Dear all, I have this problem T=1000 for ii=1:T for t=ii:T 'here a have a function that depends on t' end e...

ungefär 2 år ago | 0 answers | 0

### 0

Question

Adding elements of a vector in matlab
Hi all, I have a vector a=[1 2 3 4 5 6 7 8 9 10 ]; and I want to get the vector b=[1 +2+3+4+5+6+7 +8 +9 +10; 2+3+4+5+6+7...

ungefär 2 år ago | 1 answer | 0

### 1

Question

constructing a difficult large matrix
Dear all, I am interested in constructing a complicated matrix A. The matrix A is a diagonal matrix, where each diagonal elem...

ungefär 2 år ago | 2 answers | 0

### 2

Question

Matrix with strings and numbers
Dear all, I have a column that contains thousands of the following elements (this is just a sample) A=[ '2008-12-05 15:...

mer än 2 år ago | 2 answers | 0

### 2

Question

identifying the critical points of a bivariate function
Dear all, I have this function below and I plotted it in a 3D space. Is it possible to mark the critical points on the gr...

mer än 2 år ago | 0 answers | 0

### 0

Question

plot 2 3D vectors in Matlab
Dear all, I have these vectors a = [1 2 -3]; b = [-3 12 -13]; Both start from c=[0 0 0]; How can I plot them in a 3D e...

mer än 2 år ago | 1 answer | 0

### 1

Question

getting an error message when using hmcSampler
Dear all, I have this log-function on which I apply the hmcSampler: T=1000; g=randn(T,1); u=randn(T,1); k1=0.01; k2=0.02; ...

ungefär 3 år ago | 0 answers | 0

### 0

Question

Setting up properly the fminunc function
Dear all, I am trying to maximize this function T=1000; z=randn(T,1); u=randn(T,1); k1=0.01; k2=0.01; options=optimset('...

ungefär 3 år ago | 1 answer | 0

### 1

Question

Estimating a regression model using matlab
Dear all, I have this regression model g=randn(1000,1); error=randn(1000,1); g(2:end)=k1+ k2*(g(1:end-1)-k1) + error(2:end...

ungefär 3 år ago | 1 answer | 0

### 1

Question

An error message using fmincon
Dear all, I minimize this function. g=randn(1000,1); u=randn(1000,1); ff = @(x) sum( ( g(2:end)- x(1)- x(2)*(g(1:e...

ungefär 3 år ago | 1 answer | 0

### 1

Question

Optimizing minimization with fmincon function
Dear all, I have this function which I minimize: g=randn(1000,1); u=randn(1000,1); y=randn(1000,1); options = optimoptions(...

ungefär 3 år ago | 1 answer | 0

### 1

Question

Estimating multiple parameters from a regression
Dear all, I have this regression model fy=randn(1000,1); x1=randn(1000,1); x2=randn(1000,1); u=randn(1000,1); fy=a*x1+b*x...

ungefär 3 år ago | 1 answer | 0

### 1

Question

estimating the parameter of an equation
Dear all, I have this equation: kk=randn(1000,1); u=randn(999,1); kk(2:end)=kk(1:end-1)+u*d; and I want to estimate the ...

ungefär 3 år ago | 1 answer | 0

### 1

Question

a question on for loop statement
Dear all, I have this for loop T=1000; k=0.1; u=rand(T,1); a = zeros(T,1); a(1) =u(1)+ k*0.01; for t=2:T a(t) = u...

mer än 3 år ago | 1 answer | 0

### 1

Question

How do I set up a particular function
Dear all, I have a function f=@(x) umax(x,u, t); The problem is that x changes at each value of t=1,...,T; that is, LL...

mer än 3 år ago | 0 answers | 0

### 0

Question

generating a sequence of numbers
Dear all, I want to generate the following sequence: L1=P L2=a1+2*F*P L3=a2+2*F*a1+3*F^2*P L4=a3+2*F*a2+3*F^2*a1+4*F^3*...

mer än 3 år ago | 1 answer | 0

### 1

Question

Using the global operator
I have a function below. As you can see if t==1 I create a vector kk. However, I can not use this kk in the 'else' statement...

mer än 3 år ago | 1 answer | 0

### 1

Question

Using the operator @ and the function
Dear all, I have a function function ll=sample(x,a,b,c,d) end , where x appears in 1000 equations in various positio...

mer än 3 år ago | 0 answers | 0

### 0

Question

constructing a time variable in matlab
Dear all, I have a matrix data= [9 30 0 9 30 0 9 30 0 9 30 0 9 30 ...

mer än 3 år ago | 1 answer | 0

### 1

Question

changing the format of a cell matrix
Dear all, I have this cell matrix 'data', where as you can see below the element for example 8:00:06 is the hour-minute-secon...

mer än 3 år ago | 1 answer | 0

### 1

cubic spline regression and plot
Any help?

mer än 3 år ago | 0

Question

cubic spline regression and plot
Dear all, I have two variables X and Y. X and Y are both vectors of dimension 8561X1 For example: X=[ 1 1 ...

mer än 3 år ago | 2 answers | 0

### 2

Question

less than or equal and greater than of equal operations
Dear all, I have this vector DIFF=[ 0 0.0500 -0.0200 0.0100 -0.0400 0 0 ...

ungefär 4 år ago | 2 answers | 0

### 2

Question

fmincon: Matrix is singular to working precision.
Dear all, I get the following message but the code seems to be working ok In fmincon (line 797) Warning: Matrix i...

mer än 4 år ago | 0 answers | 0

### 0

Question

maximizing a function with a nonlinear constraint using fmincon
Dear all, I have a function 'fun' which I want to maximize with respect to four unknowns: x(1) x(2) x(3) and x(4) under th...

mer än 4 år ago | 1 answer | 0