TS.inverse.simple: Simple TS inversion through minimisation of sum of squares

View source: R/simple_inversion.R

TS.inverse.simpleR Documentation

Simple TS inversion through minimisation of sum of squares

Description

Takes data TS and a data frame containing simulated TS at known Length and Orientation to find the closest matching parameters

Usage

TS.inverse.simple(TS.test, TS.sim, n.nf = 3)

Arguments

TS.test

Dataframe with TS values, where column names are the frequencies

TS.sim

Dataframe with modelled TS values, where each row is a sample and column names are the frequencies, the last columns contain the parameters

n.nf

number of factors contained within the data frame

Author(s)

Sven Gastauer

Examples

#load data
data(TS_sim)
#select random row
rr<-sample(1:nrow(TS.sim),1)
TS.inv <- TS.inverse.simple(TS.test=TS.sim[rr,1:(length(TS.sim)-3)],
                           TS.sim=TS.sim,n.nf=3)
 ##########################################################
## CREATE PLOTS
##########################################################
ggplot(data=TS.inv,aes(x=L,y=theta,fill=log10(ss)))+
  geom_raster(interpolate=TRUE)+
  scale_fill_viridis(name="Log10(Sum of Squares)")+
  scale_x_continuous(expand=c(0,0))+
  xlab("Length [mm]")+
  ylab(expression(paste("Incident Angle", theta, " [",degree,"]")))+
  scale_y_continuous(expand=c(0,0))+
  theme_minimal()+
  theme(axis.text = element_text(size=16),
        axis.title = element_text(size=18),
        legend.position = "top")

AustralianAntarcticDivision/ZooScatR documentation built on Aug. 13, 2022, 1:21 a.m.