kaskr / RTMB

R bindings to TMB
Other
49 stars 6 forks source link

dgmrf scale argument #38

Closed kaskr closed 4 weeks ago

kaskr commented 4 weeks ago

Reported by @fishfollower

dgmrf(1:10, mu=2:11, Q=Matrix:::Diagonal(10), log=TRUE)
#[1] -14.18939 
dgmrf(1:10-2:11, Q=Matrix:::Diagonal(10), log=TRUE)
#[1] -14.18939
dgmrf(1:10, mu=2:11, Q=Matrix:::Diagonal(10)/2/2, log=TRUE)
#[1] -17.37086
dgmrf(1:10-2:11, Q=Matrix:::Diagonal(10)/2/2, log=TRUE)
#[1] -17.37086
dgmrf(1:10-2:11, Q=Matrix:::Diagonal(10), scale=2, log=TRUE)
#[1] -17.37086
dgmrf(1:10, mu=2:11, Q=Matrix:::Diagonal(10), scale=2, log=TRUE)
#[1] -96.74586

The last result is wrong - should be same as previous.