- Next to `Command Line Tools`, click on `Install`
- Download [MacOSX10.6.sdk.zip](http://www.jamesgeorge.org/uploads/MacOSX10.6.sdk.zip) and unzip it in `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs`. Change the owner to be `root` and the group to be `wheel`
- Install [Homebrew](http://mxcl.github.io/homebrew/) and [Homebrew Science](https://github.com/Homebrew/homebrew-science)
- Install the following brews:
```
brew install automake
...
...
@@ -269,7 +269,12 @@ Configure and make:
brew install slicot --with-default-integer-8
```
-**(Optional)** To compile Dynare mex files for use on Octave, first install Octave following the [Simple Installation Instructions](http://wiki.octave.org/Octave_for_MacOS_X#Simple_Installation_Instructions_3). Then, you will probably also want to install graphicsmagick via Homebrew with `brew install graphicsmagick`.
-**(Optional)** To compile Dynare's documentation, first install the latest version of [MacTeX](http://www.tug.org/mactex/). Then install `doxygen` and `latex2html` via Homebrew with the following commands:
-**(Optional)** To compile Dynare's documentation, first install the latest version of [MacTeX](http://www.tug.org/mactex/). Then install `doxygen`, `latex2html` and `texi2html` via Homebrew with the following commands:
```
brew install doxygen
brew install latex2html
brew install texi2html
```
-**(On OS X 10.7 Only)** Copy [FlexLexer.h](http://www.dynare.org/DynareWiki/BuildingDynareFromSource?action=AttachFile&do=view&target=FlexLexer.h) into the `preprocessor` directory (there was an error in the `FlexLexer.h` file distributed with 10.7)
- Finally, switch to the root dynare directory. Ensure your path contains `/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/texbin:/usr/local/sbin`. Run:
% function check_for_calibrated_covariances(xparam1,estim_params,M)
% find calibrated covariances to consider during estimation
% Inputs
% -xparam1 [vector] parameters to be estimated
% -estim_params [structure] describing parameters to be estimated
% -M [structure] describing the model
%
% Outputs
% -estim_params [structure] describing parameters to be estimated
%
% Notes: M is local to this function and not updated when calling
% set_all_parameters
% Copyright (C) 2013 Dynare Team
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
Sigma_e_calibrated=M.Sigma_e;
H_calibrated=M.H;
%check covariance for structural errors
covariance_pos=find(tril(Sigma_e_calibrated,-1));%off-diagonal elements set by covariances before updating correlation matrix to reflect estimated covariances
covariance_pos_ME=find(tril(H_calibrated,-1));%off-diagonal elements set by covariances before updating correlation matrix to reflect estimated covariances
%locally updated M
M=set_all_parameters(xparam1,estim_params,M);
correlation_pos=find(tril(M.Correlation_matrix,-1));%off-diagonal elements set by correlations after accounting for estimation
[rows,columns]=ind2sub(size(M.Sigma_e),calibrated_covariance_pos);%find linear indices of lower triangular covariance entries
estim_params.calibrated_covariances.position=[calibrated_covariance_pos;sub2ind(size(M.Sigma_e),columns,rows)];%get linear entries of upper triangular parts
[rows,columns]=ind2sub(size(M.H),calibrated_covariance_pos_ME);%find linear indices of lower triangular covariance entries
estim_params.calibrated_covariances_ME.position=[calibrated_covariance_pos_ME;sub2ind(size(M.H),columns,rows)];%get linear entries of upper triangular parts