View source: R/ppmlasso/R/ppmlasso_functions.R View source: R/ppmlasso_functions.R

plotPath | R Documentation |

`ppmlasso`

modelThis function produces a trace plot of the coefficient estimates of a fitted `ppmlasso`

object and identifies the models which optimise the various penalisation criteria.

```
plotPath(fit, colors = c("gold", "green3", "blue", "brown", "pink"), logX = TRUE)
```

`fit` |
A fitted |

`colors` |
A vector of colours for each criterion: |

`logX` |
A logical argument to indicate whether the plot should utilise a logarithmic scale on the x-axis (the default) or not. |

A fitted `ppmlasso`

object contains a matrix called `betas`

which stores the coefficient estimates of each of the `n.fits`

models fitted. This function produces a traceplot of these coefficient estimates for each environmental variable and highlights the models which optimise each of the penalisation criteria.

Ian W. Renner

```
data(BlueMountains)
sub.env = BlueMountains$env[BlueMountains$env$Y > 6270 & BlueMountains$env$X > 300,]
sub.euc = BlueMountains$eucalypt[BlueMountains$eucalypt$Y > 6270 & BlueMountains$eucalypt$X > 300,]
ppm.form = ~poly(FC, TMP_MIN, TMP_MAX, RAIN_ANN, degree = 2) + poly(D_MAIN_RDS, D_URBAN, degree = 2)
ppm.fit = ppmlasso(ppm.form, sp.xy = sub.euc, env.grid = sub.env, sp.scale = 1, n.fits = 20,
writefile = FALSE)
plotPath(ppm.fit)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.