I have two simple functions in two separate files like below:
function [thetavals postvals] = opt_compute_posterior(joint, theta_min, theta_max, num_steps)
thetavals = linspace(theta_min, theta_max, num_steps);
postvals = joint(thetavals);
postvals = postvals / ( sum(postvals) .* ( (theta_max - theta_min)/num_steps ));
end
function joint = plJoint(tobs)
gamma = 2.43;
joint = @(theta)( ( 1 ./ (theta.^(gamma + 1)) ) .* (tobs < theta) );
end
When I test this code with
opt_compute_posterior(plJoint, 0, 300, 1000), I have error of "Not enough input arguments.", and I cannot find where the hell is wrong with the codes. Please lit me a light.
which opt_compute_posteriorreturn?opt_compute_posterior(plJoint(you_need_an_input_here), 0, 300, 1000).