Jump to content

Archived

This topic is now archived and is closed to further replies.

VillagePlank

The Is-Lm Economic Model

Recommended Posts

Since the economy is at the forefront of everyone's mind, right, now, I thought I'd construct a 'simple' economic model based on the IS-LM model Needless to say, this is a simple model that doesn't take into account important factors such as levels of indebtness, and inflation etc etc.

Here it is:

post-5986-049145700 1287739181_thumb.png

Now, this isn't my work, this is dervied from a graph representation from here. I've just made it look prettier.

We can represent this inside a computer. I've chosen to use SQL Server. You can get hold of this from Microsoft, for free, from here. SQL Server is a RDBMS (a relational database management system) Here is the script to create the tables on a database:


use ISLM
go

drop table Connection
go

drop table Variable
go

create table Variable
(
VariableId tinyint NOT NULL,
Name varchar(255) NOT NULL,
Value decimal(6,2) NOT NULL
)
go

create table Connection
(
SourceId tinyint NOT NULL,
SinkId tinyint NOT NULL,
[Weight] decimal(6,2) NOT NULL
)
go

alter table Variable
add constraint PK_Variable primary key (VariableId)
go

alter table Connection
add constraint PK_Connection primary key (SourceId,SinkId)
go

alter table Connection
add constraint FK_Variable_Connection1 foreign key (SourceId) references Variable (VariableId),
constraint FK_Variable_Connection2 foreign key (SinkId) references Variable (VariableId)
go

set nocount on
insert into Variable(VariableId,Name,Value) values (1,'Income',0)
insert into Variable(VariableId,Name,Value) values (2,'Savings',0)
insert into Variable(VariableId,Name,Value) values (3,'Consumption',0)
insert into Variable(VariableId,Name,Value) values (4,'Employment',0)
insert into Variable(VariableId,Name,Value) values (5,'Tax Revenue',0)
insert into Variable(VariableId,Name,Value) values (6,'Public Expenditure',0)
insert into Variable(VariableId,Name,Value) values (7,'Unemployment',0)
insert into Variable(VariableId,Name,Value) values (8,'Real Interest Rate',0)
insert into Variable(VariableId,Name,Value) values (9,'Imports',0)
insert into Variable(VariableId,Name,Value) values (10,'Exports',0)
insert into Variable(VariableId,Name,Value) values (11,'Investment',0)
insert into Variable(VariableId,Name,Value) values (12,'Nominal Exchange Rate',0)
insert into Variable(VariableId,Name,Value) values (13,'Wage Level',0)
insert into Variable(VariableId,Name,Value) values (14,'Nominal Money Supply',0)
insert into Variable(VariableId,Name,Value) values (15,'Real Money Supply',0)
insert into Variable(VariableId,Name,Value) values (16,'Real Exchange Rate',0)
insert into Variable(VariableId,Name,Value) values (17,'Price Level',0)
go

set nocount on
insert into Connection(SourceId,SinkId,[Weight]) values (1,2,1)
insert into Connection(SourceId,SinkId,[Weight]) values (1,3,1)
insert into Connection(SourceId,SinkId,[Weight]) values (3,1,1)
insert into Connection(SourceId,SinkId,[Weight]) values (1,4,1)
insert into Connection(SourceId,SinkId,[Weight]) values (1,5,1)
insert into Connection(SourceId,SinkId,[Weight]) values (4,7,-1)
insert into Connection(SourceId,SinkId,[Weight]) values (7,13,-1)
insert into Connection(SourceId,SinkId,[Weight]) values (13,17,1)
insert into Connection(SourceId,SinkId,[Weight]) values (17,16,1)
insert into Connection(SourceId,SinkId,[Weight]) values (17,15,-1)
insert into Connection(SourceId,SinkId,[Weight]) values (16,9,1)
insert into Connection(SourceId,SinkId,[Weight]) values (16,10,-1)
insert into Connection(SourceId,SinkId,[Weight]) values (10,1,1)
insert into Connection(SourceId,SinkId,[Weight]) values (9,1,-1)
insert into Connection(SourceId,SinkId,[Weight]) values (1,9,1)
insert into Connection(SourceId,SinkId,[Weight]) values (1,8,1)
insert into Connection(SourceId,SinkId,[Weight]) values (6,1,1)
insert into Connection(SourceId,SinkId,[Weight]) values (11,1,1)
insert into Connection(SourceId,SinkId,[Weight]) values (8,11,-1)
insert into Connection(SourceId,SinkId,[Weight]) values (8,12,1)
insert into Connection(SourceId,SinkId,[Weight]) values (15,8,-1)
insert into Connection(SourceId,SinkId,[Weight]) values (14,15,1)
insert into Connection(SourceId,SinkId,[Weight]) values (12,16,1)
go

drop function usf_GetWalk
go


create function usf_GetWalk
-- returns the order in which we will visit variables which must
-- be visited at least once with an extra visit for each cycle
(
@Start tinyint
) returns @Walk table (
[Order] tinyint,
SourceId tinyint,
SinkId tinyint
)
as

begin

declare @Tmp table
(
[Order] tinyint identity(1,1),
SourceId tinyint,
SinkId tinyint,
Processed bit,
Walked bit
)

declare @Cnt tinyint
declare @Var tinyint

insert into @Tmp(SourceId,SinkId,Processed,Walked)
select SourceId,SinkId,1,0
from Connection
where [email protected]

set @Cnt = (select COUNT(*)
from @Tmp
where Walked=0)

while @Cnt >0

begin

set @Var=(select top 1 SinkId
from @Tmp
where Walked=0
order by [Order] asc)

insert into @Tmp (SourceId,SinkId,Processed,Walked)
select SourceId,SinkId,1,0
from Connection
where SourceId = @Var

update @Tmp
set Walked=1
where [email protected]

update @Tmp
set Walked=1
where SinkId in (select SinkId
from @Tmp
group by SinkId
having COUNT(*)>1)

set @Cnt = (select COUNT(*)
from @Tmp
where Walked=0)

end

insert into @Walk([Order],SourceId,SinkId)
select [Order],SourceId,SinkId
from @Tmp

return

end
go



drop procedure usp_Process
go

create procedure usp_Process
@Start tinyint,
@Iterations tinyint,
@Direction smallint
as

declare @Walk table (
[Order] tinyint,
SourceId tinyint,
SinkId tinyint
)
declare @i smallint
declare @j smallint
declare @k smallint
declare @Source tinyint
declare @Sink tinyint

update Variable
set Value=0

insert into @Walk ([Order],SourceId,SinkId)
select [Order],SourceId,SinkId
from dbo.usf_GetWalk(@Start)

set @i = 0
set @j = 0
set @k = (select COUNT(*) from @Walk)

while @i<[email protected]

begin

set @j=0
update Variable
set [email protected]
where [email protected]

while @j<[email protected]

begin

set @Source = (select SourceId
from @Walk
where [Order][email protected])
set @Sink = (select SinkId
from @Walk
where [Order][email protected])

update Variable
set Value=Value + (select [Weight]*@Direction
from Connection
where [email protected]
and [email protected])
where [email protected]

set @[email protected]+1

end
set @[email protected]+1
end

go

Essentially, this sets up some functions to process the model according to the rules set out in the pretty picture above, and for the reasoning laid out on the weblink above.

So, what can we do with this. Well, if you run:


exec usp_Process 6,0,-2
select * from Variable

This will cut public expenditure by two notional 'points' The graph is then processed accordingly, and the values of the variable can be read, such that the results are:

post-5986-021259100 1287739591_thumb.png

Here, we can see, according to this model, the results of reasonably deep cuts. We can accumulate this, so that we can provide for some QE, too, by increasing the real money supply (+1), the results of doing both a public expenditure cut, and quantitative easing, then are:

post-5986-066598500 1287739812_thumb.png

Whislt we're at it, we might as well increase the price level, too, since the VAT rise is on it's way - here's the results

post-5986-074815100 1287740009_thumb.png

And there you have some real basic economic modelling where the number is negative, that means that that variable will decline, where it is positive it means that that variable will increase. The number after the sign denotes the magnitude (which should be seen relative to the rest of the variables) A caveat is that it is entirely based on equal changes, so if the Wage Level increases by 1, then the assumption is that the Price Level will also increase by 1. This is highly unlikely to be the case.

(You can also use the same arrangement to model climate, too, or, in fact, anything that can be modelled as a digraph - which is most things)

:)

Share this post


Link to post
Share on other sites

So with all that lot ... I reckon the following is fairly neutral and will pay off the deficit. Well, I say I reckon, but really, it's just this model's output ...

Here's the spreadsheet:

post-5986-069616800 1287741945_thumb.png

So here's the VP list of economic reforms:

  • Large Public Expenditure Cuts
  • Quantitative Easing
  • Increase in VAT
  • Increase in Interest Rates
  • Real reduction in wages (wage freeze)

The unexpected side-effect of this is a reduction in investment and an increase in the real money supply. Of course, public expenditure is reduced, as is wage levels, because we specified it - however, most other things like employment are neutral: ie unaffected.

Share this post


Link to post
Share on other sites

... and of course, this doesn't model temporal economics either (such as it can take up to 6 months for interest rates to take effect)

Share this post


Link to post
Share on other sites

Can be really anal and suggest adding a drop if exists in sysobjects name = "Connection", this way you won't get an error when you run it for the first time.

I think it's worth adding inflation and gilt yields to the mix as these would be effected by QE.

Share this post


Link to post
Share on other sites

Can be really anal and suggest adding a drop if exists in sysobjects name = "Connection", this way you won't get an error when you run it for the first time.

I think it's worth adding inflation and gilt yields to the mix as these would be effected by QE.

Yup - no problem. Give me a while ...

Share this post


Link to post
Share on other sites

I say screw the cuts and screw this rediculous usury-based money system.

Don't you mean f**k being rational? If you don't, please feel free to extend the model, and publish it here.

Share this post


Link to post
Share on other sites

Don't you mean f**k being rational? If you don't, please feel free to extend the model, and publish it here.

Why not speak in language that everybody can appreciate, rather than these absurd bits of computer code.

Are you autistic or something?

Share this post


Link to post
Share on other sites

Can be really anal and suggest adding a drop if exists in sysobjects name = "Connection", this way you won't get an error when you run it for the first time.

I think it's worth adding inflation and gilt yields to the mix as these would be effected by QE.


USE [ISLM]
GO
/****** Object: ForeignKey [FK_Variable_Connection1] Script Date: 10/22/2010 15:54:22 ******/
IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_Variable_Connection1]') AND parent_object_id = OBJECT_ID(N'[dbo].[Connection]'))
ALTER TABLE [dbo].[Connection] DROP CONSTRAINT [FK_Variable_Connection1]
GO
/****** Object: ForeignKey [FK_Variable_Connection2] Script Date: 10/22/2010 15:54:22 ******/
IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_Variable_Connection2]') AND parent_object_id = OBJECT_ID(N'[dbo].[Connection]'))
ALTER TABLE [dbo].[Connection] DROP CONSTRAINT [FK_Variable_Connection2]
GO
/****** Object: StoredProcedure [dbo].[usp_Process] Script Date: 10/22/2010 15:54:22 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_Process]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[usp_Process]
GO
/****** Object: UserDefinedFunction [dbo].[usf_GetWalk] Script Date: 10/22/2010 15:54:22 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usf_GetWalk]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
DROP FUNCTION [dbo].[usf_GetWalk]
GO
/****** Object: Table [dbo].[Connection] Script Date: 10/22/2010 15:54:22 ******/
IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_Variable_Connection1]') AND parent_object_id = OBJECT_ID(N'[dbo].[Connection]'))
ALTER TABLE [dbo].[Connection] DROP CONSTRAINT [FK_Variable_Connection1]
GO
IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_Variable_Connection2]') AND parent_object_id = OBJECT_ID(N'[dbo].[Connection]'))
ALTER TABLE [dbo].[Connection] DROP CONSTRAINT [FK_Variable_Connection2]
GO
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Connection]') AND type in (N'U'))
DROP TABLE [dbo].[Connection]
GO
/****** Object: Table [dbo].[Variable] Script Date: 10/22/2010 15:54:22 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Variable]') AND type in (N'U'))
DROP TABLE [dbo].[Variable]
GO

The rest of the code - ie walking through a digraph should still hold. More on adding nodes, later.

Share this post


Link to post
Share on other sites

Why not speak in language that everybody can appreciate, rather than these absurd bits of computer code.

Are you autistic or something?

Apart from the general and global apology to autistic people, I think you should just bow out gracefully to stop your embarrassment. I don't ask that you understand first principles, I don't ask that you understand SQL (an international standard). I only ask for a critique on it's own terms.

I can understand, given your overt political views, that you don't like first principles, you don't like being rational, and you don't like anything that is derived from any combination of the same.

I have to say - that's simply not my problem.

Sorry.

Share this post


Link to post
Share on other sites

Apart from the general and global apology to autistic people, I think you should just bow out gracefully to stop your embarrassment. I don't ask that you understand first principles, I don't ask that you understand SQL (an international standard). I only ask for a critique on it's own terms.

I can understand, given your overt political views, that you don't like first principles, you don't like being rational, and you don't like anything that is derived from any combination of the same.

I have to say - that's simply not my problem.

Sorry.

We did IS-LM at uni and as boring as the subject can be you just made it really really more boring with all the 'puter code....where's your graphs man????!!!! :rofl:

Share this post


Link to post
Share on other sites

But...what if cutting people's wages (wages that are already at or below subsistence level) causes 'everyday' consumption to dry up? Can an entire economy flourish on the sales of Rolls Royce's?

I'm not an economist!!! :help:

Share this post


Link to post
Share on other sites

Shan't bother next time :drinks:

Pete: it won't, because, generally, the Gaussian curve holds for wages - all you're doing is shifting everyone to the left a bit; if you are entirely progressive, that is: if you're not, then you are skewing the curve to the left.

Share this post


Link to post
Share on other sites

Shan't bother next time :drinks:

Pete: it won't, because, generally, the Gaussian curve holds for wages - all you're doing is shifting everyone to the left a bit; if you are entirely progressive, that is: if you're not, then you are skewing the curve to the left.

Thanks VP. As you've probably already guessed, your ideas are going right over my head. :blush: :help: :lol:

Share this post


Link to post
Share on other sites

×
×
  • Create New...