RMark 2.1.6

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

RMark 2.1.6

Postby jlaake » Fri Aug 02, 2013 3:16 pm

I posted a new version of RMark to my github site.
https://drive.google.com/folderview?id= ... sp=sharing

Before I post it to CRAN if some folks could test it for me I'd appreciate it.

In addition to some changes and bug fixes (see news(package="RMark") after installing), I added a feature in which real parameters can be fixed by adding a field called fix in the design data for a parameter. It has values of NA for free parameters and a real value for any fixed parameter. You can over-ride those values by using fixed=list(index=,value=) approach. You'll receive a message that you are doing so in case it is unintended. I'm hoping folks will use this approach in place of deleting design data which is still allowed but doesn't work with all parameters. This new approach will work for any parameter.


Code: Select all
library(RMark)
data(dipper)
dp=process.data(dipper)
ddl=make.design.data(dp)
# assign p=1 for time=3; all others are NA and free to vary
ddl$p$fix=ifelse(ddl$p$time==3,1,NA)
head(ddl$p)
# fit model and show real parameters
summary(mark(dp,ddl),show.fixed=T)
# if you specify a fixed value in the model that overlaps with fixed values in the
# design data, it will override the value but you'll get a message that indices are
# duplicated. This is not a problem but was added so the user was aware if unintended.
summary(mark(dp,ddl,model.parameters=list(p=list(formula=~1,fixed=list(index=2,value=0)))),show.fixed=T)
jlaake
 
Posts: 1480
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: RMark 2.1.6

Postby jlaake » Fri Aug 02, 2013 5:49 pm

The following is a better way to see the example. I'm using output=FALSE so the run doesn't show any output and summary and the summary shows the results with show.fixed=TRUE which shows the fixed values. Otherwise you see 2 copies of the summary. The first doesn't show the fixed values - they are left blank and the second shows the fixed values. --jeff

Code: Select all
library(RMark)
data(dipper)
dp=process.data(dipper)
ddl=make.design.data(dp)
# assign p=1 for time=3; all others are NA and free to vary
ddl$p$fix=ifelse(ddl$p$time==3,1,NA)
head(ddl$p)
# fit model and show real parameters
summary(mark(dp,ddl,output=FALSE),show.fixed=T)
# if you specify a fixed value in the model that overlaps with fixed values in the
# design data, it will override the value but you'll get a message that indices are
# duplicated. This is not a problem but was added so the user was aware if unintended.
summary(mark(dp,ddl,output=FALSE,model.parameters=list(p=list(formula=~1,fixed=list(index=2,value=0)))),show.fixed=T)
jlaake
 
Posts: 1480
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: RMark 2.1.6

Postby tommyg » Thu Sep 05, 2013 11:12 am

Hi Jeff,

Thanks for constant updates and improvements to RMark. It's a great tool.

I find that adding a fixed column to the design data is much cleaner approach to fixing parameters compared to deleting rows of the deleting design. However, I've noticed that the "retry" argument in the 'mark' function does not work when using this new approach. I believe this was also the case in previous versions of RMark when the parameters were fixed with formula statements such as: parameter=list(formula=~...,fixed=list(time=...,value=1))
I found that deleting design data ensured that the number of initial values grabbed by the 'retry' option was the same as the number of columns in the design matrix. Given that you're discouraging deleting design data, do you have recommended approach to rerunning a model with initial values when some parameters are fixed other than doing it manually with the 'initial' arguement, using the previous model estimates and imputing missing values and/or 0's as necessary.

Thanks.

Tommy
tommyg
 
Posts: 21
Joined: Tue Mar 01, 2011 1:55 pm

Re: RMark 2.1.6

Postby jlaake » Thu Sep 05, 2013 11:52 am

I wasn't aware of that issue. I'll look into it. It should be possible to code it up so it works like initial argument.

--jeff
jlaake
 
Posts: 1480
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 1 guest