Page 1 of 1

more information on mh_optimal_bandwidth

PostPosted: Fri Feb 28, 2014 12:34 am
by Abrahim
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

Re: more information on mh_optimal_bandwidth

PostPosted: Sun Mar 02, 2014 2:16 pm
by jpfeifer
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.