more information on mh_optimal_bandwidth

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

more information on mh_optimal_bandwidth

Postby Abrahim » Fri Feb 28, 2014 12:34 am

Dear all,

I am a new starter in using matlab and I am looking at the mh_optimal_bandwidth source code, but I have several questions related to the parameters inside the code.

1. what does number_of_draws mean? (line 0008)

2. I noticed that the bandwidth = 0 => silverman [1986] rule of thumb
bandwidth = 1 => sheather and jones (1991)
bandwidth = 2 => local bandwidth parameters
Can I know why the bandwidth is set to either 0, 1 or 2 and the why when bandwidth is 0, then it is silverman rule of thumb (line 0009 - 0012)

3. at line 0055, when I compute into matlab, the following error comes out:
mu02 = inv(2*sqrt(pi));
|
Error: The expression to the left of
the equals sign is not a valid target
for an assignment.
Can I know what does it mean?

4. at line 0056, the mu21 = 1, but I cannot figure out what does "mu" indicates. Can I have further information related to the "mu" parameter?

5. I have encountered another error when compute the code further, in which the error message is indicated below:
at line 0061, elseif strcmpi(kernel_function,'triangle'), and error comes out

elseif strcmpi(kernel_function,'triangle')
|
Error: Illegal use of reserved
keyword "elseif".

Hope to seek some advice on abovementioned queries..Thank you..

Abrahim
Abrahim
 
Posts: 1
Joined: Fri Feb 28, 2014 12:11 am

Re: more information on mh_optimal_bandwidth

Postby jpfeifer » Sun Mar 02, 2014 2:16 pm

1. what does number_of_draws mean? (line 0008)

That is the number of draws after the burnin of the Metropolis-Hastings Chain used to compute the posterior density.
2. I noticed that the bandwidth = 0 => silverman [1986] rule of thumb
bandwidth = 1 => sheather and jones (1991)
bandwidth = 2 => local bandwidth parameters
Can I know why the bandwidth is set to either 0, 1 or 2 and the why when bandwidth is 0, then it is silverman rule of thumb (line 0009 - 0012)

You are confusing something. The variable bandwidth is not a value for the bandwith, but an indicator saying according to which approach to compute the actually used bandwith. By default, currently only option 0 is used.

3. at line 0055, when I compute into matlab, the following error comes out:
mu02 = inv(2*sqrt(pi));
|
Error: The expression to the left of
the equals sign is not a valid target
for an assignment.
Can I know what does it mean?

It means that you have excuted the line in a wrong way.
4. at line 0056, the mu21 = 1, but I cannot figure out what does "mu" indicates. Can I have further information related to the "mu" parameter?

See http://onlinelibrary.wiley.com/doi/10.1111/1467-9469.00359/abstract
5. I have encountered another error when compute the code further, in which the error message is indicated below:
at line 0061, elseif strcmpi(kernel_function,'triangle'), and error comes out

elseif strcmpi(kernel_function,'triangle')
|
Error: Illegal use of reserved
keyword "elseif".

You cannot execute incomplete parts of an if-construct.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare contributions and examples

Who is online

Users browsing this forum: No registered users and 1 guest