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

[quote]1. what does number_of_draws mean? (line 0008)
[/quote]

That is the number of draws after the burnin of the Metropolis-Hastings Chain used to compute the posterior density.

[quote]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)
[/quote]

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.

[quote]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?
[/quote]

It means that you have excuted the line in a wrong way.

[quote]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?
[/quote]

[quote]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”. [/quote]

You cannot execute incomplete parts of an if-construct.