Go Back   TestMagic Forums > Admissions > PhD in Economics
Register Forum Rules FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 2009 July 2nd, 10:24 PM   #1 (permalink)
Eager!
 
Join Date: Feb 2007
Posts: 71
kanishka just joined TestMagic.
Errors using LeSage's MATLAB code for Spatial Econometrics

I've been trying out some of the functions related to spatial regression using James LeSage's MATLAB toolbox and keep running into errors when I try using the SAR function and the DARP function.

Has anyone else had this experience? I'm not really sure what to do next.
_ _ _ _ SIG _ _ _ _
Attending: University of Maryland AREC
kanishka is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Google Bookmark this Post!Reddit!
Reply With Quote
Old 2009 July 3rd, 03:49 PM   #2 (permalink)
I JUST got here.
 
Join Date: Jun 2007
Posts: 3
mico just joined TestMagic.
Me too. Let me know if you find what is going on pls.
mico is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Google Bookmark this Post!Reddit!
Reply With Quote
Old 2009 July 8th, 07:34 AM   #3 (permalink)
Eager!
 
Join Date: Apr 2009
Posts: 78
greeneggs is on the way!
I wasn't familiar with the toolbox, but I downloaded it and everything seemed to work fine for me. My only thought is that perhaps you forgot to set it up so matlab can access files out of the different folders.

MATLAB - Documentation

The easiest way is to go to file -> set path
then click on the "add with subfolders..." button, then navigate to where you have the jplv7 folder, highlight it and click okay. Then everything should hopefully work.

If you can post most specifically what the errors say people can probably offer more help.
greeneggs is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Google Bookmark this Post!Reddit!
Reply With Quote
Old 2009 July 8th, 03:58 PM   #4 (permalink)
Eager!
 
Join Date: Feb 2007
Posts: 71
kanishka just joined TestMagic.
Thank you for this.

What is the jplv7 folder?

This is the error message I get after using SAR (and I did try the add with subfolders thing with just the SAR folder):

??? Error using ==> f_sar at 53
f_sar: Wrong # of input arguments

Error in ==> fminbnd at 212
x= xf; fx = funfcn(x,varargin{:});

Error in ==> sar at 195
[p,liktmp,exitflag,output] =
fminbnd('f_sar',lmin,lmax,options,eo,el,W,detval);

Error in ==> k_sar at 19
res = sar(y,x,W);

I also got this message when I started up MATLAB:

Warning: Could not get change notification handle for local C:\Program
Files\MATLAB\R2008a\work.
Performance degradation may occur due to on-disk directory change checking.
_ _ _ _ SIG _ _ _ _
Attending: University of Maryland AREC
kanishka is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Google Bookmark this Post!Reddit!
Reply With Quote
Old 2009 July 9th, 06:21 PM   #5 (permalink)
Eager!
 
Join Date: Apr 2009
Posts: 78
greeneggs is on the way!
Sorry about the confusion with the jplv7 folder. I downloaded the toolkit from here: Econometrics Toolbox for MATLAB
and it decompresses into a folder called jplv7, so I incorrectly assumed it was the same for you.

What you should do then is do the add with subfolders with whatever folder contains the SAR folder and all of the other folders (coint, data, diagn, etc)
I'm not sure if this will fix your problem though.

Have you tried running the demo files: sar_d, sar_d2, and sar_d3? If those work, then you know that the problem isn't with his code but with your own.

One thing t may be is that our code is slightly different. For example where you have:
Code:
[p,liktmp,exitflag,output] =
    fminbnd('f_sar',lmin,lmax,options,eo,el,W,detval);
I have:
Code:
[prho,liktmp,exitflag,output] = fminbnd('f_sar',rmin,rmax,options,detval,epe0,eped,epe0d,n);
So maybe you just have an older version of the toolbox that doesn't work and downloading the one in my above link may fix it? It does say on the website that the code was updated in January of this year.

Otherwise I'm not sure what's wrong. Apparently you aren't using f_sar with the right number of inputs (there should be 6), but it's probably another one of his codes doing that and not you.

I would try running the demo files and then try updating the toolkit and see if that fixes it. Otherwise you should post or pm me your code and files so I can try to figure out what's going on.


As for the change notification handle warning, it's not a huge deal. What it means is that it won't automatically check all your files to see if they've been changed or if any new files have been added to the directory. You can still make it recognize all changes manually after every change by typing

Code:
clear all
path(path)
But if you don't want to have to do that manually the problem is probably that you just have too many files in that directory and you need to move some to subdirectories and not include them in the path or something. You can read more about it here and here.

Good luck!
greeneggs is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Google Bookmark this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

What you can do
You cannot post new threads
You cannot post replies
You cannot post attachments
You cannot edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 10:59 AM.

Contact TestMagic   TestMagic Forums      Archive   Privacy Statement

TestMagic Locations   Legal   Privacy


SEO by vBSEO 3.2.0
Copyright © 2009 TestMagic
Ad Management by RedTyger

Scroll Up