RMark: initial values within mark.wrapper()

posts related to the RMark library, which may not be of general interest to users of 'classic' MARK

RMark: initial values within mark.wrapper()

Postby OlivierD » Thu Aug 21, 2008 7:50 pm

Hi all,

Is there a way to use a vector of initial values within the function mark.wrapper() ?

For example: in order to reach convergence with my base model (let's name it {base}), I need to run the simulated annealing. So I run this model separately and get a vector of beta-values that I can use as initial values for the next models, thus avoiding to run the annealing for each model.

Then, I can define the components (eg Psi formulaes) for other models. The structure of my base model is common to all models. New models just add a few columns to the design.matrix so that I have models {base+covariate1} or {base+covariate1+covariate2}... And I can use create.model.list() and mark.wrapper() to run everything at once, passing the argument initial=vector_of_initial_values_from_base_model to the function mark.wrapper().

The only thing is that RMark complains that the "length of initial vector doesn't match design matrix", which i vector of initial valuess totally right!

Would there be a way to use initial values in mark.wrapper() anyway. Something like passing it initial values only for the base part of the model but letting it estimate betas for other ("new") parameters? Or maybe passing it a too long vector of initial values with an internal function that would cut the vector at the right size?

Thanks for you help.

Olivier
OlivierD
 
Posts: 8
Joined: Thu Feb 28, 2008 8:37 pm
Location: somewhere in between

mark.wrapper

Postby jlaake » Fri Aug 22, 2008 1:17 am

The ... argument of mark.wrapper means that any arguments that don't match those for mark.wrapper are sent to the function mark. One of the possible arguments for mark is initial= which can be set to either a vector or a mark model object. You should specify initial=base in the mark.wrapper and it will match parameters from base to each model and will use any that match columns will be used as starting values. Any that don't match are assigned an initial value of 0.

--jeff
jlaake
 
Posts: 1417
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA


Return to RMark

Who is online

Users browsing this forum: No registered users and 14 guests

cron