[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using fsolve with time series data
From: |
Terry Duell |
Subject: |
Re: Using fsolve with time series data |
Date: |
Sat, 10 Aug 2013 11:31:51 +1000 |
User-agent: |
Opera Mail/12.16 (Linux) |
On Sat, 10 Aug 2013 09:36:48 +1000, Terry Duell <address@hidden>
wrote:
On Fri, 09 Aug 2013 21:50:07 +1000, Alexander Barth
<address@hidden> wrote:
Dear Terry,
For octave "x(1)" is always a scalar, not a vector. In fact, you have 8
* N
scalar unknowns. Thus x can be written as a N x 8 (or 8 x N, but this
will
be slower in your case) matrix of unknowns.
You have to write your function fcn like this:
x(:,7) - R1*x(:,3) + R1*x(:,6) - R1*x(:,5).*x(:,5) - R1*x(:,2).*x(:,2)
- A1
...
I assume that you mean by x(5)*x(5) a element-wise product. If it is a
scalar product use x(:,5)'*x(:,5).
Call then fsolve with
[x, fvec, info] = fsolve(fcn, zeros(N,8));
I hope this helps.
I have implemented a method using vectors, but this does seem to take a
lot of processing time.
If I use only a small portion of the vector data as a test (ie. a sample
of length 50) the solution requires approx 36 secs.
I have also tried a solution method using scalars, where I step through
the vector data and call fsolve at each step, and save the results into
vectors. This takes a lot less time...approx 10 secs for sample of length
50.
My data sets vary from about 35000 to 50000-ish values, hence processing
time is an issue.
The solution method using vectors with the full data set also runs foul of
a memory or indexing limit (I'm using Octave from Fedora 19 repo, for
x86_64, and 8GB ram).
Anyone have any thoughts on the speed or memory limit?
Cheers,
--
Regards,
Terry Duell