In [1]:
using DataFrames,JWAS,JWAS.Datasets
In [2]:
pedfile = Datasets.dataset("testMME","pedigree.txt")
phenofile = Datasets.dataset("testMME","simple.txt");
In [3]:
;cat $pedfile
In [4]:
d1 = readtable(phenofile)
Out[4]:
In [5]:
ped = get_pedigree(pedfile);
In [6]:
varRes=1.0
model1 = build_model("y = intercept + Age + Animal",varRes)
set_covariate(model1,"Age")
G=2.5
set_random(model1,"Animal",ped,G)
In [7]:
out = solve(model1,d1,solver="GaussSeidel",printout_frequency=40)
Out[7]:
In [8]:
phenofile = Datasets.dataset("testMME","repeated_measures.txt")
d2 = readtable(phenofile)
Out[8]:
In [9]:
varRes=1.0
model2 = build_model("y = intercept + Age + Animal + Animal*Age",varRes)
set_covariate(model2,"Age")
G = [1 0.1; 0.1 1.0]
set_random(model2,"Animal Animal*Age",ped,G)
In [10]:
out = solve(model2,d2,solver="Jacobi",printout_frequency=40)
Out[10]:
In [11]:
out = runMCMC(model2,d2,chain_length=1000);
In [12]:
phenofile = Datasets.dataset("testMME","maternal_effects.txt")
d3 = readtable(phenofile)
Out[12]:
In [13]:
;cat $pedfile
In [14]:
varRes = 1.0
model3 = build_model("y = intercept + Animal + Dam",varRes);
In [15]:
G = [1 0.1; 0.1 1.0]
set_random(model3,"Animal Dam",ped,G)
In [16]:
out = solve(model3,d3,solver="Gibbs",printout_frequency=1000)
Out[16]:
In [17]:
outputMCMCsamples(model3,"Animal");
out = runMCMC(model3,d3,chain_length=1000,output_samples_frequency=10);
In [18]:
keys(out)
Out[18]:
In [19]:
out["Posterior mean of location parameters"]
Out[19]:
In [20]:
out["MCMC samples for: 1:Animal"]
Out[20]: