[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Optimising the Keen-Minsky Model
From: |
c. |
Subject: |
Re: Optimising the Keen-Minsky Model |
Date: |
Sun, 27 May 2012 18:28:05 +0200 |
On 25 May 2012, at 21:18, richard wrote:
> Hi c.
> please find attached the Keen-Minsky Model ver02 written in
> Octave. I trust you will find that the earlier cut down
> code simplifies the task of optimising the program without
> the complication of the full model
>
> HTH
>
> Richard A Lough
Richard,
Here is a modified version of your code, I could get a ~ x2 speed up by
refactoring and partial vectorization
plus a further ~ x2 speedup by running in parallel with parcellfun (I only have
2 cores, if you have more that could be better for you).
>> clear all, close all, tic, KeenMinsky02_refactored, toc
parcellfun: 10/10 jobs done
parcellfun: 10/10 jobs done
Firms Loan: 0.9504
Bank Vault: 331644.3730
Firms Deposit: -11.2287
Bank Capital: 0.1791
Workers Deposit: 0.0000
wage : 0.0000
Capital = : 4236.8343
Alpha = : 4.4807
Beta =: 7.3866
change of Price Level (inflation): 0.0000
Employment ratio : 0.1422
Elapsed time is 39 seconds.
>> clear all, close all, tic, KeenMinsky02, toc
Firms Loan: 0.9504
Bank Vault: 331644.3730
Firms Deposit: -11.2287
Bank Capital: 0.1791
Workers Deposit: 0.0000
wage : 0.0000
Capital = : 4236.8343
Alpha = : 4.4807
Beta =: 7.3866
change of Price Level (inflation): 0.0000
Employment ratio : 0.1422
Elapsed time is 163.1 seconds.
Anyway it looks like you are solving an ODE system, maybe you should look at
LSODE
HTH,
c.
P.S. I noticed the 12th row of X is filled but never used ... maybe that is a
bug?
KeenMinsky02_refactored.m
Description: Binary data
increment.m
Description: Binary data
postprocess.m
Description: Binary data
- GSoC: Student blogs, Jordi GutiƩrrez Hermoso, 2012/05/16
- Re: GSoC: Student blogs, Max Brister, 2012/05/22
- Re: GSoC: Student blogs, richard, 2012/05/23
- Re: GSoC: Student blogs, Jacob Dawid, 2012/05/23
- Re: GSoC: Student blogs, c., 2012/05/23
- Message not available
- Re: GSoC: Student blogs, c., 2012/05/24
- Re: GSoC: Student blogs, richard, 2012/05/24
- Optimising the Keen-Minsky Model, richard, 2012/05/25
- Re: Optimising the Keen-Minsky Model,
c. <=
- Re: Optimising the Keen-Minsky Model, richard, 2012/05/28
- Re: Optimising the Keen-Minsky Model, richard, 2012/05/29
- Re: Optimising the Keen-Minsky Model, Jordi GutiƩrrez Hermoso, 2012/05/29
- Re: Optimising the Keen-Minsky Model, richard, 2012/05/31
- Re: GSoC: Student blogs, Max Brister, 2012/05/24