fnScale
- fnScale
model : | SiteMixtureModel (pass by const reference) |
The mixture model to scale. | |
rate : | RealPos (pass by const reference) |
The factor by which to scale the speed. |
Q = fnJC(4) # The rate of Q is 1
# Operating on SiteMixtureModel
Q2 = fnScale(Q,2) # The rate of Q2 is 2
# Operating on SiteMixtureModel[]
Qs = fnScale([Q,Q],[1,2]) # Qs[1] and Qs[2] have rates 1 and 2
Qs = fnScale(Q, [1,2]) # An abbreviation for the above.
# We can build up models iteratively using pipes
Qs = Q |> fnScale([1,2]) # A shorter abbreviation.
# A JC+LogNormal[4] ASRV model
site_rates := dnLognormal(0,lsigma) |> fnDiscretizeDistribution(4)
MM := fnJC(4) |> fnScale(site_rates) |> fnMixtureASRV()
M := fnScale(MM, 1/MM.rate())
# A FreeRates[5] ASRV model
rates ~ dnDirichlet( [1,1,1,1,1] )
weights ~ dnDirichlet( [2,2,2,2,2] )
MM := fnJC(4) |> fnScale(rates) |> fnMixtureASRV(weights)
M := fnScale(MM, 1/MM.rate())