<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://nd.psychstat.org/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://nd.psychstat.org/feed.php">
        <title>@ND - lab:projects:12bayesian_random_coefficients_lcsm</title>
        <description></description>
        <link>https://nd.psychstat.org/</link>
        <image rdf:resource="https://nd.psychstat.org/_media/wiki/dokuwiki.svg" />
       <dc:date>2026-05-05T11:24:25+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/alternative_specification"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/another_way"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/bugs_codes_for_the_model_random_-_ranmodel.txt"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/data_generation"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/generate_simulation_scripts"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/index"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/initial_value_file_-_raninits.txt"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/r_codes_to_run_the_simulation"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/script_file_-_ranscript.txt"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/submission_file_-_ransub.sh"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://nd.psychstat.org/_media/wiki/dokuwiki.svg">
        <title>@ND</title>
        <link>https://nd.psychstat.org/</link>
        <url>https://nd.psychstat.org/_media/wiki/dokuwiki.svg</url>
    </image>
    <item rdf:about="https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/alternative_specification">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>alternative_specification</title>
        <link>https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/alternative_specification</link>
        <description>model{
   for (i in 1:N){
       LS[i, 1]~dnorm(mu[1], inv_sigL2)
       LS[i, 2]~dnorm(muS[i], inv_sigS2)
       muS[i]&lt;-mu[2]+lambda*(LS[i,1]-mean(LS[,1]))
       
       Y[i,1]~dnorm(y[i,1],inv_sig_e2)

       y[i,1]&lt;-LS[i,1]

        for (t in 2:T){
             Y[i,t]~dnorm(y[i,t], inv_sig_e2)
             d[i,t-1]&lt;-gamma[i,t-1]*y[i,t-1]+LS[i,2]
             y[i,t]&lt;-d[i,t-1]+y[i,t-1]
				
				## another way to deal this
				gamma[i, t-1]~dnorm(mugamma[i,t-1], inv_sig_v2)
				mugamma[i, t-1]…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/another_way">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>another_way</title>
        <link>https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/another_way</link>
        <description>model{
   for (i in 1:N){
       R[i, 1] ~ dnorm(0,1)
       R[i, 2] ~ dnorm(0, 1)

       LS[i, 1]&lt;-mu[1]+sigma[1]*R[i,1]
       LS[i, 2]&lt;-mu[2]+rho*sigma[2]*R[i,1]+sigma[2]*sqrt(1-rho*rho)*R[i,2]

       Y[i,1]~dnorm(y[i,1],inv_sig_e2)

       y[i,1]&lt;-LS[i,1]

        for (t in 2:T){
             Y[i,t]~dnorm(y[i,t], inv_sig_e2)
             d[i,t-1]&lt;-gamma[i,t-1]*y[i,t-1]+LS[i,2]
             y[i,t]&lt;-d[i,t-1]+y[i,t-1]
				
				## another way to deal this
				gamma[i, t-1]~dnorm(mugamma[i,t-1]…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/bugs_codes_for_the_model_random_-_ranmodel.txt">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>bugs_codes_for_the_model_random_-_ranmodel.txt</title>
        <link>https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/bugs_codes_for_the_model_random_-_ranmodel.txt</link>
        <description>model{
   for (i in 1:N){
       LS[i,1:2]~dmnorm(mu[1:2], inv_sig_LS[1:2,1:2])
       Y[i,1]~dnorm(y[i,1],inv_sig_e2)

       y[i,1]&lt;-LS[i,1]

        for (t in 2:T){
             Y[i,t]~dnorm(y[i,t], inv_sig_e2)
             d[i,t-1]&lt;-gamma[i,t-1]*y[i,t-1]+LS[i,2]
             y[i,t]&lt;-d[i,t-1]+y[i,t-1]
				
				## another way to deal this
				gamma[i, t-1]~dnorm(mugamma[i,t-1], inv_sig_v2)
				mugamma[i, t-1]&lt;-beta0+beta1*X[i,t-1] + beta2*Z[i]
        }
    }

       inv_sig_e2~dgamma(.001,.00…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/data_generation">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>data_generation</title>
        <link>https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/data_generation</link>
        <description>*  Using Bugs


##Model part
model{
   for (i in 1:N){
       LS[i,1:2]~dmnorm(mu[1:2], inv_sig_LS[1:2,1:2])
       Y[i,1]~dnorm(y[i,1],inv_sig_e2)

       y[i,1]&lt;-LS[i,1]

        for (t in 2:T){
             Y[i,t]~dnorm(y[i,t], inv_sig_e2)
             d[i,t-1]&lt;-gamma[i,t-1]*y[i,t-1]+LS[i,2]
             y[i,t]&lt;-d[i,t-1]+y[i,t-1]
				
				## another way to deal this
				gamma[i, t-1]~dnorm(mugamma[i,t-1], inv_sig_v2)
				mugamma[i, t-1]&lt;-beta1*X[i,t-1] + beta2*Z[i] 
				X[i,t-1]~dnorm(0,1)
		…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/generate_simulation_scripts">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>generate_simulation_scripts</title>
        <link>https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/generate_simulation_scripts</link>
        <description>Process the results



geweke&lt;-function(x, frac1 = 0.2, frac2 = 0.5){

	xstart &lt;- c(start(x), end(x) - frac2 * (end(x) - start(x)))[c(1,3)]
   xend &lt;- c(start(x) + frac1 * (end(x) - start(x)), end(x))[c(1,3)]

   y.variance &lt;- y.mean &lt;- vector(&quot;list&quot;, 2)
   for (i in 1:2) {
        y &lt;- window(x, start = xstart[i], end = xend[i])
        y.mean[[i]] &lt;- apply(as.matrix(y), 2, mean)
        y.variance[[i]] &lt;- apply(as.matrix(y), 2, var)
    }
    z &lt;- (y.mean[[1]] - y.mean[[2]])/sqrt(y.variance[[1…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/index">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>index</title>
        <link>https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/index</link>
        <description>Random coefficients LCSM

NLSY97 data

	*  [Data set]
	*  Variables in the data set
		*  Outcome: piat1-piat5: PIAT math test standard score from Year 1998-2002
		*  Time varying covariates: smoke1-smoke5: # of days smoked in last 30 days Year 1998-2002
		*  Time invariant covariates: op: optimistic about the future (1997), depress: depression at 2002</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/initial_value_file_-_raninits.txt">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>initial_value_file_-_raninits.txt</title>
        <link>https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/initial_value_file_-_raninits.txt</link>
        <description>list(beta0=-.3, beta1=0,beta2=0,inv_sig_e2=1,inv_sig_v2=.1, mu=c(3,10), inv_sig_LS=structure(.Data=c(1,0,0,1),.Dim=c(2,2)))</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/r_codes_to_run_the_simulation">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>r_codes_to_run_the_simulation</title>
        <link>https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/r_codes_to_run_the_simulation</link>
        <description>for (r in 1:1000){
  ## copy data
  from.file&lt;-paste(&#039;/pscratch/zzhang4/Private/LCSM/data/simdata-N&#039;,NSIM,&#039;-T&#039;,TSIM,&#039;-&#039;,r,&#039;.txt&#039;, sep=&#039;&#039;)
  to.file&lt;-paste(&#039;/pscratch/zzhang4/Private/LCSM/analysis/N&#039;,NSIM,&#039;T&#039;,TSIM,&#039;/data.txt&#039;, sep=&#039;&#039;)
  file.copy(from.file, to.file,overwrite =TRUE)
  
  runtry&lt;-try(system(&#039;/pscratch/zzhang4/Private/bugs/bin/OpenBUGS  &lt; script.txt &gt; out.txt&#039;))
  if (class(runtry) != &quot;try-error&quot;){
  	## save the output
  	## copy the DIC
  	to.file&lt;-paste(&#039;/pscratch/zzhang4/Private…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/script_file_-_ranscript.txt">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>script_file_-_ranscript.txt</title>
        <link>https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/script_file_-_ranscript.txt</link>
        <description>modelCheck(&quot;model.txt&quot;)
modelData(&quot;data.txt&quot;)
modelCompile()
modelInits(&quot;inits.txt&quot;)
modelGenInits()
modelUpdate(10000)
samplesSet(&quot;para&quot;)
modelPrecision(8)
dicSet()
modelUpdate(50000)
dicStats();
samplesCoda(&quot;para&quot;,&quot;coda&quot;)
modelQuit()</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/submission_file_-_ransub.sh">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>submission_file_-_ransub.sh</title>
        <link>https://nd.psychstat.org/lab/projects/12bayesian_random_coefficients_lcsm/submission_file_-_ransub.sh</link>
        <description>#!/bin/csh 
#$ -M zzhang4@nd.edu 
#$ -m abe 
#$ -r y

module load R

R CMD BATCH runsim.R</description>
    </item>
</rdf:RDF>
