Dosen Pengampu : Prof. Dr. Suhartono, M.Kom
Lembaga : Universitas Islam Negeri Maulana Malik Ibrahim Malang
Fakultas : Sains dan Teknologi
Program Studi : Teknik Informatika
Kelas : B
NIM : 230605110057
library(mosaicCalc)
## Loading required package: mosaic
## Registered S3 method overwritten by 'mosaic':
## method from
## fortify.SpatialPolygonsDataFrame ggplot2
##
## The 'mosaic' package masks several functions from core packages in order to add
## additional features. The original behavior of these functions should not be affected by this.
##
## Attaching package: 'mosaic'
## The following objects are masked from 'package:dplyr':
##
## count, do, tally
## The following object is masked from 'package:Matrix':
##
## mean
## The following object is masked from 'package:ggplot2':
##
## stat
## The following objects are masked from 'package:stats':
##
## binom.test, cor, cor.test, cov, fivenum, IQR, median, prop.test,
## quantile, sd, t.test, var
## The following objects are masked from 'package:base':
##
## max, mean, min, prod, range, sample, sum
## Loading required package: mosaicCore
##
## Attaching package: 'mosaicCore'
## The following objects are masked from 'package:dplyr':
##
## count, tally
## The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
## which was just loaded, will retire in October 2023.
## Please refer to R-spatial evolution reports for details, especially
## https://r-spatial.org/r/2023/05/15/evolution4.html.
## It may be desirable to make the sf package available;
## package maintainers should consider adding sf to Suggests:.
## The sp package is now running under evolution status 2
## (status 2 uses the sf package in place of rgdal)
##
## Attaching package: 'mosaicCalc'
## The following object is masked from 'package:stats':
##
## D
Optimasi dalam kalkulus mosaic adalah proses menemukan nilai maksimum atau minimum dari suatu fungsi dalam beberapa variabel dengan menggunakan konsep turunan parsial. Ini dapat digunakan untuk menemukan solusi terbaik dalam berbagai masalah di dunia nyata, seperti optimasi biaya, keuntungan, atau efisiensi.
f <- rfun ( ~ x, seed =690 )
slice_plot(f(x) ~ x, bounds(x=-3:3)) %>%
gf_hline(yintercept = ~ 0, color="red")
Fungsi R/mosaik argM() merupakan fungsi argmax dan argmin pada domain tertentu. Cara kerjanya persis sama seperti slice_plot(), namun alih-alih menggambar grafik, ia mengembalikan bingkai data yang memberikan argmax di satu baris dan argmin di baris lainnya.
h <- rfun(~ x, seed=690)
argM(h(x) ~ x, bounds(x=-3:3))
## # A tibble: 2 × 3
## x .output. concavity
## <dbl> <dbl> <dbl>
## 1 -0.633 -5.87 1
## 2 2.04 6.70 -1
Kolom x menampung argmax dan argmin, .output.kolom memberikan nilai output fungsi untuk input x. Kolom tersebut concavity menunjukkan apakah kecekungan fungsi tersebut x positif atau negatif. Mendekati puncak, cekungannya akan menjadi negatif; dekat lembah, cekungannya positif. Akibatnya, Anda dapat melihat bahwa baris pertama dari bingkai data sesuai dengan minimum lokal dan baris kedua adalah maksimum lokal.
argM()diatur untuk mencari satu argmax dan satu argmin dalam interval domain yang diberikan sebagai argumen kedua. Pada Output diatas terdapat dua puncak lokal dan dua lembah lokal. argM()hanya memberikan puncak terbesar dan lembah terdalam.
Sumber : Kalkulus Mosaic, https://dtkaplan.github.io/MC2/#instructors-preface