Thread Subject: Creating new user-defined model in Model-Based Calibration toolbox

Subject: Creating new user-defined model in Model-Based Calibration toolbox

From: Mohammad Monfared

Date: 30 Nov, 2008 18:33:02

Message: 1 of 5

Hi,

In Model-Based Calibration toolbox, I want to define a new model as a user-defined model. My model is going to use the "gamcdf" function, as its function. I've passed the almoste simple steps (by means of a template file called, weibul.m ) described in the help section. But when I want to checkin it:

checkin(xregusermod, 'gammacdf', [0.1:0.01:0.2]'); % my new model is named, gammacdf

this error appears:

??? Error using ==> minus
Matrix dimensions must agree.

I can't recognize from where, this arises. Could anybody give some advice or make it for me?

thanks in advance,
Mohammad

Subject: Creating new user-defined model in Model-Based Calibration toolbox

From: Mohammad Monfared

Date: 1 Dec, 2008 14:55:03

Message: 2 of 5

After making some corrections, I ran into this error:

??? Error using ==> localusermod.features at 48
Invalid response feature definition for user-defined model

the function "i_rfvals(U,b)", is in the optional section of the .m file. I don't know what are response feature, and especially its definition for gamcdf.

any suggestion?

Mohammad,

Subject: Creating new user-defined model in Model-Based Calibration toolbox

From: Ian Noell

Date: 2 Dec, 2008 13:38:01

Message: 3 of 5

Hi Mohammed,

The function weibul.m is setup for the weibul model and contains functionality specific to that model. If you delete the code in the subfunction i_rfvals and replace it with

function [rf,dG]= i_rfvals(U,b) %#ok<INUSL,DEFNU>

rf = [];
dG = [];

it should work. There are other functions in weibul that will be invalid for your model. If you are not certain what to do I suggest you replace all the optional functions with the ones in xregusermod/functemplate.

I recommend that you start from the blank template file xregusermod/functemplate when writing a user-defined model. weibul is documented as an example of user-defined models rather than a template.

I'd be happy to help you further if you send me your user-defined model and let me know what version of MBC you are using.

Best regards,
Ian

Subject: Creating new user-defined model in Model-Based Calibration toolbox

From: Mohammad Monfared

Date: 4 Dec, 2008 15:44:02

Message: 4 of 5

Hi & So thanks Ian,

I've build my models using the template_function as you said, and it was successful !
I have another question, if you would help. In the model setup section of mbcmodel, I've made a two-stage, multiple-model with two model included in the local model. And I like to compare these two ones according to the AICc criterion. In the 431 observations, there are obs where model1 is preferred and obs where model2. How can I count the successful obs for model1 and model2?

Thanks in advanced,
Mohammad

Subject: Creating new user-defined model in Model-Based Calibration toolbox

From: Ian Noell

Date: 16 Dec, 2008 11:12:02

Message: 5 of 5

Hi Mohammed,

There is not a simple way to get a list of all the selected models from the GUI. At the moment the simplest way for you to find out this information is using the command-line API.

I will make an enhancement request to add a the ability to get this information from the GUI.

Best regards,
Ian

"Mohammad Monfared" <gohardoust@gmail.com> wrote in message <gh8ts2$kba$1@fred.mathworks.com>...
> Hi & So thanks Ian,
>
> I've build my models using the template_function as you said, and it was successful !
> I have another question, if you would help. In the model setup section of mbcmodel, I've made a two-stage, multiple-model with two model included in the local model. And I like to compare these two ones according to the AICc criterion. In the 431 observations, there are obs where model1 is preferred and obs where model2. How can I count the successful obs for model1 and model2?
>
> Thanks in advanced,
> Mohammad

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com